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. More... | |
Public Member Functions | |
ActivityElementHistory (string activityElementHistoryData) | |
Constructor. More... | |
ActivityElementHistory (Node &node, const vector< string > &childrenHistory) | |
Constructor. More... | |
ActivityElementHistory (string_view name, const SerializedActivityPropertyContainer &properties, const vector< string > &childrenHistory) | |
Constructor. More... | |
const vector< string > & | getChildrenHistory () const |
Accesses the serialized children. More... | |
const string & | getName () const |
Accesses the name of the element. More... | |
const SerializedActivityPropertyContainer & | getProperties () const |
Accesses the serialized properties. More... | |
bool | invalidate (string_view activityPath) |
Invalidates the history for the ActivityElement with the given relative path. More... | |
bool | invalidateProperties (string_view activityPath, const vector< AbstractPropertyType > &invalidProperties) |
Invalidates the serialized property values for an ActivityElement with the given relative path. More... | |
string | serialize () const |
Serializes the history to a byte buffer. More... | |
Static Public Member Functions | |
static void | deserializeActivityProperty (Node &node, const SerializedActivityProperty &property) |
Deserializes an activity property. More... | |
static string_view | extractNameFromSerializedString (const string_view data) |
Retruns the name of an Activity element from the data. More... | |
static bool | extractVariantFromSerializedPropertyString (string_view value, PropertyDataType dataType, Variant &variant) |
Extracts property data from a serialized string into a Variant type. More... | |
static optional< string > | findPropertyValue (string_view propertyName, string_view serializedActivityElement) |
Returns a value for a property in the serialized history of an ActivityElement. More... | |
static vector< SerializedActivityProperty > | getSerializedProperties (Node &node) |
Returns the properties and property values that an Activity serialized. More... | |
static bool | isActivityProperty (const AbstractPropertyType &property, string_view activityName) |
Returns whether a property belongs to an Activity node, or not. More... | |
static bool | isPropertySkippedForUpdate (string_view name) |
Checks if property given with name does not trigger the update of Activity Browser Properties. More... | |
static string | serializeActivityProperty (const AbstractPropertyType &property, string_view value) |
Serializes a single Activity property to a string. More... | |
Static Public Attributes | |
static constexpr const char * | s_activityPropertyNamespace |
The namespace to which an Activity Property must belong. More... | |
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. |
|
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 |
Retruns 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. |
|
static |
Checks if property given with name does not trigger the update of Activity Browser Properties.
name | The property name to check. |
|
static |
The namespace to which an Activity Property must belong.