|
| | DataIO (GraphTreeObject *data_parent, const char *data_name, T initial_value) |
| | Constructor for the DataIO object.
|
| | DataIO (GraphTreeObject *data_parent, const char *data_name) |
| | DataIO (GraphTreeObject *data_parent) |
| | DataIO () |
| | ~DataIO () |
| int | dataSize () override |
| | Return the size of the value held by the dataio object.
|
| void | mapToPointer (T *data_source) |
| | Function to map the DataIO object to a pointer, rather than another of its kind.
|
| int16 | operator() (const T &new_value) |
| | Function to set the value of the DataIO object.
|
| T * | getRootDataPointer () |
| | Function to return a handle to the root data held in THIS object.
|
| void | resetMap () |
| const T & | operator() () const |
| | Overloaded operator to return value of DataIO object.
|
| virtual int16 | getValueAsString (char *retval, size_t size) override |
| | Function to log data to a logger.
|
| virtual int16 | setValueFromString (const char *value) override |
| | Set the value held by the DataIO object from a string.
|
| | DataIOBase () |
| | Default constructor.
|
| | ~DataIOBase () |
| virtual int16 | syncExternal () |
| | Synchronize DataIO to some external source – Socket, shared memory, etc.
|
| void | allowWrite () |
| | Functions to manipulate write permissions on DataIO object.
|
| void | blockWrite () |
| bool | writeAllowed () |
| void | mapTo (DataIOBase &data_source) |
| | Function to map DataIO object to new upstream data source.
|
| void | resetMap () |
| DataIOBase * | dataSource () |
| | Access the target to which the DataIO is mapped.
|
| void * | writePtr () |
| | Function to write value to mapped location – root data or map.
|
| void * | read () const |
| | Function to read value from mapped location – root data or map.
|
| uint8 | dataType () |
| | Function to return the type of data held by the DataIO.
|
| | GraphTreeObject (const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0) |
| | Name-based constructor for GraphTreeObject which will have no children by default.
|
| virtual | ~GraphTreeObject () |
| | Destructor.
|
| GraphTreeObject * | parent () |
| | Functions to get object's parent/children.
|
| GraphTreeObject ** | children () |
| GraphTreeObject * | childAtIndex (uint8 i) const |
| int16 | parent (GraphTreeObject *new_parent) |
| | Function to assign the node's parent via pointer.
|
| int16 | parent (GraphTreeObject &new_parent) |
| | Function to assign the node's parent via reference.
|
| uint8 | nChildren () const |
| | Getters for number of children and descendants.
|
| uint16 | nDescendants () const |
| uint8 | capacity () const |
| const char * | name () const |
| | Getter and setter for object name.
|
| int16 | name (const char *new_name) |
| uint8 | rank () |
| | Getter for the object rank.
|
| int8 | type () |
| | Function to indicate type – -1 by default unless implemented downstream.
|
| bool | loggable () |
| | Getter for object logability flag – note no setter because should only be set by this or a derived class in its definition.
|
| GraphTreeObject * | getRootDataPointer () |
| | Get the pointer to the highest object in the graph tree.
|
| virtual int16 | str (char *output, size_t size) const |
| | Get object represented as string.
|
| virtual int16 | fromStr (const char *val) |
| | Set value of graphtreeobject from string.
|
|
| int16 | _asString (double val, char *retval, size_t size) |
| int16 | _asString (bool val, char *retval, size_t size) |
| int16 | _asString (int8 val, char *retval, size_t size) |
| int16 | _asString (int16 val, char *retval, size_t size) |
| int16 | _asString (int32 val, char *retval, size_t size) |
| int16 | _asString (int64 val, char *retval, size_t size) |
| int16 | _asString (uint8 val, char *retval, size_t size) |
| int16 | _asString (uint16 val, char *retval, size_t size) |
| int16 | _asString (uint32 val, char *retval, size_t size) |
| int16 | _asString (uint64 val, char *retval, size_t size) |
| int16 | _asString (void *val, char *retval, size_t size) |
| int16 | _asString (char *val, char *retval, size_t size) |
| int16 | _asString (const GraphTreeObject &val, char *retval, size_t size) |
| template<typename Tn, size_t N> |
| int16 | _asString (const std::array< Tn, N > &val, char *retval, size_t size) |
| template<uint32 R, uint32 C> |
| int16 | _asString (const Matrix< R, C > &val, char *retval, size_t size) |
| int16 | _fromString (const char *setval, bool &retval) |
| int16 | _fromString (const char *setval, int8 &retval) |
| int16 | _fromString (const char *setval, int16 &retval) |
| int16 | _fromString (const char *setval, int32 &retval) |
| int16 | _fromString (const char *setval, int64 &retval) |
| int16 | _fromString (const char *setval, uint8 &retval) |
| int16 | _fromString (const char *setval, uint16 &retval) |
| int16 | _fromString (const char *setval, uint32 &retval) |
| int16 | _fromString (const char *setval, uint64 &retval) |
| int16 | _fromString (const char *setval, float &retval) |
| int16 | _fromString (const char *setval, double &retval) |
| int16 | _fromString (const char *setval, void *retval) |
| int16 | _fromString (const char *setval, char *retval) |
| int16 | _fromString (const char *setval, GraphTreeObject &retval) |
| template<uint32 R, uint32 C> |
| int16 | _fromString (const char *setval, Matrix< R, C > &retval) |
| template<typename Tn, long unsigned int N> |
| int16 | _fromString (const char *setval, std::array< Tn, N > &retval) |
| template<typename T> |
| std::enable_if< std::is_integral< T >::value >::type | _typeID (T var) |
| | Overloaded functions to identify type held by DataIO.
|
| template<typename T> |
| std::enable_if< std::is_floating_point< T >::value >::type | _typeID (T var) |
| template<typename T, long unsigned int N> |
| void | _typeID (std::array< T, N > var) |
| template<uint32 R, uint32 C> |
| void | _typeID (Matrix< R, C > var) |
| void | _typeID (const GraphTreeObject &var) |
| void | _typeID (const Time &var) |
| void | _typeID (void *var) |
| void | _typeID (int8 var) |
| void | _typeID (int16 var) |
| void | _typeID (int32 var) |
| void | _typeID (int64 var) |
| void | _typeID (uint8 var) |
| void | _typeID (uint16 var) |
| void | _typeID (uint32 var) |
| void | _typeID (uint64 var) |
| void | _typeID (char *var) |
| int16 | _setStorage (GraphTreeObject **storage_array, uint8 storage_size) |
| | Getter for object's string address.
|
| void | _recalculateDescendants () |
| | Function to recursively re-calculate the number of descendants of a given node on the tree.
|
| void | _recalculateRank () |
| | Function to recursively re-calculate the rank of a given node on the tree.
|
| int16 | _addChild (GraphTreeObject *child) |
| | Function to decompose a string into a series of substrings via indexing.
|
| int16 | _removeChild (GraphTreeObject *child) |
| | Function to remove a child from the graph node's children.
|
template<typename T>
class clockwerk::DataIO< T >
Class for inter-object communication.
The data IO object is a flexible input/output object for interfacing between models, tasks, events, and so on. It is templated to work with nearly any data type, provided that type can be passed and returned via function.
DataIO operates by abstracting data using a pointer. It holds an internal value of type T, and a pointer to the data source to use. By default, that data source is itself, but it may point16 to another DataIO object if commanded to do so via the mapTo function. In that case, DataIO will recursively call DataIO objects until it finds the root object, then return the value held by the root object.
- Note
- The DataIO object, while a child of GraphTreeObject, cannot have any children as no space is allocated for them. Therefore it must lie at the end of the tree.