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

RuntimeDataObjectTyped(ConnectDomainSharedPtr 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.

RuntimeDataObjectTyped(ConnectDomainSharedPtr 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

RuntimeDataObjectSharedPtr clone() override

Clone the object.

Return

cloned object

bool copyValueFrom(RuntimeDataObjectSharedPtr other) override

Copies a value from passed object.

Return

true if copied successfully.

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

bool equals(RuntimeDataObjectSharedPtr object) override

Comparison overload.

Parameters
  • other: where to perform the comparison against.

DataType getDefaultValue() const

Retrieve the default value for this object.

Return

Default value stored to the object.

string getDefaultValueStr() const override

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

string getSerializedValue() const override

Get the runtimedata object value in serialized format.

Return

The value, empty string if object has no value

Type getType() const override

Retrieves the type of this data object.

Return

Type enumeration of this data object.

DataType getValue() const

Retrieves the value that is represented by this data object.

Return

Value within this data object.

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.