Encapsulates serialized data for activity elements. More...
#include <kanzi/ui/node/concept/activity/activity_element_history.hpp>
Classes | |
| struct | SerializedActivityProperty |
| Encapsulates the serialized data for a property. More... | |
Public Types | |
| typedef vector< SerializedActivityProperty > | SerializedActivityPropertyContainer |
| Container of serialized of properties. | |
Public Member Functions | |
| ActivityElementHistory (Node &node, const vector< string > &childrenHistory) | |
| Constructor. | |
| ActivityElementHistory (string activityElementHistoryData) | |
| Constructor. | |
| ActivityElementHistory (string_view name, const SerializedActivityPropertyContainer &properties, const vector< string > &childrenHistory) | |
| Constructor. | |
| const vector< string > & | getChildrenHistory () const |
| Accesses the serialized children. | |
| const string & | getName () const |
| Accesses the name of the element. | |
| const SerializedActivityPropertyContainer & | getProperties () const |
| Accesses the serialized properties. | |
| bool | hasHistory (string_view activityPath) const |
| Returns whether an ActivityElement at the given relative path has history. | |
| bool | invalidate (string_view activityPath) |
| Invalidates the history for the ActivityElement with the given relative path. | |
| bool | invalidateProperties (string_view activityPath, const vector< AbstractPropertyType > &invalidProperties) |
| Invalidates the serialized property values for an ActivityElement with the given relative path. | |
| string | serialize () const |
| Serializes the history to a byte buffer. | |
Static Public Member Functions | |
| static void | deserializeActivityProperty (Node &node, const SerializedActivityProperty &property) |
| Deserializes an activity property. | |
| static string_view | extractNameFromSerializedString (const string_view data) |
| Returns the name of an Activity element from the data. | |
| static bool | extractVariantFromSerializedPropertyString (string_view value, PropertyDataType dataType, Variant &variant) |
| Extracts property data from a serialized string into a Variant type. | |
| static optional< string > | findPropertyValue (string_view propertyName, string_view serializedActivityElement) |
| Returns a value for a property in the serialized history of an ActivityElement. | |
| static vector< SerializedActivityProperty > | getSerializedProperties (Node &node) |
| Returns the properties and property values that an Activity serialized. | |
| static bool | isActivityProperty (const AbstractPropertyType &property, string_view activityName) |
| Returns whether a property belongs to an Activity node, or not. | |
| static bool | isPropertySkippedForUpdate (string_view name) |
| Checks if property given with name does not trigger the update of Activity Browser Properties. | |
| static string | serializeActivityProperty (const AbstractPropertyType &property, string_view value) |
| Serializes a single Activity property to a string. | |
Static Public Attributes | |
| static constexpr const char * | s_activityPropertyNamespace |
| The namespace to which an Activity Property must belong. | |
Encapsulates serialized data for activity elements.
This is a helper class for activities and activity hosts.
| typedef vector<SerializedActivityProperty> kanzi::ActivityElementHistory::SerializedActivityPropertyContainer |
Container of serialized of properties.
|
explicit |
Constructor.
Constructs the history of a node and its child nodes from serialized data.
| activityElementHistoryData | Serialized data. |
|
explicit |
Constructor.
Constructs the history for a node and uses serialized data for its children.
| node | The node to extract history from. |
| childrenHistory | The serialized history of the activity element's children. |
|
explicit |
Constructor.
Constructs the history from a nodes name, its properties and serialized history of its children.
| name | The name of the activity element. |
| properties | The properties of the activity element. |
| childrenHistory | The serialized history of the activity element's children. |
| string kanzi::ActivityElementHistory::serialize | ( | ) | const |
Serializes the history to a byte buffer.
| bool kanzi::ActivityElementHistory::invalidate | ( | string_view | activityPath | ) |
Invalidates the history for the ActivityElement with the given relative path.
| activityPath | The relative path of the ActivityElement for which to invalidate the history. |
| bool kanzi::ActivityElementHistory::invalidateProperties | ( | string_view | activityPath, |
| const vector< AbstractPropertyType > & | invalidProperties ) |
Invalidates the serialized property values for an ActivityElement with the given relative path.
| activityPath | The relative path of the ActivityElement for which to invalidate the properties. |
| invalidProperties | The list of property types to invalidate. |
| bool kanzi::ActivityElementHistory::hasHistory | ( | string_view | activityPath | ) | const |
Returns whether an ActivityElement at the given relative path has history.
| activityPath | Relative path to the ActivityElement whose history you want to check. |
|
static |
Returns whether a property belongs to an Activity node, or not.
A property belongs to an Activity node if:
| property | The property to check. |
| activityName | The name of an Activity node. |
|
static |
Returns the properties and property values that an Activity serialized.
| node | The activity node to serialize. |
|
static |
Serializes a single Activity property to a string.
This serialized string is included in the serialized history of the ActivityElement.
| property | The property to serialize. |
| value | The value of property to serialize. |
|
static |
Deserializes an activity property.
| node | The activity node. |
| property | The serialized property. |
| const SerializedActivityPropertyContainer & kanzi::ActivityElementHistory::getProperties | ( | ) | const |
Accesses the serialized properties.
| const vector< string > & kanzi::ActivityElementHistory::getChildrenHistory | ( | ) | const |
Accesses the serialized children.
| const string & kanzi::ActivityElementHistory::getName | ( | ) | const |
Accesses the name of the element.
|
static |
Returns a value for a property in the serialized history of an ActivityElement.
| propertyName | The name of the property for which you requested the value. |
| serializedActivityElement | String representation of a serialized ActivityElement. |
|
static |
Extracts property data from a serialized string into a Variant type.
| value | The serialized property data string. |
| dataType | The data type of the property to extract. |
| variant | A reference to the extracted Variant. |
|
static |
Returns the name of an Activity element from the data.
This function does not modify the buffer.
| data | The serialized data from which to get the name of an Activity element. |
Checks if property given with name does not trigger the update of Activity Browser Properties.
| name | The property name to check. |
The namespace to which an Activity Property must belong.