9#include <initializer_list>
23class NetworkTableInstance;
59 explicit operator bool()
const {
return m_handle != 0; }
102 [[deprecated(
"Use IsPersistent() or topic properties instead")]]
136 int64_t
GetInteger(int64_t defaultValue)
const;
145 float GetFloat(
float defaultValue)
const;
154 double GetDouble(
double defaultValue)
const;
172 std::vector<uint8_t>
GetRaw(std::span<const uint8_t> defaultValue)
const;
188 std::vector<int>
GetBooleanArray(std::span<const int> defaultValue)
const;
201 std::span<const int64_t> defaultValue)
const;
213 std::vector<float>
GetFloatArray(std::span<const float> defaultValue)
const;
226 std::span<const double> defaultValue)
const;
239 std::span<const std::string> defaultValue)
const;
249 std::vector<NetworkTableValue>
ReadQueue();
362 bool SetBoolean(
bool value, int64_t time = 0);
371 bool SetInteger(int64_t value, int64_t time = 0);
380 bool SetFloat(
float value, int64_t time = 0);
389 bool SetDouble(
double value, int64_t time = 0);
407 bool SetRaw(std::span<const uint8_t> value, int64_t time = 0);
434 bool SetIntegerArray(std::span<const int64_t> value, int64_t time = 0);
443 bool SetFloatArray(std::span<const float> value, int64_t time = 0);
452 bool SetDoubleArray(std::span<const double> value, int64_t time = 0);
461 bool SetStringArray(std::span<const std::string> value, int64_t time = 0);
469 [[deprecated(
"Use SetPersistent() or topic properties instead")]]
478 [[deprecated(
"Use SetPersistent() or topic properties instead")]]
507 [[deprecated(
"Use Unpublish() instead")]]
NetworkTables Entry.
Definition: NetworkTableEntry.h:34
NetworkTableType GetType() const
Gets the type of the entry.
Definition: NetworkTableEntry.inc:35
std::vector< int > GetBooleanArray(std::span< const int > defaultValue) const
Gets the entry's value as a boolean array.
Definition: NetworkTableEntry.inc:77
std::string GetName() const
Gets the name of the entry (the key).
Definition: NetworkTableEntry.inc:31
bool SetDouble(double value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:176
unsigned int GetFlags() const
Returns the flags.
Definition: NetworkTableEntry.inc:39
void Unpublish()
Stops publishing the entry if it's been published.
Definition: NetworkTableEntry.inc:239
std::vector< float > GetFloatArray(std::span< const float > defaultValue) const
Gets the entry's value as a float array.
Definition: NetworkTableEntry.inc:87
void ClearPersistent()
Stop making value persistent through program restarts.
Definition: NetworkTableEntry.inc:231
std::vector< std::string > GetStringArray(std::span< const std::string > defaultValue) const
Gets the entry's value as a string array.
Definition: NetworkTableEntry.inc:97
void SetPersistent()
Make value persistent through program restarts.
Definition: NetworkTableEntry.inc:227
bool SetString(std::string_view value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:180
void SetFlags(unsigned int flags)
Sets flags.
Definition: NetworkTableEntry.inc:219
float GetFloat(float defaultValue) const
Gets the entry's value as a float.
Definition: NetworkTableEntry.inc:59
bool SetDefaultValue(const Value &defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:106
Topic GetTopic() const
Gets the entry's topic.
bool SetDefaultFloat(float defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:118
bool SetBoolean(bool value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:164
int64_t GetLastChange() const
Gets the last time the entry's value was changed.
Definition: NetworkTableEntry.inc:43
bool SetDefaultFloatArray(std::span< const float > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:145
std::vector< double > GetDoubleArray(std::span< const double > defaultValue) const
Gets the entry's value as a double array.
Definition: NetworkTableEntry.inc:92
bool SetDefaultRaw(std::span< const uint8_t > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:130
bool IsPersistent() const
Returns whether the value is persistent through program restarts.
Definition: NetworkTableEntry.inc:235
void ClearFlags(unsigned int flags)
Clears flags.
Definition: NetworkTableEntry.inc:223
bool SetValue(const Value &value)
Sets the entry's value.
Definition: NetworkTableEntry.inc:160
bool SetDoubleArray(std::span< const double > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:209
double GetDouble(double defaultValue) const
Gets the entry's value as a double.
Definition: NetworkTableEntry.inc:63
std::vector< uint8_t > GetRaw(std::span< const uint8_t > defaultValue) const
Gets the entry's value as a raw.
Definition: NetworkTableEntry.inc:72
bool SetDefaultString(std::string_view defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:126
bool SetFloatArray(std::span< const float > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:204
bool SetInteger(int64_t value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:168
bool SetFloat(float value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:172
int64_t GetInteger(int64_t defaultValue) const
Gets the entry's value as a integer.
Definition: NetworkTableEntry.inc:55
bool Exists() const
Determines if the entry currently exists.
Definition: NetworkTableEntry.inc:27
void Delete()
Deletes the entry.
Definition: NetworkTableEntry.inc:243
bool SetDefaultDouble(double defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:122
bool SetDefaultDoubleArray(std::span< const double > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:150
Value GetValue() const
Gets the entry's value.
Definition: NetworkTableEntry.inc:47
NetworkTableInstance GetInstance() const
Gets the instance for the entry.
bool SetDefaultBooleanArray(std::span< const int > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:135
std::vector< NetworkTableValue > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition: NetworkTableEntry.inc:102
bool operator==(const NetworkTableEntry &) const =default
Equality operator.
NT_Entry m_handle
Definition: NetworkTableEntry.h:525
bool SetRaw(std::span< const uint8_t > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:184
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition: NetworkTableEntry.inc:23
bool GetBoolean(bool defaultValue) const
Gets the entry's value as a boolean.
Definition: NetworkTableEntry.inc:51
std::vector< int64_t > GetIntegerArray(std::span< const int64_t > defaultValue) const
Gets the entry's value as a integer array.
Definition: NetworkTableEntry.inc:82
bool SetDefaultBoolean(bool defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:110
Flags
Flag values (as returned by GetFlags()).
Definition: NetworkTableEntry.h:40
@ kPersistent
Definition: NetworkTableEntry.h:40
bool SetBooleanArray(std::span< const bool > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:189
NetworkTableEntry()
Construct invalid instance.
Definition: NetworkTableEntry.inc:18
bool SetStringArray(std::span< const std::string > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:214
bool SetDefaultStringArray(std::span< const std::string > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:155
std::string GetString(std::string_view defaultValue) const
Gets the entry's value as a string.
Definition: NetworkTableEntry.inc:67
bool SetDefaultIntegerArray(std::span< const int64_t > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:140
bool SetDefaultInteger(int64_t defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:114
bool SetIntegerArray(std::span< const int64_t > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:199
NetworkTables Instance.
Definition: NetworkTableInstance.h:70
NetworkTables Topic.
Definition: Topic.h:28
A network table entry value.
Definition: NetworkTableValue.h:32
basic_string_view< char > string_view
Definition: core.h:501
NT_Handle NT_Entry
Definition: ntcore_c.h:35
@ NT_PERSISTENT
Definition: ntcore_c.h:69
NetworkTableType
NetworkTable entry type.
Definition: NetworkTableType.h:15
NetworkTables (ntcore) namespace.
Definition: ntcore_cpp.h:36