RuntimeDataObjectList

class kanzi::connect::RuntimeDataObjectList : public RuntimeDataObject

RuntimeDataObject list is used to hold list of information.

Public Functions

RuntimeDataObjectList(ConnectDomainSharedPtr domain, const string &name, const string nameOverride = "")

Standard constructor.

Parameters
  • name: Name of the data object.

RuntimeDataObjectList(ConnectDomainSharedPtr domain, const string &path, const string &name, const string nameOverride)

Standard constructor.

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

  • name: Name of the data object.

void appendItem(RuntimeDataObjectSharedPtr item)

Adds an item to the end of the list.

Parameters
  • item: the item to add

RuntimeDataObjectSharedPtr clone() override

Clone the object as is.

Return

exact clone of the object that was being called to.

RuntimeDataObjectSharedPtr createItem()

Creates a new item based on stored item schema, or in case not present, from the first item stored currently in the list.

Return

newly allocate item tree with default values.

RuntimeDataObjectSharedPtr createItemInplace()

Creates a list item and inserts it to the end of the list.

Return

newly allocated object.

void disableModificationNotifications()

Disables modification notifications.

int enableModificationNotifications()

Enables modification notifications.

Return

the amount of modification requests received while those were disabled.

bool equals(RuntimeDataObjectSharedPtr other) override

Comparison.

Return

true if equals

Parameters
  • other: to be compared with

RuntimeDataObjectSharedPtr getItem(size_t index)

Get item at specific position.

Return

pointer to object

Parameters
  • index: the position of item

RuntimeDataObjectSharedPtr getTemplateItem() const

Retrieve template item.

Return

the template item.

Type getType() const override

Retrieves the type of this data object.

Return

Type enumeration of this data object.

shared_ptr<DataObject> getUITemplateItem() const

Gets UI template item.

Return

template item.

void insertItem(RuntimeDataObjectSharedPtr item, size_t position)

Inserts item into requested position.

If position is invalid then object is put to the end.

Parameters
  • position: position where to put the item into.

size_t itemCount()

return amount of items currently in list

Return

amount of elements.

void removeAllChildren() override

Remove all list items under this.

void removeChild(const RuntimeDataObject &child) override

Remove a list item under this.

Parameters
  • child: The item to remove

void removeChild(size_t index) override

Remove a list item within this.

Parameters
  • index: Identifies the item to remove

void removeItem(size_t index)

Release item at given position within the list.

Parameters
  • index: item position.

void removeListItems()

Remove all list items under this.

void resizeTo(size_t size)

Resizes the list to specific size.

Parameters
  • size: the new size for list.

bool setSerializedJsonValues(const string &valueList)

Set the list values from json data.

Parameters
  • valueList: Contains the values to set in json format

void setTemplateItem(RuntimeDataObjectSharedPtr tmpl)

Save the template item used to factorize objects.

Parameters
  • tmpl: template object

void setUITemplateItem(shared_ptr<DataObject> item)

Sets UI template item.

Parameters
  • item: the template item