WPILibC++ 2024.3.2
nt::GenericEntry Class Referencefinal

NetworkTables generic entry. More...

#include <networktables/GenericEntry.h>

Inheritance diagram for nt::GenericEntry:
nt::GenericSubscriber nt::GenericPublisher nt::Subscriber nt::Publisher

Public Types

using SubscriberType = GenericSubscriber
 
using PublisherType = GenericPublisher
 
using TopicType = Topic
 
using ValueType = Value
 
using ParamType = const Value &
 
using TimestampedValueType = Value
 
- Public Types inherited from nt::GenericSubscriber
using TopicType = Topic
 
using ValueType = Value
 
using ParamType = const Value &
 
using TimestampedValueType = Value
 
- Public Types inherited from nt::GenericPublisher
using TopicType = Topic
 
using ValueType = Value
 
using ParamType = const Value &
 
using TimestampedValueType = Value
 

Public Member Functions

 GenericEntry ()=default
 
 GenericEntry (NT_Entry handle)
 Construct from an entry handle; recommended to use RawTopic::GetEntry() instead. More...
 
 operator bool () const
 Determines if the native handle is valid. More...
 
NT_Entry GetHandle () const
 Gets the native handle for the entry. More...
 
TopicType GetTopic () const
 Get the corresponding topic. More...
 
void Unpublish ()
 Stops publishing the entry if it's published. More...
 
- Public Member Functions inherited from nt::GenericSubscriber
 GenericSubscriber ()=default
 
 GenericSubscriber (NT_Subscriber handle)
 Construct from a subscriber handle; recommended to use Topic::GenericSubscribe() instead. More...
 
ValueType Get () const
 Get the last published 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< TimestampedValueTypeReadQueue ()
 Get an array of all value changes since the last call to ReadQueue. More...
 
TopicType GetTopic () const
 Get the corresponding topic. More...
 
- Public Member Functions inherited from nt::Subscriber
virtual ~Subscriber ()
 
 Subscriber (const Subscriber &)=delete
 
Subscriberoperator= (const Subscriber &)=delete
 
 Subscriber (Subscriber &&)
 
Subscriberoperator= (Subscriber &&)
 
 operator bool () const
 Determines if the native handle is valid. More...
 
NT_Subscriber GetHandle () const
 Gets the native handle for the subscriber. More...
 
bool Exists () const
 Determines if the topic is currently being published. More...
 
int64_t GetLastChange () const
 Gets the last time the value was changed. More...
 
Topic GetTopic () const
 Gets the subscribed-to topic. More...
 
- Public Member Functions inherited from nt::GenericPublisher
 GenericPublisher ()=default
 
 GenericPublisher (NT_Publisher handle)
 Construct from a publisher handle; recommended to use Topic::GenericPublish() instead. More...
 
void Set (ParamType value)
 Publish a new 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 SetDefault (ParamType value)
 Publish a default value. 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...
 
TopicType GetTopic () const
 Get the corresponding topic. More...
 
- Public Member Functions inherited from nt::Publisher
virtual ~Publisher ()
 
 Publisher (const Publisher &)=delete
 
Publisheroperator= (const Publisher &)=delete
 
 Publisher (Publisher &&)
 
Publisheroperator= (Publisher &&)
 
 operator bool () const
 Determines if the native handle is valid. More...
 
NT_Publisher GetHandle () const
 Gets the native handle for the publisher. More...
 
Topic GetTopic () const
 Gets the published-to topic. More...
 

Additional Inherited Members

- Protected Member Functions inherited from nt::Subscriber
 Subscriber ()=default
 
 Subscriber (NT_Subscriber handle)
 
- Protected Member Functions inherited from nt::Publisher
 Publisher ()=default
 
 Publisher (NT_Publisher handle)
 
- Protected Attributes inherited from nt::Subscriber
NT_Subscriber m_subHandle {0}
 
- Protected Attributes inherited from nt::Publisher
NT_Publisher m_pubHandle {0}
 NetworkTables handle. More...
 

Detailed Description

NetworkTables generic entry.

Note
Unlike NetworkTableEntry, the entry goes away when this is destroyed.

Member Typedef Documentation

◆ ParamType

◆ PublisherType

◆ SubscriberType

◆ TimestampedValueType

◆ TopicType

◆ ValueType

Constructor & Destructor Documentation

◆ GenericEntry() [1/2]

nt::GenericEntry::GenericEntry ( )
default

◆ GenericEntry() [2/2]

nt::GenericEntry::GenericEntry ( NT_Entry  handle)
inlineexplicit

Construct from an entry handle; recommended to use RawTopic::GetEntry() instead.

Parameters
handleNative handle

Member Function Documentation

◆ GetHandle()

NT_Entry nt::GenericEntry::GetHandle ( ) const
inline

Gets the native handle for the entry.

Returns
Native handle

◆ GetTopic()

Topic nt::GenericEntry::GetTopic ( ) const
inline

Get the corresponding topic.

Returns
Topic

◆ operator bool()

nt::GenericEntry::operator bool ( ) const
inlineexplicit

Determines if the native handle is valid.

Returns
True if the native handle is valid, false otherwise.

◆ Unpublish()

void nt::GenericEntry::Unpublish ( )
inline

Stops publishing the entry if it's published.


The documentation for this class was generated from the following files: