RuntimeDataObjectTyped

template<class DataType, RuntimeDataObject::Type DataTypeEnum>
class kanzi::connect::RuntimeDataObjectTyped : public RuntimeDataObject

Template class that can be used to specialize standard types.

Provide basic functions to host / set / get value of given type.

Public Functions

inline explicit RuntimeDataObjectTyped(ConnectDomain *domain, const string &name, const DataType &value, const string &nameOverride = "")

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

Parameters
  • name: Name of the data object.

  • value: Initial value of the contained data.

inline explicit RuntimeDataObjectTyped(ConnectDomain *domain, const string &path, const string &name, const DataType &value, const string &nameOverride, Persistence persistenceDefinition, const persistence::SettingFactory *settingFactory)

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

See

RuntimeDataObject

Parameters
  • path: Path that contains names of the parents separated with ‘.’

  • name: Name of the data object.

  • value: Initial value of the contained data.

  • nameOverride:

Parameters
  • persistenceDefinition: Defines whether the runtime data object value is persisted or not

inline virtual RuntimeDataObjectSharedPtr clone () KZ_OVERRIDE

Clone the object.

Return

cloned object

inline virtual bool copyValueFrom (RuntimeDataObjectSharedPtr other) KZ_OVERRIDE

Copies a value from passed object.

Return

true if copied successfully.

Parameters
  • other: the object where-from to copy.

inline virtual bool equals (RuntimeDataObjectSharedPtr object) KZ_OVERRIDE

Comparison overload.

Parameters
  • other: where to perform the comparison against.

inline DataType getDefaultValue() const

Retrieve the default value for this object.

Return

Default value stored to the object.

inline virtual string getDefaultValueStr () const KZ_OVERRIDE

Virtual function which exists in this base class but should never be used. This is overridden in classes where its appropriate.

inline virtual string getSerializedValue () const KZ_OVERRIDE

Get the runtimedata object value in serialized format.

Return

The value, empty string if object has no value

inline virtual Type getType () const KZ_OVERRIDE

Retrieves the type of this data object.

Return

Type enumeration of this data object.

inline DataType getValue() const

Retrieves the value that is represented by this data object.

Return

Value within this data object.

inline bool setValue(const DataType &value)

Sets the value of this data object.

Return

true if value actually got changed.

Parameters
  • value: New value that is assigned to this data object.