Event polled listener.
More...
#include <networktables/NetworkTableListener.h>
Event polled listener.
This queues events matching the specified mask. Code using the listener must periodically call ReadQueue() to read the events.
◆ NetworkTableListenerPoller() [1/4]
nt::NetworkTableListenerPoller::NetworkTableListenerPoller |
( |
| ) |
|
|
default |
◆ NetworkTableListenerPoller() [2/4]
Construct a listener poller.
- Parameters
-
◆ NetworkTableListenerPoller() [3/4]
◆ NetworkTableListenerPoller() [4/4]
◆ ~NetworkTableListenerPoller()
nt::NetworkTableListenerPoller::~NetworkTableListenerPoller |
( |
| ) |
|
|
inline |
◆ AddConnectionListener()
NT_Listener nt::NetworkTableListenerPoller::AddConnectionListener |
( |
bool |
immediate_notify | ) |
|
|
inline |
Add a connection listener.
The callback function is called asynchronously on a separate thread, so it's important to use synchronization or atomics when accessing any shared state from the callback function.
- Parameters
-
immediate_notify | notify listener of all existing connections |
- Returns
- Listener handle
◆ AddListener() [1/5]
Start listening to topic changes on a subscriber.
This does NOT keep the subscriber active.
- Parameters
-
- Returns
- Listener handle
◆ AddListener() [2/5]
Start listening to topic changes on an entry.
- Parameters
-
- Returns
- Listener handle
◆ AddListener() [3/5]
Start listening to topic changes for topics with names that start with any of the given prefixes.
This creates a corresponding internal subscriber with the lifetime of the listener.
- Parameters
-
- Returns
- Listener handle
◆ AddListener() [4/5]
Start listening to topic changes on a subscriber.
This does NOT keep the subscriber active.
- Parameters
-
- Returns
- Listener handle
◆ AddListener() [5/5]
NT_Listener nt::NetworkTableListenerPoller::AddListener |
( |
Topic |
topic, |
|
|
unsigned int |
mask |
|
) |
| |
|
inline |
Start listening to changes to a particular topic.
This creates a corresponding internal subscriber with the lifetime of the listener.
- Parameters
-
- Returns
- Listener handle
◆ AddLogger()
NT_Listener nt::NetworkTableListenerPoller::AddLogger |
( |
unsigned int |
minLevel, |
|
|
unsigned int |
maxLevel |
|
) |
| |
|
inline |
Add logger callback function.
By default, log messages are sent to stderr; this function sends log messages with the specified levels to the provided callback function instead. The callback function will only be called for log messages with level greater than or equal to minLevel and less than or equal to maxLevel; messages outside this range will be silently ignored.
- Parameters
-
minLevel | minimum log level |
maxLevel | maximum log level |
- Returns
- Listener handle
◆ AddTimeSyncListener()
NT_Listener nt::NetworkTableListenerPoller::AddTimeSyncListener |
( |
bool |
immediate_notify | ) |
|
|
inline |
Add a time synchronization listener.
The callback function is called asynchronously on a separate thread, so it's important to use synchronization or atomics when accessing any shared state from the callback function.
- Parameters
-
immediate_notify | notify listener of current time synchronization value |
- Returns
- Listener handle
◆ GetHandle()
Gets the native handle.
- Returns
- Handle
◆ operator bool()
nt::NetworkTableListenerPoller::operator bool |
( |
| ) |
const |
|
inlineexplicit |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ReadQueue()
std::vector< Event > nt::NetworkTableListenerPoller::ReadQueue |
( |
| ) |
|
|
inline |
Read events.
- Returns
- Events since the previous call to ReadQueue()
◆ RemoveListener()
void nt::NetworkTableListenerPoller::RemoveListener |
( |
NT_Listener |
listener | ) |
|
|
inline |
Remove a listener.
- Parameters
-
The documentation for this class was generated from the following files: