|
WPILibC++
2020.3.2
|
NetworkTables Entry. More...
#include <NetworkTableEntry.h>
Public Types | |
| enum | Flags { kPersistent = NT_PERSISTENT } |
| Flag values (as returned by GetFlags()). | |
Public Member Functions | |
| NetworkTableEntry () | |
| Construct invalid instance. | |
| NetworkTableEntry (NT_Entry handle) | |
| Construct from native handle. More... | |
| operator bool () const | |
| Determines if the native handle is valid. More... | |
| NT_Entry | GetHandle () const |
| Gets the native handle for the entry. More... | |
| NetworkTableInstance | GetInstance () const |
| Gets the instance for the entry. More... | |
| bool | Exists () const |
| Determines if the entry currently exists. More... | |
| std::string | GetName () const |
| Gets the name of the entry (the key). More... | |
| NetworkTableType | GetType () const |
| Gets the type of the entry. More... | |
| unsigned int | GetFlags () const |
| Returns the flags. More... | |
| uint64_t | GetLastChange () const |
| Gets the last time the entry's value was changed. More... | |
| EntryInfo | GetInfo () const |
| Gets combined information about the entry. More... | |
| std::shared_ptr< Value > | GetValue () const |
| Gets the entry's value. More... | |
| bool | GetBoolean (bool defaultValue) const |
| Gets the entry's value as a boolean. More... | |
| double | GetDouble (double defaultValue) const |
| Gets the entry's value as a double. More... | |
| std::string | GetString (StringRef defaultValue) const |
| Gets the entry's value as a string. More... | |
| std::string | GetRaw (StringRef defaultValue) const |
| Gets the entry's value as a raw. More... | |
| std::vector< int > | GetBooleanArray (ArrayRef< int > defaultValue) const |
| Gets the entry's value as a boolean array. More... | |
| std::vector< int > | GetBooleanArray (std::initializer_list< int > defaultValue) const |
| Gets the entry's value as a boolean array. More... | |
| std::vector< double > | GetDoubleArray (ArrayRef< double > defaultValue) const |
| Gets the entry's value as a double array. More... | |
| std::vector< double > | GetDoubleArray (std::initializer_list< double > defaultValue) const |
| Gets the entry's value as a double array. More... | |
| std::vector< std::string > | GetStringArray (ArrayRef< std::string > defaultValue) const |
| Gets the entry's value as a string array. More... | |
| std::vector< std::string > | GetStringArray (std::initializer_list< std::string > defaultValue) const |
| Gets the entry's value as a string array. More... | |
| bool | SetDefaultValue (std::shared_ptr< Value > value) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultBoolean (bool 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 (const Twine &defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultRaw (StringRef defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultBooleanArray (ArrayRef< int > defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultBooleanArray (std::initializer_list< int > defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultDoubleArray (ArrayRef< double > defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultDoubleArray (std::initializer_list< double > defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultStringArray (ArrayRef< std::string > defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetDefaultStringArray (std::initializer_list< std::string > defaultValue) |
| Sets the entry's value if it does not exist. More... | |
| bool | SetValue (std::shared_ptr< Value > value) |
| Sets the entry's value. More... | |
| bool | SetBoolean (bool value) |
| Sets the entry's value. More... | |
| bool | SetDouble (double value) |
| Sets the entry's value. More... | |
| bool | SetString (const Twine &value) |
| Sets the entry's value. More... | |
| bool | SetRaw (StringRef value) |
| Sets the entry's value. More... | |
| bool | SetBooleanArray (ArrayRef< bool > value) |
| Sets the entry's value. More... | |
| bool | SetBooleanArray (std::initializer_list< bool > value) |
| Sets the entry's value. More... | |
| bool | SetBooleanArray (ArrayRef< int > value) |
| Sets the entry's value. More... | |
| bool | SetBooleanArray (std::initializer_list< int > value) |
| Sets the entry's value. More... | |
| bool | SetDoubleArray (ArrayRef< double > value) |
| Sets the entry's value. More... | |
| bool | SetDoubleArray (std::initializer_list< double > value) |
| Sets the entry's value. More... | |
| bool | SetStringArray (ArrayRef< std::string > value) |
| Sets the entry's value. More... | |
| bool | SetStringArray (std::initializer_list< std::string > value) |
| Sets the entry's value. More... | |
| void | ForceSetValue (std::shared_ptr< Value > value) |
| Sets the entry's value. More... | |
| void | ForceSetBoolean (bool value) |
| Sets the entry's value. More... | |
| void | ForceSetDouble (double value) |
| Sets the entry's value. More... | |
| void | ForceSetString (const Twine &value) |
| Sets the entry's value. More... | |
| void | ForceSetRaw (StringRef value) |
| Sets the entry's value. More... | |
| void | ForceSetBooleanArray (ArrayRef< bool > value) |
| Sets the entry's value. More... | |
| void | ForceSetBooleanArray (std::initializer_list< bool > value) |
| Sets the entry's value. More... | |
| void | ForceSetBooleanArray (ArrayRef< int > value) |
| Sets the entry's value. More... | |
| void | ForceSetBooleanArray (std::initializer_list< int > value) |
| Sets the entry's value. More... | |
| void | ForceSetDoubleArray (ArrayRef< double > value) |
| Sets the entry's value. More... | |
| void | ForceSetDoubleArray (std::initializer_list< double > value) |
| Sets the entry's value. More... | |
| void | ForceSetStringArray (ArrayRef< std::string > value) |
| Sets the entry's value. More... | |
| void | ForceSetStringArray (std::initializer_list< std::string > value) |
| Sets the entry's value. More... | |
| void | SetFlags (unsigned int flags) |
| Sets flags. More... | |
| void | ClearFlags (unsigned int flags) |
| Clears flags. More... | |
| void | SetPersistent () |
| Make value persistent through program restarts. | |
| void | ClearPersistent () |
| Stop making value persistent through program restarts. | |
| bool | IsPersistent () const |
| Returns whether the value is persistent through program restarts. More... | |
| void | Delete () |
| Deletes the entry. | |
| void | CreateRpc (std::function< void(const RpcAnswer &answer)> callback) |
| Create a callback-based RPC entry point. More... | |
| void | CreatePolledRpc () |
| Create a polled RPC entry point. More... | |
| RpcCall | CallRpc (StringRef params) |
| Call a RPC function. More... | |
| NT_EntryListener | AddListener (std::function< void(const EntryNotification &event)> callback, unsigned int flags) const |
| Add a listener for changes to this entry. More... | |
| void | RemoveListener (NT_EntryListener entry_listener) |
| Remove an entry listener. More... | |
| bool | operator== (const NetworkTableEntry &oth) const |
| Equality operator. More... | |
| bool | operator!= (const NetworkTableEntry &oth) const |
| Inequality operator. | |
Protected Attributes | |
| NT_Entry | m_handle |
NetworkTables Entry.
|
inlineexplicit |
Construct from native handle.
| handle | Native handle |
|
inline |
Add a listener for changes to this entry.
| callback | listener to add |
| flags | NotifyKind bitmask |
Call a RPC function.
May be used on either the client or server. This function is non-blocking. Either RpcCall::GetResult() or RpcCall::CancelResult() must be called on the return value to either get or ignore the result of the call.
| params | parameter |
|
inline |
Clears flags.
| flags | the flags to clear (bitmask) |
| void nt::NetworkTableEntry::CreatePolledRpc | ( | ) |
Create a polled RPC entry point.
Only valid to use on the server. The caller is responsible for calling NetworkTableInstance::PollRpc() to poll for servicing incoming RPC calls. This function creates RPC version 0 definitions (raw data in and out).
|
inline |
Create a callback-based RPC entry point.
Only valid to use on the server. The callback function will be called when the RPC is called. This function creates RPC version 0 definitions (raw data in and out).
| callback | callback function |
|
inline |
Determines if the entry currently exists.
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Sets the entry's value.
If the value is of different type, the type is changed to match the new value.
| value | the value to set |
|
inline |
Gets the entry's value as a boolean.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a boolean array.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a boolean array.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a double.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a double array.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a double array.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Returns the flags.
|
inline |
Gets the native handle for the entry.
|
inline |
Gets combined information about the entry.
| NetworkTableInstance nt::NetworkTableEntry::GetInstance | ( | ) | const |
Gets the instance for the entry.
|
inline |
Gets the last time the entry's value was changed.
|
inline |
Gets the name of the entry (the key).
|
inline |
Gets the entry's value as a raw.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a string.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a string array.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the entry's value as a string array.
If the entry does not exist or is of different type, it will return the default value.
| defaultValue | the value to be returned if no value is found |
|
inline |
Gets the type of the entry.
|
inline |
Gets the entry's value.
If the entry does not exist, returns nullptr.
|
inline |
Returns whether the value is persistent through program restarts.
|
inlineexplicit |
Determines if the native handle is valid.
|
inline |
Equality operator.
Returns true if both instances refer to the same native handle.
|
inline |
Remove an entry listener.
| entry_listener | Listener handle to remove |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
| bool nt::NetworkTableEntry::SetDefaultBooleanArray | ( | std::initializer_list< int > | defaultValue | ) |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
| bool nt::NetworkTableEntry::SetDefaultDoubleArray | ( | std::initializer_list< double > | defaultValue | ) |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
| bool nt::NetworkTableEntry::SetDefaultStringArray | ( | std::initializer_list< std::string > | defaultValue | ) |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value if it does not exist.
| defaultValue | the default value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets flags.
| flags | the flags to set (bitmask) |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |
|
inline |
Sets the entry's value.
| value | the value to set |