9#include <initializer_list>
23class NetworkTableInstance;
53 explicit operator bool()
const {
return m_handle != 0; }
121 int64_t
GetInteger(int64_t defaultValue)
const;
130 float GetFloat(
float defaultValue)
const;
139 double GetDouble(
double defaultValue)
const;
157 std::vector<uint8_t>
GetRaw(std::span<const uint8_t> defaultValue)
const;
173 std::vector<int>
GetBooleanArray(std::span<const int> defaultValue)
const;
186 std::span<const int64_t> defaultValue)
const;
198 std::vector<float>
GetFloatArray(std::span<const float> defaultValue)
const;
211 std::span<const double> defaultValue)
const;
224 std::span<const std::string> defaultValue)
const;
234 std::vector<NetworkTableValue>
ReadQueue();
347 bool SetBoolean(
bool value, int64_t time = 0);
356 bool SetInteger(int64_t value, int64_t time = 0);
365 bool SetFloat(
float value, int64_t time = 0);
374 bool SetDouble(
double value, int64_t time = 0);
392 bool SetRaw(std::span<const uint8_t> value, int64_t time = 0);
419 bool SetIntegerArray(std::span<const int64_t> value, int64_t time = 0);
428 bool SetFloatArray(std::span<const float> value, int64_t time = 0);
437 bool SetDoubleArray(std::span<const double> value, int64_t time = 0);
446 bool SetStringArray(std::span<const std::string> value, int64_t time = 0);
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:73
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:172
void Unpublish()
Stops publishing the entry if it's been published.
Definition: NetworkTableEntry.inc:227
std::vector< float > GetFloatArray(std::span< const float > defaultValue) const
Gets the entry's value as a float array.
Definition: NetworkTableEntry.inc:83
void ClearPersistent()
Stop making value persistent through program restarts.
Definition: NetworkTableEntry.inc:219
std::vector< std::string > GetStringArray(std::span< const std::string > defaultValue) const
Gets the entry's value as a string array.
Definition: NetworkTableEntry.inc:93
void SetPersistent()
Make value persistent through program restarts.
Definition: NetworkTableEntry.inc:215
bool SetString(std::string_view value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:176
float GetFloat(float defaultValue) const
Gets the entry's value as a float.
Definition: NetworkTableEntry.inc:55
bool SetDefaultValue(const Value &defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:102
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:114
bool SetBoolean(bool value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:160
int64_t GetLastChange() const
Gets the last time the entry's value was changed.
Definition: NetworkTableEntry.inc:39
bool SetDefaultFloatArray(std::span< const float > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:141
std::vector< double > GetDoubleArray(std::span< const double > defaultValue) const
Gets the entry's value as a double array.
Definition: NetworkTableEntry.inc:88
bool SetDefaultRaw(std::span< const uint8_t > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:126
bool IsPersistent() const
Returns whether the value is persistent through program restarts.
Definition: NetworkTableEntry.inc:223
bool SetValue(const Value &value)
Sets the entry's value.
Definition: NetworkTableEntry.inc:156
bool SetDoubleArray(std::span< const double > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:205
double GetDouble(double defaultValue) const
Gets the entry's value as a double.
Definition: NetworkTableEntry.inc:59
std::vector< uint8_t > GetRaw(std::span< const uint8_t > defaultValue) const
Gets the entry's value as a raw.
Definition: NetworkTableEntry.inc:68
bool SetDefaultString(std::string_view defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:122
bool SetFloatArray(std::span< const float > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:200
bool SetInteger(int64_t value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:164
bool SetFloat(float value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:168
int64_t GetInteger(int64_t defaultValue) const
Gets the entry's value as a integer.
Definition: NetworkTableEntry.inc:51
bool Exists() const
Determines if the entry currently exists.
Definition: NetworkTableEntry.inc:27
bool SetDefaultDouble(double defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:118
bool SetDefaultDoubleArray(std::span< const double > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:146
Value GetValue() const
Gets the entry's value.
Definition: NetworkTableEntry.inc:43
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:131
std::vector< NetworkTableValue > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition: NetworkTableEntry.inc:98
bool operator==(const NetworkTableEntry &) const =default
Equality operator.
NT_Entry m_handle
Definition: NetworkTableEntry.h:485
bool SetRaw(std::span< const uint8_t > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:180
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:47
std::vector< int64_t > GetIntegerArray(std::span< const int64_t > defaultValue) const
Gets the entry's value as a integer array.
Definition: NetworkTableEntry.inc:78
bool SetDefaultBoolean(bool defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:106
bool SetBooleanArray(std::span< const bool > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:185
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:210
bool SetDefaultStringArray(std::span< const std::string > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:151
std::string GetString(std::string_view defaultValue) const
Gets the entry's value as a string.
Definition: NetworkTableEntry.inc:63
bool SetDefaultIntegerArray(std::span< const int64_t > defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:136
bool SetDefaultInteger(int64_t defaultValue)
Sets the entry's value if it does not exist.
Definition: NetworkTableEntry.inc:110
bool SetIntegerArray(std::span< const int64_t > value, int64_t time=0)
Sets the entry's value.
Definition: NetworkTableEntry.inc:195
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:518
NT_Handle NT_Entry
Definition: ntcore_c.h:37
NetworkTableType
NetworkTable entry type.
Definition: NetworkTableType.h:15
NetworkTables (ntcore) namespace.
Definition: NetworkTableListener.inc:19