Template class that can be used with standard types. More...
#include <kanzi/data/data_object.hpp>
Public Member Functions | |
TypedDataObject (string_view name, const DataType &value) | |
Constructor that initializes a typed data object from name and value. More... | |
virtual Type | getType () const |
Retrieves the type of this data object. More... | |
DataType | getValue () const |
Retrieves the value that is represented by this data object. More... | |
void | setValue (const DataType &value) |
Sets the value of this data object. More... | |
![]() | |
DataObject (string_view name) | |
Standard constructor. More... | |
string | getName () const |
Allows to retrieve the name of the object. More... | |
void | setName (string_view value) |
Sets the name of the object. More... | |
size_t | getChildCount () const |
Retrieves the count of child objects in this data object. More... | |
DataObjectSharedPtr | getChild (size_t index) const |
Retrieves a child object in given index. More... | |
size_t | getChildIndex (const DataObject &child) const |
Retrieves the index of a child data object. More... | |
bool | hasChild (const DataObject &child) const |
Checks whether or not the child exists. More... | |
DataObjectSharedPtr | findChild (string_view name) |
Tries to find a child with given name. More... | |
void | addChild (const DataObjectSharedPtr &child) |
Adds data object as child of this object. More... | |
void | insertChild (size_t index, const DataObjectSharedPtr &child) |
Inserts data object as child of this object, allows to specify index of the object. More... | |
void | removeChild (const DataObject &child) |
Removes a child object from list of childs. More... | |
void | removeChild (size_t index) |
Removes a child object in given index. More... | |
void | removeAllChildren () |
Removes all children. More... | |
ChildConstIterator | beginChildren () const |
Returns iterator to start of the child container. More... | |
ChildConstIterator | endChildren () const |
Returns iterator in the end of the child container. More... | |
template<typename Type > | |
shared_ptr< Type > | lookupDataObject (string_view relativePath) |
DataObjectSharedPtr | lookupDataObject (string_view relativePath) |
Performs object look-up by path. More... | |
ModifiedSubscriptionToken | addModifiedNotificationHandler (ModifiedFunction callback) |
Allows to subscribe to modifications in this data object. More... | |
void | removeModifiedNotificationHandler (ModifiedSubscriptionToken token) |
Allows to unsubscribe from modifications in this data object. More... | |
void | notifyModified () |
Triggers modification procedure in this data object, which invokes the subscriptions. More... | |
Additional Inherited Members | |
![]() | |
enum | Type { Object, Integer, Real, Bool, String, Enum, List } |
Type enumerations for different data object types. More... | |
typedef function< void()> | ModifiedFunction |
Callback function type for change subscriptions. More... | |
typedef shared_ptr< void > | ModifiedSubscriptionToken |
Token type that can be used to identify the change subscription. More... | |
typedef vector < DataObjectSharedPtr > | ChildContainer |
Iterators for children. More... | |
typedef ChildContainer::const_iterator | ChildConstIterator |
typedef ChildContainer::const_reverse_iterator | ChildConstReverseIterator |
Template class that can be used with standard types.
Provides functions to host / set / get value of given type.
|
inlineexplicit |
Constructor that initializes a typed data object from name and value.
name | Name of the data object. |
value | Initial value of the contained data. |
|
inlinevirtual |
Retrieves the type of this data object.
Reimplemented from kanzi::DataObject.
|
inline |
Retrieves the value that is represented by this data object.
|
inline |
Sets the value of this data object.
value | New value that is assigned to this data object. |