WPILibC++ 2024.3.2
nt::Event Class Reference

NetworkTables event. More...

#include <ntcore_cpp.h>

Public Member Functions

 Event ()=default
 
 Event (NT_Listener listener, unsigned int flags, ConnectionInfo info)
 
 Event (NT_Listener listener, unsigned int flags, TopicInfo info)
 
 Event (NT_Listener listener, unsigned int flags, ValueEventData data)
 
 Event (NT_Listener listener, unsigned int flags, LogMessage msg)
 
 Event (NT_Listener listener, unsigned int flags, NT_Topic topic, NT_Handle subentry, Value value)
 
 Event (NT_Listener listener, unsigned int flags, unsigned int level, std::string_view filename, unsigned int line, std::string_view message)
 
 Event (NT_Listener listener, unsigned int flags, int64_t serverTimeOffset, int64_t rtt2, bool valid)
 
bool Is (unsigned int kind) const
 Test event flags. More...
 
const ConnectionInfoGetConnectionInfo () const
 
ConnectionInfoGetConnectionInfo ()
 
const TopicInfoGetTopicInfo () const
 
TopicInfoGetTopicInfo ()
 
const ValueEventDataGetValueEventData () const
 
ValueEventDataGetValueEventData ()
 
const LogMessageGetLogMessage () const
 
LogMessageGetLogMessage ()
 
const TimeSyncEventDataGetTimeSyncEventData () const
 
TimeSyncEventDataGetTimeSyncEventData ()
 

Public Attributes

NT_Listener listener {0}
 Listener that triggered this event. More...
 
unsigned int flags {0}
 Event flags (NT_EventFlags). More...
 
std::variant< ConnectionInfo, TopicInfo, ValueEventData, LogMessage, TimeSyncEventDatadata
 Event data; content depends on flags. More...
 

Detailed Description

NetworkTables event.

Constructor & Destructor Documentation

◆ Event() [1/8]

nt::Event::Event ( )
default

◆ Event() [2/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
ConnectionInfo  info 
)
inline

◆ Event() [3/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
TopicInfo  info 
)
inline

◆ Event() [4/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
ValueEventData  data 
)
inline

◆ Event() [5/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
LogMessage  msg 
)
inline

◆ Event() [6/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
NT_Topic  topic,
NT_Handle  subentry,
Value  value 
)
inline

◆ Event() [7/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
unsigned int  level,
std::string_view  filename,
unsigned int  line,
std::string_view  message 
)
inline

◆ Event() [8/8]

nt::Event::Event ( NT_Listener  listener,
unsigned int  flags,
int64_t  serverTimeOffset,
int64_t  rtt2,
bool  valid 
)
inline

Member Function Documentation

◆ GetConnectionInfo() [1/2]

ConnectionInfo * nt::Event::GetConnectionInfo ( )
inline

◆ GetConnectionInfo() [2/2]

const ConnectionInfo * nt::Event::GetConnectionInfo ( ) const
inline

◆ GetLogMessage() [1/2]

LogMessage * nt::Event::GetLogMessage ( )
inline

◆ GetLogMessage() [2/2]

const LogMessage * nt::Event::GetLogMessage ( ) const
inline

◆ GetTimeSyncEventData() [1/2]

TimeSyncEventData * nt::Event::GetTimeSyncEventData ( )
inline

◆ GetTimeSyncEventData() [2/2]

const TimeSyncEventData * nt::Event::GetTimeSyncEventData ( ) const
inline

◆ GetTopicInfo() [1/2]

TopicInfo * nt::Event::GetTopicInfo ( )
inline

◆ GetTopicInfo() [2/2]

const TopicInfo * nt::Event::GetTopicInfo ( ) const
inline

◆ GetValueEventData() [1/2]

ValueEventData * nt::Event::GetValueEventData ( )
inline

◆ GetValueEventData() [2/2]

const ValueEventData * nt::Event::GetValueEventData ( ) const
inline

◆ Is()

bool nt::Event::Is ( unsigned int  kind) const
inline

Test event flags.

Parameters
kindevent flag(s) to test
Returns
True if flags matches kind

Member Data Documentation

◆ data

Event data; content depends on flags.

◆ flags

unsigned int nt::Event::flags {0}

Event flags (NT_EventFlags).

Also indicates the data included with the event:

◆ listener

NT_Listener nt::Event::listener {0}

Listener that triggered this event.


The documentation for this class was generated from the following file: