WPILibC++  2019.1.1-beta-4-11-ga7f4e29
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
ntcore C++ object-oriented API

Recommended interface for C++, identical to Java API. More...

Classes

class  nt::NetworkTable
 A network table that knows its subtable path. More...
 
class  nt::Value
 A network table entry value. More...
 
class  nt::RpcCall
 NetworkTables Remote Procedure Call. More...
 
class  nt::NetworkTableEntry
 NetworkTables Entry. More...
 
class  nt::NetworkTableInstance
 NetworkTables Instance. More...
 

Typedefs

typedef Value nt::NetworkTableValue
 NetworkTable Value alias for similarity with Java.
 
typedef std::function< void(NetworkTable
*parent, StringRef name,
std::shared_ptr< NetworkTable >
table)> 
nt::TableListener
 A listener that listens to new sub-tables in a NetworkTable. More...
 
typedef std::function< void(NetworkTable
*table, StringRef name,
NetworkTableEntry entry,
std::shared_ptr< Value > value,
int flags)> 
nt::TableEntryListener
 A listener that listens to changes in values in a NetworkTable. More...
 

Enumerations

enum  nt::NetworkTableType {
  kUnassigned = NT_UNASSIGNED, kBoolean = NT_BOOLEAN, kDouble = NT_DOUBLE, kString = NT_STRING,
  kRaw = NT_RAW, kBooleanArray = NT_BOOLEAN_ARRAY, kDoubleArray = NT_DOUBLE_ARRAY, kStringArray = NT_STRING_ARRAY,
  kRpc = NT_RPC
}
 NetworkTable entry type.
 
enum  {
  nt::EntryListenerFlags::kImmediate = NT_NOTIFY_IMMEDIATE, nt::EntryListenerFlags::kLocal = NT_NOTIFY_LOCAL, nt::EntryListenerFlags::kNew = NT_NOTIFY_NEW, nt::EntryListenerFlags::kDelete = NT_NOTIFY_DELETE,
  nt::EntryListenerFlags::kUpdate = NT_NOTIFY_UPDATE, nt::EntryListenerFlags::kFlags = NT_NOTIFY_FLAGS
}
 Flag values for use with entry listeners. More...
 
enum  nt::NetworkTableEntry::Flags { kPersistent = NT_PERSISTENT }
 Flag values (as returned by GetFlags()).
 
enum  nt::NetworkTableInstance::NetworkMode {
  kNetModeNone = NT_NET_MODE_NONE, kNetModeServer = NT_NET_MODE_SERVER, kNetModeClient = NT_NET_MODE_CLIENT, kNetModeStarting = NT_NET_MODE_STARTING,
  kNetModeFailure = NT_NET_MODE_FAILURE
}
 Client/server mode flag values (as returned by GetNetworkMode()). More...
 
enum  nt::NetworkTableInstance::LogLevel {
  kLogCritical = NT_LOG_CRITICAL, kLogError = NT_LOG_ERROR, kLogWarning = NT_LOG_WARNING, kLogInfo = NT_LOG_INFO,
  kLogDebug = NT_LOG_DEBUG, kLogDebug1 = NT_LOG_DEBUG1, kLogDebug2 = NT_LOG_DEBUG2, kLogDebug3 = NT_LOG_DEBUG3,
  kLogDebug4 = NT_LOG_DEBUG4
}
 Logging levels (as used by SetLogger()).
 
enum  { kDefaultPort = NT_DEFAULT_PORT }
 The default port that network tables operates on.
 

Detailed Description

Recommended interface for C++, identical to Java API.

Typedef Documentation

typedef std::function<void(NetworkTable* table, StringRef name, NetworkTableEntry entry, std::shared_ptr<Value> value, int flags)> nt::TableEntryListener

A listener that listens to changes in values in a NetworkTable.

Called when a key-value pair is changed in a NetworkTable.

Parameters
tablethe table the key-value pair exists in
keythe key associated with the value that changed
entrythe entry associated with the value that changed
valuethe new value
flagsupdate flags; for example, EntryListenerFlags.kNew if the key did not previously exist
typedef std::function<void(NetworkTable* parent, StringRef name, std::shared_ptr<NetworkTable> table)> nt::TableListener

A listener that listens to new sub-tables in a NetworkTable.

Called when a new table is created.

Parameters
parentthe parent of the table
namethe name of the new table
tablethe new table

Enumeration Type Documentation

anonymous enum

Flag values for use with entry listeners.

The flags are a bitmask and must be OR'ed together to indicate the combination of events desired to be received.

The constants kNew, kDelete, kUpdate, and kFlags represent different events that can occur to entries.

By default, notifications are only generated for remote changes occurring after the listener is created. The constants kImmediate and kLocal are modifiers that cause notifications to be generated at other times.

Enumerator
kImmediate 

Initial listener addition.

Set this flag to receive immediate notification of entries matching the flag criteria (generally only useful when combined with kNew).

kLocal 

Changed locally.

Set this flag to receive notification of both local changes and changes coming from remote nodes. By default, notifications are only generated for remote changes. Must be combined with some combination of kNew, kDelete, kUpdate, and kFlags to receive notifications of those respective events.

kNew 

Newly created entry.

Set this flag to receive a notification when an entry is created.

kDelete 

Entry was deleted.

Set this flag to receive a notification when an entry is deleted.

kUpdate 

Entry's value changed.

Set this flag to receive a notification when an entry's value (or type) changes.

kFlags 

Entry's flags changed.

Set this flag to receive a notification when an entry's flags value changes.

Client/server mode flag values (as returned by GetNetworkMode()).

This is a bitmask.