DynamicDescription Class Reference Library » 描述

#include <lib_description.h>

详细描述

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

注意
使用 EditDescription() to let the user edit the container settings.

公共成员函数

DescID   Alloc (const BaseContainer &datadescription)
Bool   Set (const DescID &descid, const BaseContainer &datadescription, BaseList2D *bl)
const BaseContainer Find (const DescID &descid)
Bool   移除 (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

私有成员函数

  DynamicDescription ()
  ~DynamicDescription ()

构造函数 & 析构函数文档编制

◆  DynamicDescription()

DynamicDescription () private

◆  ~DynamicDescription()

~ DynamicDescription () private

成员函数文档编制

◆  Alloc()

DescID Alloc ( const BaseContainer datadescription )

Allocates a new user data and return its ID.

参数
[in] datadescription The settings of the new user data.
返回
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.

参数
[in] descid The ID of the new user data.
[in] datadescription The settings of the new user data.
[in] bl TODO
返回
true if the user data was inserted, otherwise false .

◆  Find()

const BaseContainer * Find ( const DescID descid )

Finds user data settings from its description ID.

参数
[in] descid The ID of the user data.
返回
The found settings, or nullptr . The description owns the pointed base container.

◆  Remove()

Bool 移除 ( const DescID descid )

Removes user data by ID.

参数
[in] descid The ID of the user data.
返回
true if the user data was removed, otherwise false .

◆  CopyTo()

Bool CopyTo ( DynamicDescription dest )

Copies the dynamic description.

参数
[in] dest The destination dynamic description. The caller owns the pointed dynamic description.
返回
true if the description was copied, otherwise false .

◆  BrowseInit()

void* BrowseInit ( void  )

Starts browsing the parameters linearly.

警告
After browsing is done done BrowseFree() must be called.
返回
The browse handle.

◆  BrowseGetNext()

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

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

参数
[in] handle The browse handle returned by BrowseInit() .
[out] id Assigned the ID of the retrieved parameter.
[out] data Assigned the settings for the retrieved parameter. The caller owns the pointed base container.
返回
true if a new parameter was retrieved, otherwise the sequence is finished.

◆  BrowseFree()

void BrowseFree ( void *&  handle )

Frees browse handles from BrowseInit() .

参数
[in,out] handle The 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 .

参数
[out] res Assigned the default settings.
[in] type The datatype ID. Either a custom ID or one of: DTYPE .
[in] name The name of the user data.
返回
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.

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