Kanzi  3.9.6
Kanzi Engine API
kanzi::ActivityHistoryManager Class Reference

ActivityHistoryManager encapsulates functionality of serialization of activities. More...

#include <kanzi/ui/node/concept/activity/activity_history_manager.hpp>

Public Member Functions

 ActivityHistoryManager (ActivityElement &activityElement)
 Constructor. More...
 
vector< string >::const_iterator beginSerializedChildren () const
 Returns the begin iterator to the internal storage of serialized child items. More...
 
void deserialize (string_view data)
 Deserializes the activity element from a byte buffer. More...
 
void deserialize (ActivityElement &activityElement)
 Deserializes a child activity element from the internal byte buffer. More...
 
vector< string >::const_iterator endSerializedChildren () const
 Returns the end iterator to the internal storage of serialized child items. More...
 
void excludePropertyFromDeserialization (string_view name)
 Excludes a property type from the list of properties that Kanzi can deserialize, when Kanzi initializes an Activity node. More...
 
template<typename DataType >
optional< DataType > getPropertyFromHistory (AbstractPropertyType property, string_view serializedActivityElement) const
 Returns the value of property type stored in the history. More...
 
bool hasHistory (string_view activityPath) const
 Returns whether a child ActivityElement or one of its parent nodes has history data stored in the internal buffer. More...
 
void invalidate (string_view activityPath)
 Invalidates the history for an ActivityElement with the given relative path. More...
 
void invalidateProperties (string_view activityPath, const vector< AbstractPropertyType > &invalidProperties)
 Invalidates the serialized property values for an ActivityElement with the given relative path. More...
 
void removePropertyFromDeserializationExclusion (string_view name)
 Removes a property from the list of properties that Kanzi does not deserialize. More...
 
string serialize () const
 Serializes the activity element to a byte buffer. More...
 
void serialize (ActivityElement &activityElement)
 Serializes a child activity element to the internal byte buffer. More...
 

Detailed Description

ActivityHistoryManager encapsulates functionality of serialization of activities.

Constructor & Destructor Documentation

◆ ActivityHistoryManager()

kanzi::ActivityHistoryManager::ActivityHistoryManager ( ActivityElement activityElement)
explicit

Constructor.

Parameters
activityElementThe activity that this ActivityHistoryManager manages.

Member Function Documentation

◆ hasHistory()

bool kanzi::ActivityHistoryManager::hasHistory ( string_view  activityPath) const

Returns whether a child ActivityElement or one of its parent nodes has history data stored in the internal buffer.

Parameters
activityPathRelative path to the ActivityElement whose history you want to check.
Returns
If the ActivityElement at the given path has history, true, otherwise false.

◆ serialize() [1/2]

string kanzi::ActivityHistoryManager::serialize ( ) const

Serializes the activity element to a byte buffer.

Returns
The byte buffer containing the serialized data.

◆ deserialize() [1/2]

void kanzi::ActivityHistoryManager::deserialize ( string_view  data)

Deserializes the activity element from a byte buffer.

Parameters
dataThe byte buffer containing the serialized data.

◆ serialize() [2/2]

void kanzi::ActivityHistoryManager::serialize ( ActivityElement activityElement)

Serializes a child activity element to the internal byte buffer.

Parameters
activityElementThe activity element to serialize.

◆ deserialize() [2/2]

void kanzi::ActivityHistoryManager::deserialize ( ActivityElement activityElement)

Deserializes a child activity element from the internal byte buffer.

Parameters
activityElementThe activity element to deserialize.

◆ invalidate()

void kanzi::ActivityHistoryManager::invalidate ( string_view  activityPath)

Invalidates the history for an ActivityElement with the given relative path.

Parameters
activityPathThe relative path of the ActivityElement for which to invalidate the history.
Since
Kanzi 3.9.3

◆ invalidateProperties()

void kanzi::ActivityHistoryManager::invalidateProperties ( string_view  activityPath,
const vector< AbstractPropertyType > &  invalidProperties 
)

Invalidates the serialized property values for an ActivityElement with the given relative path.

Parameters
activityPathThe relative path of the ActivityElement for which to invalidate the properties.
invalidPropertiesThe list of property types to invalidate.
Since
Kanzi 3.9.3

◆ excludePropertyFromDeserialization()

void kanzi::ActivityHistoryManager::excludePropertyFromDeserialization ( string_view  name)

Excludes a property type from the list of properties that Kanzi can deserialize, when Kanzi initializes an Activity node.

Parameters
nameThe name of a property to exclude from deserialization.
Since
Kanzi 3.9.0

◆ removePropertyFromDeserializationExclusion()

void kanzi::ActivityHistoryManager::removePropertyFromDeserializationExclusion ( string_view  name)

Removes a property from the list of properties that Kanzi does not deserialize.

This way you enable Kanzi to deserialize a property type when Kanzi initializes an Activity node.

Parameters
nameThe name of the property to remove from the list of properties that Kanzi does not deserialize.
Since
Kanzi 3.9.0

◆ beginSerializedChildren()

vector<string>::const_iterator kanzi::ActivityHistoryManager::beginSerializedChildren ( ) const

Returns the begin iterator to the internal storage of serialized child items.

/return The begin iterator to the internal storage of serialized child items.

Since
Kanzi 3.9.0

◆ endSerializedChildren()

vector<string>::const_iterator kanzi::ActivityHistoryManager::endSerializedChildren ( ) const

Returns the end iterator to the internal storage of serialized child items.

/return The end iterator to the internal storage of serialized child items.

Since
Kanzi 3.9.0

◆ getPropertyFromHistory()

template<typename DataType >
optional<DataType> kanzi::ActivityHistoryManager::getPropertyFromHistory ( AbstractPropertyType  property,
string_view  serializedActivityElement 
) const

Returns the value of property type stored in the history.

Parameters
propertyThe name of the property type to find in the serialized ActivityElement whose value you want to get.
serializedActivityElementThe serialized ActivityElement where to look for the property type.
Returns
Returns the property type value found in the serialized ActivityElement. If the property type is not serialized, returns nullopt.
Since
Kanzi 3.9.0

The documentation for this class was generated from the following file: