WPILibC++ 2024.3.2
|
NetworkTables Entry. More...
#include <networktables/NetworkTableEntry.h>
Public Types | |
enum | Flags { kPersistent = NT_PERSISTENT } |
Flag values (as returned by GetFlags()). More... | |
Public Member Functions | |
NetworkTableEntry () | |
Construct invalid instance. More... | |
NetworkTableEntry (NT_Entry handle) | |
Construct from native handle. More... | |
operator bool () const | |
Determines if the native handle is valid. More... | |
NT_Entry | GetHandle () const |
Gets the native handle for the entry. More... | |
NetworkTableInstance | GetInstance () const |
Gets the instance for the entry. More... | |
bool | Exists () const |
Determines if the entry currently exists. More... | |
std::string | GetName () const |
Gets the name of the entry (the key). More... | |
NetworkTableType | GetType () const |
Gets the type of the entry. More... | |
unsigned int | GetFlags () const |
Returns the flags. More... | |
int64_t | GetLastChange () const |
Gets the last time the entry's value was changed. More... | |
Value | GetValue () const |
Gets the entry's value. More... | |
bool | GetBoolean (bool defaultValue) const |
Gets the entry's value as a boolean. More... | |
int64_t | GetInteger (int64_t defaultValue) const |
Gets the entry's value as a integer. More... | |
float | GetFloat (float defaultValue) const |
Gets the entry's value as a float. More... | |
double | GetDouble (double defaultValue) const |
Gets the entry's value as a double. More... | |
std::string | GetString (std::string_view defaultValue) const |
Gets the entry's value as a string. More... | |
std::vector< uint8_t > | GetRaw (std::span< const uint8_t > defaultValue) const |
Gets the entry's value as a raw. More... | |
std::vector< int > | GetBooleanArray (std::span< const int > defaultValue) const |
Gets the entry's value as a boolean array. More... | |
std::vector< int64_t > | GetIntegerArray (std::span< const int64_t > defaultValue) const |
Gets the entry's value as a integer array. More... | |
std::vector< float > | GetFloatArray (std::span< const float > defaultValue) const |
Gets the entry's value as a float array. More... | |
std::vector< double > | GetDoubleArray (std::span< const double > defaultValue) const |
Gets the entry's value as a double array. More... | |
std::vector< std::string > | GetStringArray (std::span< const std::string > defaultValue) const |
Gets the entry's value as a string array. More... | |
std::vector< NetworkTableValue > | ReadQueue () |
Get an array of all value changes since the last call to ReadQueue. More... | |
bool | SetDefaultValue (const Value &defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultBoolean (bool defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultInteger (int64_t defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultFloat (float defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultDouble (double defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultString (std::string_view defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultRaw (std::span< const uint8_t > defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultBooleanArray (std::span< const int > defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultIntegerArray (std::span< const int64_t > defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultFloatArray (std::span< const float > defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultDoubleArray (std::span< const double > defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetDefaultStringArray (std::span< const std::string > defaultValue) |
Sets the entry's value if it does not exist. More... | |
bool | SetValue (const Value &value) |
Sets the entry's value. More... | |
bool | SetBoolean (bool value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetInteger (int64_t value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetFloat (float value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetDouble (double value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetString (std::string_view value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetRaw (std::span< const uint8_t > value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetBooleanArray (std::span< const bool > value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetBooleanArray (std::span< const int > value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetIntegerArray (std::span< const int64_t > value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetFloatArray (std::span< const float > value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetDoubleArray (std::span< const double > value, int64_t time=0) |
Sets the entry's value. More... | |
bool | SetStringArray (std::span< const std::string > value, int64_t time=0) |
Sets the entry's value. More... | |
void | SetFlags (unsigned int flags) |
Sets flags. More... | |
void | ClearFlags (unsigned int flags) |
Clears flags. More... | |
void | SetPersistent () |
Make value persistent through program restarts. More... | |
void | ClearPersistent () |
Stop making value persistent through program restarts. More... | |
bool | IsPersistent () const |
Returns whether the value is persistent through program restarts. More... | |
void | Unpublish () |
Stops publishing the entry if it's been published. More... | |
void | Delete () |
Deletes the entry. More... | |
Topic | GetTopic () const |
Gets the entry's topic. More... | |
bool | operator== (const NetworkTableEntry &) const =default |
Equality operator. More... | |
Protected Attributes | |
NT_Entry | m_handle {0} |
NetworkTables Entry.
Flag values (as returned by GetFlags()).
Enumerator | |
---|---|
kPersistent |
|
inline |
Construct invalid instance.
|
inlineexplicit |
Construct from native handle.
handle | Native handle |
|
inline |
Clears flags.
flags | the flags to clear (bitmask) |
|
inline |
Stop making value persistent through program restarts.
|
inline |
Deletes the entry.
|
inline |
Determines if the entry currently exists.
|
inline |
Gets the entry's value as a boolean.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a boolean array.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a double.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a double array.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Returns the flags.
|
inline |
Gets the entry's value as a float.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a float array.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the native handle for the entry.
NetworkTableInstance nt::NetworkTableEntry::GetInstance | ( | ) | const |
Gets the instance for the entry.
|
inline |
Gets the entry's value as a integer.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a integer array.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the last time the entry's value was changed.
|
inline |
Gets the name of the entry (the key).
|
inline |
Gets the entry's value as a raw.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a string.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a string array.
If the entry does not exist or is of different type, it will return the default value.
defaultValue | the value to be returned if no value is found |
|
inline |
Gets the type of the entry.
|
inline |
Gets the entry's value.
If the entry does not exist, returns an empty value.
|
inline |
Returns whether the value is persistent through program restarts.
|
inlineexplicit |
Determines if the native handle is valid.
|
default |
Equality operator.
Returns true if both instances refer to the same native handle.
|
inline |
Get an array of all value changes since the last call to ReadQueue.
The "poll storage" subscribe option can be used to set the queue depth.
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
defaultValue | the default value to set |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets flags.
flags | the flags to set (bitmask) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Make value persistent through program restarts.
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
time | the timestamp to set (0 = nt::Now()) |
|
inline |
Sets the entry's value.
value | the value to set |
|
inline |
Stops publishing the entry if it's been published.
|
protected |