DynamicDescription Class Reference

#include <lib_description.h>

Detailed Description

The dynamic description class stores user data values. See Description for its container format.

Note
Use EditDescription() to let the user edit the container settings.

Public Member Functions

DescID Alloc (const BaseContainer &datadescription)
 
Bool Set (const DescID &descid, const BaseContainer &datadescription, BaseList2D *bl)
 
const BaseContainerFind (const DescID &descid)
 
Bool Remove (const DescID &descid)
 
Bool CopyTo (DynamicDescription *dest)
 
void * BrowseInit (void)
 
Bool BrowseGetNext (void *handle, DescID *id, const BaseContainer **data)
 
void BrowseFree (void *&handle)
 
Bool FillDefaultContainer (BaseContainer &res, Int32 type, const String &name)
 
UInt32 GetDirty () const
 

Private Member Functions

 DynamicDescription ()
 
 ~DynamicDescription ()
 

Constructor & Destructor Documentation

§ DynamicDescription()

DynamicDescription ( )
private

§ ~DynamicDescription()

~DynamicDescription ( )
private

Member Function Documentation

§ Alloc()

DescID Alloc ( const BaseContainer datadescription)

Allocates a new user data and return its ID.

Parameters
[in]datadescriptionThe settings of the new user data.
Returns
The ID of the new user data.

§ Set()

Bool Set ( const DescID descid,
const BaseContainer datadescription,
BaseList2D bl 
)

Inserts a new user data with the specified ID.

Parameters
[in]descidThe ID of the new user data.
[in]datadescriptionThe settings of the new user data.
[in]blTODO
Returns
true if the user data was inserted, otherwise false.

§ Find()

const BaseContainer* Find ( const DescID descid)

Finds user data settings from its description ID.

Parameters
[in]descidThe ID of the user data.
Returns
The found settings, or nullptr. The description owns the pointed base container.

§ Remove()

Bool Remove ( const DescID descid)

Removes user data by ID.

Parameters
[in]descidThe ID of the user data.
Returns
true if the user data was removed, otherwise false.

§ CopyTo()

Bool CopyTo ( DynamicDescription dest)

Copies the dynamic description.

Parameters
[in]destThe destination dynamic description. The caller owns the pointed dynamic description.
Returns
true if the description was copied, otherwise false.

§ BrowseInit()

void* BrowseInit ( void  )

Starts browsing the parameters linearly.

Warning
After browsing is done done BrowseFree() must be called.
Returns
The browse handle.

§ BrowseGetNext()

Bool BrowseGetNext ( void *  handle,
DescID id,
const BaseContainer **  data 
)

Retrieves the next parameter in a browse sequence initialized with BrowseInit().

Parameters
[in]handleThe browse handle returned by BrowseInit().
[out]idAssigned the ID of the retrieved parameter.
[out]dataAssigned the settings for the retrieved parameter. The caller owns the pointed base container.
Returns
true if a new parameter was retrieved, otherwise the sequence is finished.

§ BrowseFree()

void BrowseFree ( void *&  handle)

Frees browse handles from BrowseInit().

Parameters
[in,out]handleThe handle to free. Assigned nullptr.

§ FillDefaultContainer()

Bool FillDefaultContainer ( BaseContainer res,
Int32  type,
const String name 
)

Fills the default settings container for a certain data type with the specified name.

Parameters
[out]resAssigned the default settings.
[in]typeThe datatype ID. Either a custom ID or one of: DTYPE.
[in]nameThe name of the user data.
Returns
true if the settings were filled, otherwise false.

§ GetDirty()

UInt32 GetDirty ( ) const

Gets the dirty count. Can be used to check if something has changed.

Returns
The dirty counter, incremented when something changes in the system.