Class CSdvParamMap#
Defined in File param_impl.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public sdv::IParameters(Struct IParameters)
Derived Type#
public sdv::CSdvObject(Class CSdvObject)
Class Documentation#
-
class CSdvParamMap : public sdv::IParameters#
Parameter map base class implementing parameter support using the parameter map macros.
The parameter map base class implements the support for the parameter map macros as well as parameter state management. A class using parameters can derive from this class and overload the following events to control its behavior:
OnParamChanged - parameter has changed
OnParamFlagChanged - parameter flag has changed
Subclassed by sdv::CSdvObject
Unnamed Group
-
std::shared_ptr<internal::CParamGuardian> FindParamObject(const sdv::u8string &rssName)#
Find a parameter object by name.
- Parameters:
rssName – [in] Reference to the name of the parameter.
- Returns:
Smart pointer to the parameter guardian object or an empty pointer when the parameter was not found.
-
std::shared_ptr<const internal::CParamGuardian> FindParamObject(const sdv::u8string &rssName) const#
Find a parameter object by name.
- Parameters:
rssName – [in] Reference to the name of the parameter.
- Returns:
Smart pointer to the parameter guardian object or an empty pointer when the parameter was not found.
Public Functions
-
virtual ~CSdvParamMap() = default#
Default destructor.
-
virtual sequence<u8string> GetParamPaths() const override#
Return a sequence with parameter paths. Each path is unique and can be used to get and set the parameter value. Overload of sdv::IParameters::GetParamPaths.
- Returns:
Sequence containing parameter paths. Parameter paths are composed from group/sub-groups and the parameter name, separated by a dot.
-
virtual any_t GetParam(const u8string &ssPath) const override#
Returns the parameter value. Overload of sdv::IParameters::GetParam.
- Parameters:
ssPath – [in] Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name, separated by a dot.
- Returns:
Returns the parameter value. Returns an ‘empty’ parameter value when not successful or the parameter is not set.
-
virtual bool SetParam(const u8string &ssPath, any_t anyValue) override#
Set the parameter value. Overload of sdv::IParameters::SetParam.
- Parameters:
ssPath – [in] Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name, separated by a dot.
anyValue – [in] Reference to the parameter value to set.
- Returns:
Returns ‘true’ on success or ‘false’ when parameter could not be set (e.g. the parameter is read-only) or the index is larger than the amount of parameters being available.
-
virtual SParamInfo GetParamInfo(const u8string &ssPath) const override#
Get parameter information.Overload of sdv::IParameters::GetParamInfo.
- Parameters:
ssPath – [in] Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name, separated by a dot.
- Returns:
Return the parameter information for the requested parameter or an empty structure when no parameter information is available or the parameter is not available.
-
virtual bool IsParamDirty(const u8string &ssPath) const override#
Is the parameter dirty (was it changed)? Checks the parameter dirty flag. Overload of sdv::IParameters::IsDirty.
- Parameters:
ssPath – [in] Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name, separated by a dot.
- Returns:
Returns whether the parameter was changed either by an explicit call to the SetParam function or internally by the object itself.
-
void SetParamDirtyFlag(const std::string &rssPath)#
Set dirty flag for one parameter (or all properties for the function without parameters).
- Parameters:
rssPath – [in] Reference to the path of the parameter.
-
virtual void ResetParamDirtyFlag(const u8string &ssPath) override#
Reset the dirty flag. Overload of sdv::IParameters::ResetParamDirtyFlag.
- Parameters:
ssPath – [in] Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name, separated by a dot.
-
virtual bool IsParamMapDirty() const override#
Is the parameter map dirty? Overload of sdv::IParameters::IsParamMapDirty.
- Returns:
Returns true when any one of the parameters is flagged as dirty.
-
virtual void ResetParamMapDirtyFlags() override#
Reset the dirty flag for all parameters. Overload of sdv::IParameters::ResetParamMapDirtyFlags.
-
void LockParamMap()#
Lock the parameter map.
-
void UnlockParamMap()#
Unlock the parameter map.
Parameter changed event. Overload this function to implement parameter event handling.
- Parameters:
rssPath – [in] Reference to the string containing the path of the parameter that changed.
rvarOld – [in] Reference to the any holding the value of the parameter.
rvarNew – [in] Reference to the any holding the value of the parameter.
rptrParamInfo – [in] Reference to the smart pointer to the parameter information object.
Parameter dirty flag changed event. Overload this function to implement parameter dirty flag event handling.
- Parameters:
rssPath – [in] Reference to the string containing the path of the parameter that changed.
uiOldFlags – [in] The old value of the flags.
uiNewFlags – [in] The new value of the flags.
uiMask – [in] The mask of the flags that are changed by the new value.
rvar – [in] Reference to the any holding the value of the parameter.
rptrParamInfo – [in] Reference to the smart pointer to the parameter information object.
Public Static Functions
-
static inline std::vector<std::shared_ptr<sdv::CSdvParamInfo>> GetParamMapInfoStatic()#
Return a vector with parameter information structures. Empty function called when the derived class doesn’t implement its own parameter map.
- Returns:
Vector containing parameter information structures.
Protected Functions
Register the parameter in the parameter map.
- Template Parameters:
TVar – Type of the variable.
TConstruct – The arguments for the parameter info construct function.
- Parameters:
rtVar – [in] Reference to the parameter.
bLockable – [in] When set, the parameter is lockable. Only use with writable parameters.
bAutoDirty – [in] When set, the parameter dirty flag is detected automatically. Only use with writable parameters.
tConstruct – [in] The construct function arguments.
- Returns:
Smart pointer to the parameter information structure.
Register a member parameter map into this parameter map.
- Parameters:
rptrMember – [in] Reference to the smart pointer pointing to the member map.
-
virtual void InitParamMap()#
Initialize the parameter map. This function is called only once for initial map creation. This implementation doesn’t do anything. The parameter map macros overload this function to allow map building.
-
bool BuildNecessary() const#
Is a parameter map build necessary?
- Returns:
Returns whether parameter map building is required.