Struct IPropertiesHandler

Inheritance Relationships

Derived Type

Struct Documentation

struct IPropertiesHandler

Interface for classes that exposes properties in order to be serialized/deserialized from a session.

Subclassed by SmartPeak::SessionLoaderGenerator

Public Functions

virtual std::string getPropertiesHandlerName() const = 0

Returns the name of the properties container.

The name must be unique across all the instances of the session.

Returns

name of the properties container

virtual std::map<std::string, CastValue::Type> getPropertiesSchema() const = 0

Returns the list of properties, name of the property, and its type.

Returns

a map of name/type

inline virtual size_t getNbRows() const

In case the IPropertiesHandler is a table, returns the number of rows.

Returns

number of rows

virtual std::optional<CastValue> getProperty(const std::string &property, const size_t row = 0) const = 0

Returns the property value based on the name.

Returns

the property value, as CastValue, std::nullopt if the property does not exists.

virtual void setProperty(const std::string &property, const CastValue &value, const size_t row) = 0

Sets the property value based on the name.