WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
ITable Class Referenceabstract

A table whose values can be read and written to. More...

#include <ITable.h>

Inheritance diagram for ITable:
NetworkTable

Public Member Functions

virtual bool ContainsKey (llvm::StringRef key) const =0
 Determines whether the given key is in this table. More...
 
virtual bool ContainsSubTable (llvm::StringRef key) const =0
 Determines whether there exists a non-empty subtable for this key in this table. More...
 
virtual std::shared_ptr< ITableGetSubTable (llvm::StringRef key) const =0
 Gets the subtable in this table for the given name. More...
 
virtual std::vector< std::string > GetKeys (int types=0) const =0
 
virtual std::vector< std::string > GetSubTables () const =0
 
virtual void SetPersistent (llvm::StringRef key)=0
 Makes a key's value persistent through program restarts. More...
 
virtual void ClearPersistent (llvm::StringRef key)=0
 Stop making a key's value persistent through program restarts. More...
 
virtual bool IsPersistent (llvm::StringRef key) const =0
 Returns whether the value is persistent through program restarts. More...
 
virtual void SetFlags (llvm::StringRef key, unsigned int flags)=0
 Sets flags on the specified key in this table. More...
 
virtual void ClearFlags (llvm::StringRef key, unsigned int flags)=0
 Clears flags on the specified key in this table. More...
 
virtual unsigned int GetFlags (llvm::StringRef key) const =0
 Returns the flags for the specified key. More...
 
virtual void Delete (llvm::StringRef key)=0
 Deletes the specified key in this table. More...
 
virtual std::shared_ptr
< nt::Value
GetValue (llvm::StringRef key) const =0
 Gets the value associated with a key as an object. More...
 
virtual bool SetDefaultValue (llvm::StringRef key, std::shared_ptr< nt::Value > defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual bool PutValue (llvm::StringRef key, std::shared_ptr< nt::Value > value)=0
 Put a value in the table. More...
 
virtual bool PutNumber (llvm::StringRef key, double value)=0
 Put a number in the table. More...
 
virtual bool SetDefaultNumber (llvm::StringRef key, double defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual bool PutString (llvm::StringRef key, llvm::StringRef value)=0
 Put a string in the table. More...
 
virtual bool SetDefaultString (llvm::StringRef key, llvm::StringRef defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual bool PutBoolean (llvm::StringRef key, bool value)=0
 Put a boolean in the table. More...
 
virtual bool SetDefaultBoolean (llvm::StringRef key, bool defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual bool PutBooleanArray (llvm::StringRef key, llvm::ArrayRef< int > value)=0
 Put a boolean array in the table. More...
 
virtual bool SetDefaultBooleanArray (llvm::StringRef key, llvm::ArrayRef< int > defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual std::vector< int > GetBooleanArray (llvm::StringRef key, llvm::ArrayRef< int > defaultValue) const =0
 Returns the boolean array the key maps to. More...
 
virtual bool PutNumberArray (llvm::StringRef key, llvm::ArrayRef< double > value)=0
 Put a number array in the table. More...
 
virtual bool SetDefaultNumberArray (llvm::StringRef key, llvm::ArrayRef< double > defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual std::vector< double > GetNumberArray (llvm::StringRef key, llvm::ArrayRef< double > defaultValue) const =0
 Returns the number array the key maps to. More...
 
virtual bool PutStringArray (llvm::StringRef key, llvm::ArrayRef< std::string > value)=0
 Put a string array in the table. More...
 
virtual bool SetDefaultStringArray (llvm::StringRef key, llvm::ArrayRef< std::string > defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual std::vector< std::string > GetStringArray (llvm::StringRef key, llvm::ArrayRef< std::string > defaultValue) const =0
 Returns the string array the key maps to. More...
 
virtual bool PutRaw (llvm::StringRef key, llvm::StringRef value)=0
 Put a raw value (byte array) in the table. More...
 
virtual bool SetDefaultRaw (llvm::StringRef key, llvm::StringRef defaultValue)=0
 Gets the current value in the table, setting it if it does not exist. More...
 
virtual std::string GetRaw (llvm::StringRef key, llvm::StringRef defaultValue) const =0
 Returns the raw value (byte array) the key maps to. More...
 
virtual void AddTableListener (ITableListener *listener)=0
 Add a listener for changes to the table. More...
 
virtual void AddTableListener (ITableListener *listener, bool immediateNotify)=0
 Add a listener for changes to the table. More...
 
virtual void AddTableListenerEx (ITableListener *listener, unsigned int flags)=0
 Add a listener for changes to the table. More...
 
virtual void AddTableListener (llvm::StringRef key, ITableListener *listener, bool immediateNotify)=0
 Add a listener for changes to a specific key the table. More...
 
virtual void AddTableListenerEx (llvm::StringRef key, ITableListener *listener, unsigned int flags)=0
 Add a listener for changes to a specific key the table. More...
 
virtual void AddSubTableListener (ITableListener *listener)=0
 This will immediately notify the listener of all current sub tables. More...
 
virtual void AddSubTableListener (ITableListener *listener, bool localNotify)=0
 This will immediately notify the listener of all current sub tables. More...
 
virtual void RemoveTableListener (ITableListener *listener)=0
 Remove a listener from receiving table events. More...
 

Detailed Description

A table whose values can be read and written to.

Member Function Documentation

virtual void ITable::AddSubTableListener ( ITableListener listener)
pure virtual

This will immediately notify the listener of all current sub tables.

Parameters
listenerthe listener to add

Implemented in NetworkTable.

virtual void ITable::AddSubTableListener ( ITableListener listener,
bool  localNotify 
)
pure virtual

This will immediately notify the listener of all current sub tables.

Parameters
listenerthe listener to add
localNotifyif true then this listener will be notified of all local changes in addition to all remote changes

Implemented in NetworkTable.

virtual void ITable::AddTableListener ( ITableListener listener)
pure virtual

Add a listener for changes to the table.

Parameters
listenerthe listener to add

Implemented in NetworkTable.

virtual void ITable::AddTableListener ( ITableListener listener,
bool  immediateNotify 
)
pure virtual

Add a listener for changes to the table.

Parameters
listenerthe listener to add
immediateNotifyif true then this listener will be notified of all current entries (marked as new)

Implemented in NetworkTable.

virtual void ITable::AddTableListener ( llvm::StringRef  key,
ITableListener listener,
bool  immediateNotify 
)
pure virtual

Add a listener for changes to a specific key the table.

Parameters
keythe key to listen for
listenerthe listener to add
immediateNotifyif true then this listener will be notified of all current entries (marked as new)

Implemented in NetworkTable.

virtual void ITable::AddTableListenerEx ( ITableListener listener,
unsigned int  flags 
)
pure virtual

Add a listener for changes to the table.

Parameters
listenerthe listener to add
immediateNotifyif true then this listener will be notified of all current entries (marked as new)
flagsbitmask of NT_NotifyKind specifying desired notifications

Implemented in NetworkTable.

virtual void ITable::AddTableListenerEx ( llvm::StringRef  key,
ITableListener listener,
unsigned int  flags 
)
pure virtual

Add a listener for changes to a specific key the table.

Parameters
keythe key to listen for
listenerthe listener to add
immediateNotifyif true then this listener will be notified of all current entries (marked as new)
flagsbitmask of NT_NotifyKind specifying desired notifications

Implemented in NetworkTable.

virtual void ITable::ClearFlags ( llvm::StringRef  key,
unsigned int  flags 
)
pure virtual

Clears flags on the specified key in this table.

The key can not be null.

Parameters
keythe key name
flagsthe flags to clear (bitmask)

Implemented in NetworkTable.

virtual void ITable::ClearPersistent ( llvm::StringRef  key)
pure virtual

Stop making a key's value persistent through program restarts.

The key cannot be null.

Parameters
keythe key name

Implemented in NetworkTable.

virtual bool ITable::ContainsKey ( llvm::StringRef  key) const
pure virtual

Determines whether the given key is in this table.

Parameters
keythe key to search for
Returns
true if the table as a value assigned to the given key

Implemented in NetworkTable.

virtual bool ITable::ContainsSubTable ( llvm::StringRef  key) const
pure virtual

Determines whether there exists a non-empty subtable for this key in this table.

Parameters
keythe key to search for
Returns
true if there is a subtable with the key which contains at least one key/subtable of its own

Implemented in NetworkTable.

virtual void ITable::Delete ( llvm::StringRef  key)
pure virtual

Deletes the specified key in this table.

Parameters
keythe key name

Implemented in NetworkTable.

virtual std::vector<int> ITable::GetBooleanArray ( llvm::StringRef  key,
llvm::ArrayRef< int >  defaultValue 
) const
pure virtual

Returns the boolean array the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the array. If the overhead of this is a concern, use GetValue() instead.
The returned array is std::vector<int> instead of std::vector<bool> because std::vector<bool> is special-cased in C++. 0 is false, any non-zero value is true.

Implemented in NetworkTable.

virtual unsigned int ITable::GetFlags ( llvm::StringRef  key) const
pure virtual

Returns the flags for the specified key.

Parameters
keythe key name
Returns
the flags, or 0 if the key is not defined

Implemented in NetworkTable.

virtual std::vector<std::string> ITable::GetKeys ( int  types = 0) const
pure virtual
Parameters
typesbitmask of types; 0 is treated as a "don't care".
Returns
keys currently in the table

Implemented in NetworkTable.

virtual std::vector<double> ITable::GetNumberArray ( llvm::StringRef  key,
llvm::ArrayRef< double >  defaultValue 
) const
pure virtual

Returns the number array the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the array. If the overhead of this is a concern, use GetValue() instead.

Implemented in NetworkTable.

virtual std::string ITable::GetRaw ( llvm::StringRef  key,
llvm::StringRef  defaultValue 
) const
pure virtual

Returns the raw value (byte array) the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the raw contents. If the overhead of this is a concern, use GetValue() instead.

Implemented in NetworkTable.

virtual std::vector<std::string> ITable::GetStringArray ( llvm::StringRef  key,
llvm::ArrayRef< std::string >  defaultValue 
) const
pure virtual

Returns the string array the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the array. If the overhead of this is a concern, use GetValue() instead.

Implemented in NetworkTable.

virtual std::shared_ptr<ITable> ITable::GetSubTable ( llvm::StringRef  key) const
pure virtual

Gets the subtable in this table for the given name.

Parameters
keythe name of the table relative to this one
Returns
a sub table relative to this one

Implemented in NetworkTable.

virtual std::vector<std::string> ITable::GetSubTables ( ) const
pure virtual
Returns
subtables currently in the table

Implemented in NetworkTable.

virtual std::shared_ptr<nt::Value> ITable::GetValue ( llvm::StringRef  key) const
pure virtual

Gets the value associated with a key as an object.

Parameters
keythe key of the value to look up
Returns
the value associated with the given key, or nullptr if the key does not exist

Implemented in NetworkTable.

virtual bool ITable::IsPersistent ( llvm::StringRef  key) const
pure virtual

Returns whether the value is persistent through program restarts.

The key cannot be null.

Parameters
keythe key name

Implemented in NetworkTable.

virtual bool ITable::PutBoolean ( llvm::StringRef  key,
bool  value 
)
pure virtual

Put a boolean in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual bool ITable::PutBooleanArray ( llvm::StringRef  key,
llvm::ArrayRef< int >  value 
)
pure virtual

Put a boolean array in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type
Note
The array must be of int's rather than of bool's because std::vector<bool> is special-cased in C++. 0 is false, any non-zero value is true.

Implemented in NetworkTable.

virtual bool ITable::PutNumber ( llvm::StringRef  key,
double  value 
)
pure virtual

Put a number in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual bool ITable::PutNumberArray ( llvm::StringRef  key,
llvm::ArrayRef< double >  value 
)
pure virtual

Put a number array in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual bool ITable::PutRaw ( llvm::StringRef  key,
llvm::StringRef  value 
)
pure virtual

Put a raw value (byte array) in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual bool ITable::PutString ( llvm::StringRef  key,
llvm::StringRef  value 
)
pure virtual

Put a string in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual bool ITable::PutStringArray ( llvm::StringRef  key,
llvm::ArrayRef< std::string >  value 
)
pure virtual

Put a string array in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual bool ITable::PutValue ( llvm::StringRef  key,
std::shared_ptr< nt::Value value 
)
pure virtual

Put a value in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type

Implemented in NetworkTable.

virtual void ITable::RemoveTableListener ( ITableListener listener)
pure virtual

Remove a listener from receiving table events.

Parameters
listenerthe listener to be removed

Implemented in NetworkTable.

virtual bool ITable::SetDefaultBoolean ( llvm::StringRef  key,
bool  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultBooleanArray ( llvm::StringRef  key,
llvm::ArrayRef< int >  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultNumber ( llvm::StringRef  key,
double  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultNumberArray ( llvm::StringRef  key,
llvm::ArrayRef< double >  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultRaw ( llvm::StringRef  key,
llvm::StringRef  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultString ( llvm::StringRef  key,
llvm::StringRef  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultStringArray ( llvm::StringRef  key,
llvm::ArrayRef< std::string >  defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual bool ITable::SetDefaultValue ( llvm::StringRef  key,
std::shared_ptr< nt::Value defaultValue 
)
pure virtual

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type

Implemented in NetworkTable.

virtual void ITable::SetFlags ( llvm::StringRef  key,
unsigned int  flags 
)
pure virtual

Sets flags on the specified key in this table.

The key can not be null.

Parameters
keythe key name
flagsthe flags to set (bitmask)

Implemented in NetworkTable.

virtual void ITable::SetPersistent ( llvm::StringRef  key)
pure virtual

Makes a key's value persistent through program restarts.

Parameters
keythe key to make persistent

Implemented in NetworkTable.


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