100 std::string
GetString(std::string_view defaultValue)
const {
111 std::vector<uint8_t>
GetRaw(std::span<const uint8_t> defaultValue)
const {
130 return ::nt::GetBooleanArray(
m_subHandle, defaultValue);
144 std::span<const int64_t> defaultValue)
const {
145 return ::nt::GetIntegerArray(
m_subHandle, defaultValue);
158 std::vector<float>
GetFloatArray(std::span<const float> defaultValue)
const {
159 return ::nt::GetFloatArray(
m_subHandle, defaultValue);
173 std::span<const double> defaultValue)
const {
174 return ::nt::GetDoubleArray(
m_subHandle, defaultValue);
188 std::span<const std::string> defaultValue)
const {
189 return ::nt::GetStringArray(
m_subHandle, defaultValue);
294 bool SetString(std::string_view value, int64_t time = 0) {
305 bool SetRaw(std::span<const uint8_t> value, int64_t time = 0) {
NetworkTables generic entry.
Definition GenericEntry.h:511
GenericEntry(NT_Entry handle)
Construct from an entry handle; recommended to use RawTopic::GetEntry() instead.
Definition GenericEntry.h:528
void Unpublish()
Stops publishing the entry if it's published.
Definition GenericEntry.h:557
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition GenericEntry.h:543
TopicType GetTopic() const
Get the corresponding topic.
Definition GenericEntry.h:550
NetworkTables generic publisher.
Definition GenericEntry.h:219
bool SetDefaultRaw(std::span< const uint8_t > defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:442
bool SetDefaultDoubleArray(std::span< const double > defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:482
bool SetDefaultString(std::string_view defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:432
bool SetString(std::string_view value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:294
bool SetDouble(double value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:283
bool SetDoubleArray(std::span< const double > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:360
bool SetDefaultDouble(double defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:422
GenericPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use Topic::GenericPublish() instead.
Definition GenericEntry.h:234
bool SetStringArray(std::span< const std::string > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:371
bool SetBoolean(bool value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:250
bool SetBooleanArray(std::span< const int > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:327
void SetDefault(ParamType value)
Publish a default value.
Definition GenericEntry.h:382
bool SetDefaultFloatArray(std::span< const float > defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:472
bool SetInteger(int64_t value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:261
bool SetDefaultBooleanArray(std::span< const int > defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:452
bool SetDefaultFloat(float defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:412
bool SetFloat(float value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:272
void Set(ParamType value)
Publish a new value.
Definition GenericEntry.h:241
bool SetFloatArray(std::span< const float > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:349
bool SetDefaultInteger(int64_t defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:402
bool SetIntegerArray(std::span< const int64_t > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:338
bool SetDefaultBoolean(bool defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:392
bool SetBooleanArray(std::span< const bool > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:316
bool SetDefaultIntegerArray(std::span< const int64_t > defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:462
bool SetDefaultStringArray(std::span< const std::string > defaultValue)
Sets the entry's value if it does not exist.
Definition GenericEntry.h:492
GenericPublisher()=default
TopicType GetTopic() const
Get the corresponding topic.
Definition GenericEntry.h:501
bool SetRaw(std::span< const uint8_t > value, int64_t time=0)
Sets the entry's value.
Definition GenericEntry.h:305
NetworkTables generic subscriber.
Definition GenericEntry.h:24
double GetDouble(double defaultValue) const
Gets the entry's value as a double.
Definition GenericEntry.h:89
std::vector< int > GetBooleanArray(std::span< const int > defaultValue) const
Gets the entry's value as a boolean array.
Definition GenericEntry.h:129
ValueType Get() const
Get the last published value.
Definition GenericEntry.h:47
int64_t GetInteger(int64_t defaultValue) const
Gets the entry's value as a integer.
Definition GenericEntry.h:67
float GetFloat(float defaultValue) const
Gets the entry's value as a float.
Definition GenericEntry.h:78
std::vector< float > GetFloatArray(std::span< const float > defaultValue) const
Gets the entry's value as a float array.
Definition GenericEntry.h:158
std::vector< uint8_t > GetRaw(std::span< const uint8_t > defaultValue) const
Gets the entry's value as a raw.
Definition GenericEntry.h:111
GenericSubscriber()=default
std::vector< double > GetDoubleArray(std::span< const double > defaultValue) const
Gets the entry's value as a double array.
Definition GenericEntry.h:172
std::string GetString(std::string_view defaultValue) const
Gets the entry's value as a string.
Definition GenericEntry.h:100
GenericSubscriber(NT_Subscriber handle)
Construct from a subscriber handle; recommended to use Topic::GenericSubscribe() instead.
Definition GenericEntry.h:39
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition GenericEntry.h:202
std::vector< std::string > GetStringArray(std::span< const std::string > defaultValue) const
Gets the entry's value as a string array.
Definition GenericEntry.h:187
std::vector< int64_t > GetIntegerArray(std::span< const int64_t > defaultValue) const
Gets the entry's value as a integer array.
Definition GenericEntry.h:143
TopicType GetTopic() const
Get the corresponding topic.
Definition GenericEntry.h:211
bool GetBoolean(bool defaultValue) const
Gets the entry's value as a boolean.
Definition GenericEntry.h:56
NetworkTables publisher.
Definition Topic.h:393
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.h:441
NetworkTables subscriber.
Definition Topic.h:321
NT_Subscriber m_subHandle
Definition Topic.h:386
NetworkTables Topic.
Definition Topic.h:28
A network table entry value.
Definition NetworkTableValue.h:35
static Value MakeBooleanArray(std::span< const bool > value, int64_t time=0)
Creates a boolean array entry value.
bool SetBoolean(NT_Handle pubentry, bool value, int64_t time=0)
Publish a new value.
bool SetDefaultBoolean(NT_Handle pubentry, bool defaultValue)
Publish a default value.
bool SetBooleanArray(NT_Handle pubentry, std::span< const int > value, int64_t time=0)
Publish a new value.
bool SetDefaultBooleanArray(NT_Handle pubentry, std::span< const int > defaultValue)
Publish a default value.
bool SetDefaultDouble(NT_Handle pubentry, double defaultValue)
Publish a default value.
bool SetDouble(NT_Handle pubentry, double value, int64_t time=0)
Publish a new value.
bool SetDoubleArray(NT_Handle pubentry, std::span< const double > value, int64_t time=0)
Publish a new value.
bool SetDefaultDoubleArray(NT_Handle pubentry, std::span< const double > defaultValue)
Publish a default value.
bool SetDefaultFloat(NT_Handle pubentry, float defaultValue)
Publish a default value.
bool SetFloat(NT_Handle pubentry, float value, int64_t time=0)
Publish a new value.
bool SetDefaultFloatArray(NT_Handle pubentry, std::span< const float > defaultValue)
Publish a default value.
bool SetFloatArray(NT_Handle pubentry, std::span< const float > value, int64_t time=0)
Publish a new value.
bool SetDefaultInteger(NT_Handle pubentry, int64_t defaultValue)
Publish a default value.
bool SetInteger(NT_Handle pubentry, int64_t value, int64_t time=0)
Publish a new value.
bool SetIntegerArray(NT_Handle pubentry, std::span< const int64_t > value, int64_t time=0)
Publish a new value.
bool SetDefaultIntegerArray(NT_Handle pubentry, std::span< const int64_t > defaultValue)
Publish a default value.
bool SetDefaultRaw(NT_Handle pubentry, std::span< const uint8_t > defaultValue)
Publish a default value.
bool SetRaw(NT_Handle pubentry, std::span< const uint8_t > value, int64_t time=0)
Publish a new value.
bool SetDefaultString(NT_Handle pubentry, std::string_view defaultValue)
Publish a default value.
bool SetString(NT_Handle pubentry, std::string_view value, int64_t time=0)
Publish a new value.
bool SetDefaultStringArray(NT_Handle pubentry, std::span< const std::string > defaultValue)
Publish a default value.
bool SetStringArray(NT_Handle pubentry, std::span< const std::string > value, int64_t time=0)
Publish a new value.
NT_Handle NT_Subscriber
Definition ntcore_c.h:43
NT_Handle NT_Publisher
Definition ntcore_c.h:44
NT_Handle NT_Entry
Definition ntcore_c.h:37
bool SetEntryValue(NT_Entry entry, const Value &value)
Set Entry Value.
bool SetDefaultEntryValue(NT_Entry entry, const Value &value)
Set Default Entry Value.
NT_Topic GetTopicFromHandle(NT_Handle pubsubentry)
Gets the topic handle from an entry/subscriber/publisher handle.
void Unpublish(NT_Handle pubentry)
Stops publisher.
NetworkTables (ntcore) namespace.
Definition ntcore_cpp.h:36