WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
nt::Value Class Referencefinal

A network table entry value. More...

#include <NetworkTableValue.h>

Public Member Functions

 Value (NT_Type type, uint64_t time, const private_init &)
 
NT_Type type () const
 Get the data type. More...
 
const NT_Valuevalue () const
 Get the data value stored. More...
 
uint64_t last_change () const
 Get the creation time of the value. More...
 
uint64_t time () const
 Get the creation time of the value. More...
 
 Value (const Value &)=delete
 
Valueoperator= (const Value &)=delete
 
Type Checkers
bool IsValid () const
 Determine if entry value contains a value or is unassigned. More...
 
bool IsBoolean () const
 Determine if entry value contains a boolean. More...
 
bool IsDouble () const
 Determine if entry value contains a double. More...
 
bool IsString () const
 Determine if entry value contains a string. More...
 
bool IsRaw () const
 Determine if entry value contains a raw. More...
 
bool IsRpc () const
 Determine if entry value contains a rpc definition. More...
 
bool IsBooleanArray () const
 Determine if entry value contains a boolean array. More...
 
bool IsDoubleArray () const
 Determine if entry value contains a double array. More...
 
bool IsStringArray () const
 Determine if entry value contains a string array. More...
 
Type-Safe Getters
bool GetBoolean () const
 Get the entry's boolean value. More...
 
double GetDouble () const
 Get the entry's double value. More...
 
StringRef GetString () const
 Get the entry's string value. More...
 
StringRef GetRaw () const
 Get the entry's raw value. More...
 
StringRef GetRpc () const
 Get the entry's rpc definition value. More...
 
ArrayRef< int > GetBooleanArray () const
 Get the entry's boolean array value. More...
 
ArrayRef< double > GetDoubleArray () const
 Get the entry's double array value. More...
 
ArrayRef< std::string > GetStringArray () const
 Get the entry's string array value. More...
 

Static Public Member Functions

Factory functions
static std::shared_ptr< ValueMakeBoolean (bool value, uint64_t time=0)
 Creates a boolean entry value. More...
 
static std::shared_ptr< ValueMakeDouble (double value, uint64_t time=0)
 Creates a double entry value. More...
 
static std::shared_ptr< ValueMakeString (const Twine &value, uint64_t time=0)
 Creates a string entry value. More...
 
template<typename T , typename std::enable_if< std::is_same< T, std::string >::value >::type >
static std::shared_ptr< ValueMakeString (T &&value, uint64_t time=0)
 Creates a string entry value. More...
 
static std::shared_ptr< ValueMakeRaw (StringRef value, uint64_t time=0)
 Creates a raw entry value. More...
 
template<typename T , typename std::enable_if< std::is_same< T, std::string >::value >::type >
static std::shared_ptr< ValueMakeRaw (T &&value, uint64_t time=0)
 Creates a raw entry value. More...
 
static std::shared_ptr< ValueMakeRpc (StringRef value, uint64_t time=0)
 Creates a rpc entry value. More...
 
template<typename T >
static std::shared_ptr< ValueMakeRpc (T &&value, uint64_t time=0)
 Creates a rpc entry value. More...
 
static std::shared_ptr< ValueMakeBooleanArray (ArrayRef< bool > value, uint64_t time=0)
 Creates a boolean array entry value. More...
 
static std::shared_ptr< ValueMakeBooleanArray (ArrayRef< int > value, uint64_t time=0)
 Creates a boolean array entry value. More...
 
static std::shared_ptr< ValueMakeDoubleArray (ArrayRef< double > value, uint64_t time=0)
 Creates a double array entry value. More...
 
static std::shared_ptr< ValueMakeStringArray (ArrayRef< std::string > value, uint64_t time=0)
 Creates a string array entry value. More...
 
static std::shared_ptr< ValueMakeStringArray (std::vector< std::string > &&value, uint64_t time=0)
 Creates a string array entry value. More...
 

Friends

bool operator== (const Value &lhs, const Value &rhs)
 

Detailed Description

A network table entry value.

Member Function Documentation

bool nt::Value::GetBoolean ( ) const
inline

Get the entry's boolean value.

Returns
The boolean value.
ArrayRef<int> nt::Value::GetBooleanArray ( ) const
inline

Get the entry's boolean array value.

Returns
The boolean array value.
double nt::Value::GetDouble ( ) const
inline

Get the entry's double value.

Returns
The double value.
ArrayRef<double> nt::Value::GetDoubleArray ( ) const
inline

Get the entry's double array value.

Returns
The double array value.
StringRef nt::Value::GetRaw ( ) const
inline

Get the entry's raw value.

Returns
The raw value.
StringRef nt::Value::GetRpc ( ) const
inline

Get the entry's rpc definition value.

Returns
The rpc definition value.
StringRef nt::Value::GetString ( ) const
inline

Get the entry's string value.

Returns
The string value.
ArrayRef<std::string> nt::Value::GetStringArray ( ) const
inline

Get the entry's string array value.

Returns
The string array value.
bool nt::Value::IsBoolean ( ) const
inline

Determine if entry value contains a boolean.

Returns
True if the entry value is of boolean type.
bool nt::Value::IsBooleanArray ( ) const
inline

Determine if entry value contains a boolean array.

Returns
True if the entry value is of boolean array type.
bool nt::Value::IsDouble ( ) const
inline

Determine if entry value contains a double.

Returns
True if the entry value is of double type.
bool nt::Value::IsDoubleArray ( ) const
inline

Determine if entry value contains a double array.

Returns
True if the entry value is of double array type.
bool nt::Value::IsRaw ( ) const
inline

Determine if entry value contains a raw.

Returns
True if the entry value is of raw type.
bool nt::Value::IsRpc ( ) const
inline

Determine if entry value contains a rpc definition.

Returns
True if the entry value is of rpc definition type.
bool nt::Value::IsString ( ) const
inline

Determine if entry value contains a string.

Returns
True if the entry value is of string type.
bool nt::Value::IsStringArray ( ) const
inline

Determine if entry value contains a string array.

Returns
True if the entry value is of string array type.
bool nt::Value::IsValid ( ) const
inline

Determine if entry value contains a value or is unassigned.

Returns
True if the entry value contains a value.
uint64_t nt::Value::last_change ( ) const
inline

Get the creation time of the value.

Returns
The time, in the units returned by nt::Now().
static std::shared_ptr<Value> nt::Value::MakeBoolean ( bool  value,
uint64_t  time = 0 
)
inlinestatic

Creates a boolean entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeBooleanArray ( ArrayRef< bool >  value,
uint64_t  time = 0 
)
static

Creates a boolean array entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeBooleanArray ( ArrayRef< int >  value,
uint64_t  time = 0 
)
static

Creates a boolean array entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeDouble ( double  value,
uint64_t  time = 0 
)
inlinestatic

Creates a double entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeDoubleArray ( ArrayRef< double >  value,
uint64_t  time = 0 
)
static

Creates a double array entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeRaw ( StringRef  value,
uint64_t  time = 0 
)
inlinestatic

Creates a raw entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
template<typename T , typename std::enable_if< std::is_same< T, std::string >::value >::type >
static std::shared_ptr<Value> nt::Value::MakeRaw ( T &&  value,
uint64_t  time = 0 
)
inlinestatic

Creates a raw entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeRpc ( StringRef  value,
uint64_t  time = 0 
)
inlinestatic

Creates a rpc entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
template<typename T >
static std::shared_ptr<Value> nt::Value::MakeRpc ( T &&  value,
uint64_t  time = 0 
)
inlinestatic

Creates a rpc entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeString ( const Twine value,
uint64_t  time = 0 
)
inlinestatic

Creates a string entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
template<typename T , typename std::enable_if< std::is_same< T, std::string >::value >::type >
static std::shared_ptr<Value> nt::Value::MakeString ( T &&  value,
uint64_t  time = 0 
)
inlinestatic

Creates a string entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeStringArray ( ArrayRef< std::string >  value,
uint64_t  time = 0 
)
static

Creates a string array entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
static std::shared_ptr<Value> nt::Value::MakeStringArray ( std::vector< std::string > &&  value,
uint64_t  time = 0 
)
static

Creates a string array entry value.

Parameters
valuethe value
timeif nonzero, the creation time to use (instead of the current time)
Returns
The entry value
Note
This function moves the values out of the vector.
uint64_t nt::Value::time ( ) const
inline

Get the creation time of the value.

Returns
The time, in the units returned by nt::Now().
NT_Type nt::Value::type ( ) const
inline

Get the data type.

Returns
The type.
const NT_Value& nt::Value::value ( ) const
inline

Get the data value stored.

Returns
The type.

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