WPILibC++ 2024.3.2
nt::Subscriber Class Reference

NetworkTables subscriber. More...

#include <networktables/Topic.h>

Inheritance diagram for nt::Subscriber:
nt::StructArraySubscriber< T, I... > nt::StructSubscriber< T, I... > nt::BooleanArraySubscriber nt::BooleanSubscriber nt::DoubleArraySubscriber nt::DoubleSubscriber nt::FloatArraySubscriber nt::FloatSubscriber nt::GenericSubscriber nt::IntegerArraySubscriber nt::IntegerSubscriber nt::ProtobufSubscriber< T > nt::RawSubscriber nt::StringArraySubscriber nt::StringSubscriber nt::StructArraySubscriber< T, I > nt::StructSubscriber< T, I > nt::UnitSubscriber< T >

Public Member Functions

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...
 

Protected Member Functions

 Subscriber ()=default
 
 Subscriber (NT_Subscriber handle)
 

Protected Attributes

NT_Subscriber m_subHandle {0}
 

Detailed Description

NetworkTables subscriber.

Constructor & Destructor Documentation

◆ ~Subscriber()

nt::Subscriber::~Subscriber ( )
inlinevirtual

◆ Subscriber() [1/4]

nt::Subscriber::Subscriber ( const Subscriber )
delete

◆ Subscriber() [2/4]

nt::Subscriber::Subscriber ( Subscriber &&  rhs)
inline

◆ Subscriber() [3/4]

nt::Subscriber::Subscriber ( )
protecteddefault

◆ Subscriber() [4/4]

nt::Subscriber::Subscriber ( NT_Subscriber  handle)
inlineexplicitprotected

Member Function Documentation

◆ Exists()

bool nt::Subscriber::Exists ( ) const
inline

Determines if the topic is currently being published.

Returns
True if the topic exists, false otherwise.

◆ GetHandle()

NT_Subscriber nt::Subscriber::GetHandle ( ) const
inline

Gets the native handle for the subscriber.

Returns
Native handle

◆ GetLastChange()

int64_t nt::Subscriber::GetLastChange ( ) const
inline

Gets the last time the value was changed.

Note: this is not atomic with Get(); use GetAtomic() to get both the value and last change as an atomic operation.

Returns
Topic last change time

◆ GetTopic()

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

Gets the subscribed-to topic.

Returns
Topic

◆ operator bool()

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

Determines if the native handle is valid.

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

◆ operator=() [1/2]

Subscriber & nt::Subscriber::operator= ( const Subscriber )
delete

◆ operator=() [2/2]

Subscriber & nt::Subscriber::operator= ( Subscriber &&  rhs)
inline

Member Data Documentation

◆ m_subHandle

NT_Subscriber nt::Subscriber::m_subHandle {0}
protected

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