All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::TypedDataObject< DataType, DataTypeEnum > Class Template Reference

Template class that can be used with standard types. More...

#include <kanzi/data/data_object.hpp>

Inheritance diagram for kanzi::TypedDataObject< DataType, DataTypeEnum >:
kanzi::DataObject

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...
 
- Public Member Functions inherited from kanzi::DataObject
 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< TypelookupDataObject (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

- Public Types inherited from kanzi::DataObject
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
 

Detailed Description

template<class DataType, DataObject::Type DataTypeEnum>
class kanzi::TypedDataObject< DataType, DataTypeEnum >

Template class that can be used with standard types.

Provides functions to host / set / get value of given type.

Constructor & Destructor Documentation

template<class DataType , DataObject::Type DataTypeEnum>
kanzi::TypedDataObject< DataType, DataTypeEnum >::TypedDataObject ( string_view  name,
const DataType &  value 
)
inlineexplicit

Constructor that initializes a typed data object from name and value.

Parameters
nameName of the data object.
valueInitial value of the contained data.

Member Function Documentation

template<class DataType , DataObject::Type DataTypeEnum>
virtual Type kanzi::TypedDataObject< DataType, DataTypeEnum >::getType ( ) const
inlinevirtual

Retrieves the type of this data object.

Returns
Type enumeration of this data object.

Reimplemented from kanzi::DataObject.

template<class DataType , DataObject::Type DataTypeEnum>
DataType kanzi::TypedDataObject< DataType, DataTypeEnum >::getValue ( ) const
inline

Retrieves the value that is represented by this data object.

Returns
Value within this data object.
template<class DataType , DataObject::Type DataTypeEnum>
void kanzi::TypedDataObject< DataType, DataTypeEnum >::setValue ( const DataType &  value)
inline

Sets the value of this data object.

Parameters
valueNew value that is assigned to this data object.

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