Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUIDataPool Class Reference

#include <GUIDataPool.h>

Public Types

typedef eC_TListDoubleLinked< DataPoolResource_tDataIDList
 Convenience typedef for a list of DataPoolResource_t.
 

Static Public Member Functions

static void AddToNotificationQueue (CDataPoolEntry &kEntry)
 
static void Clear ()
 
static void DumpDataPool ()
 
static const eC_TListDoubleLinked< ObjectHandle_tGetAutoRegisteredObservers (const DataPoolResource_t eDataID)
 
static eC_UInt GetNOFDataPoolResources ()
 
static eC_UInt GetNumberOfPendingNotifications ()
 
static void ReadDataPoolFromFile (const eC_String &rkPath)
 
static void WriteDataPoolToFile (const eC_String &rkPath)
 
Data handling
static void Set (const DataPoolResource_t eDataID, CGUIValue kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
static void Get (const DataPoolResource_t eDataID, CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
static void SetDataPoolEntry (const DataPoolResource_t eDataID, CDataPoolEntry *pkEntry)
 
static void SetQuantity (const DataPoolResource_t eDataID, const eC_UInt uiX, const eC_UInt uiY, const eC_Bool &bPreserve=false)
 
static void GetQuantity (const DataPoolResource_t eDataID, eC_UInt &uiX, eC_UInt &uiY)
 
static void Get (const DataPoolResource_t eDataID, CDataPoolEntry **ppkEntry)
 
static void GetUpdate (CDataPoolConnector *pkObserver)
 
Locking mechanisms
static eC_Bool Lock ()
 
static eC_Bool Unlock ()
 
Management of DataPool entries
static void Register (const DataPoolResource_t eDataID, CGUIObject *pkObserver)
 
static void Register (const DataPoolResource_t eDataID, CDataPoolConnector *pkObserver)
 
static void Register (const DataPoolResource_t eDataID, DataPoolCallback pCallback)
 
static void UnregisterCallback (const DataPoolResource_t eDataID)
 
static void Unregister (const DataPoolResource_t eDataID, CGUIObject *pkObserver)
 
static void Unregister (const DataPoolResource_t eDataID, CDataPoolConnector *pkObserver)
 
static void Unregister (CGUIObject *pkObserver)
 
static void Unregister (CDataPoolConnector *pkObserver)
 
static void AutoRegister (const DataPoolResource_t eDataID, const ObjectHandle_t eObjectID)
 
static void RemoveAutoRegister (const DataPoolResource_t eDataID, const ObjectHandle_t eObjectID)
 
static DataPoolResource_t RegisterDynamicDataPoolResource ()
 

Friends

class CGUI
 
class CGUIObject
 

Detailed Description

DataPool implementation for Guiliani applications.

See also
DataPool

Member Function Documentation

◆ AddToNotificationQueue()

static void CGUIDataPool::AddToNotificationQueue ( CDataPoolEntry kEntry)
static

Adds the datapool entry to the list of pending notifications. Note that each DataPoolEntry gets notified only ONCE per GUI-cycle! This is required to avoid circular dependencies.

Parameters
kEntryDataPoolEntry for which a notification shall be triggered.

◆ AutoRegister()

static void CGUIDataPool::AutoRegister ( const DataPoolResource_t  eDataID,
const ObjectHandle_t  eObjectID 
)
static

Automatically registers an object ID to an entry within the DataPool. Whenever an object with this ID gets constructed, it will automatically be registered to the given DataPool entry.

Note
This will automatically perform a GETGUI.GetObjectByID(eObjectID) and thus register the first found object with this ID to eDataID.
Parameters
eDataIDID of entry within DataPool to which this ObjectID shall be automatically registered
eObjectIDID of object, which shall automatically be registered to eDataID upon construction.

◆ Clear()

static void CGUIDataPool::Clear ( )
static

Removes all registered DataPool observers and all entries within the list of auto-registered observers.

◆ DumpDataPool()

static void CGUIDataPool::DumpDataPool ( )
static

Dumps debugging information about the DataPool to the registered trace sinks. This is only available within debug builds.

◆ Get() [1/2]

static void CGUIDataPool::Get ( const DataPoolResource_t  eDataID,
CDataPoolEntry **  ppkEntry 
)
static

Gets the DataPoolEntry for the given DataID,

Parameters
eDataIDID of entry within the DataPool, which shall be returned
ppkEntryAddress of a pointer to a DataPoolEntry, which will be set to the found entry or to NULL if not found

◆ Get() [2/2]

static void CGUIDataPool::Get ( const DataPoolResource_t  eDataID,
CGUIValue kValue,
const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)
static

Gets the current value of the given DataPool entry. This API is threadsafe.

Parameters
eDataIDID of entry within the DataPool, which shall be returned
kValueReference to GUIValue, which will receive the current value of eDataID
uiXX-Index of value to get within eDataID (if it is a multidimensional DataPoolEntry)
uiYY-Index of value to get within eDataID (if it is a multidimensional DataPoolEntry)

◆ GetAutoRegisteredObservers()

static const eC_TListDoubleLinked< ObjectHandle_t > CGUIDataPool::GetAutoRegisteredObservers ( const DataPoolResource_t  eDataID)
static
Returns
A list of all Object IDs, which will be automatically registered to the given DataPool-entry upon their construction.
Parameters
eDataIDThe DataPool ID to query

◆ GetNOFDataPoolResources()

static eC_UInt CGUIDataPool::GetNOFDataPoolResources ( )
inlinestatic
Returns
Total number of DataPoolResources

◆ GetNumberOfPendingNotifications()

static eC_UInt CGUIDataPool::GetNumberOfPendingNotifications ( )
inlinestatic
Returns
The number of currently pending notifications, which will be processed during the next frame

◆ GetQuantity()

static void CGUIDataPool::GetQuantity ( const DataPoolResource_t  eDataID,
eC_UInt &  uiX,
eC_UInt &  uiY 
)
static

Returns the Quantity of the given DataPoolEntry. The quantity is the number of values, which is stored in the entry. It is stored as a two-dimensional array.

Parameters
eDataIDID of entry whose quantity shall be returned
uiXX Quantity
uiYY Quantity

◆ GetUpdate()

static void CGUIDataPool::GetUpdate ( CDataPoolConnector pkObserver)
static

Requests an immediate update for the given DataPoolConnector. All DataPoolEntries to which the DataPoolConnector is registered will trigger an OnNotification(CDataPoolEntry&) on pkObserver.

Parameters
pkObserverDataPoolConnectorwhich shall receive an update with the current values within the DataPool.

◆ Lock()

static eC_Bool CGUIDataPool::Lock ( )
inlinestatic

Locks the DataPool for thread-critical operations.

Returns
True if the DataPool was locked successfully, False otherwise.

◆ ReadDataPoolFromFile()

static void CGUIDataPool::ReadDataPoolFromFile ( const eC_String &  rkPath)
static

Reads the DataPool from a file. The DataPool file stores Object handles, which will be autoregistered to a given DataPool entry.

Parameters
rkPathFull filename (including path) of the file containing the data pool

◆ Register() [1/3]

static void CGUIDataPool::Register ( const DataPoolResource_t  eDataID,
CDataPoolConnector pkObserver 
)
static

Registers a DataPoolConnector to the data entry with the given ID. The CDataPoolConnector's OnNotification() method will be called if the data entry changes.

Parameters
eDataIDID of entry within the DataPool to which the given DataPoolConnector shall be registered.
pkObserverPointer to DataPoolConnector, which shall be registered to eDataID

◆ Register() [2/3]

static void CGUIDataPool::Register ( const DataPoolResource_t  eDataID,
CGUIObject pkObserver 
)
static

Registers an object to the data entry with the given ID. The object's SetValue() method will then automatically be called by the object's CGUIDataPoolConnector if the data entry changes.

Parameters
eDataIDID of entry within the DataPool to which the given object shall be registered.
pkObserverPointer to GUIObject, which shall be registered to eDataID

◆ Register() [3/3]

static void CGUIDataPool::Register ( const DataPoolResource_t  eDataID,
DataPoolCallback  pCallback 
)
static

Registers a Callback function within the DataPoolEntry for the given ID Note that only ONE callback function can be registered to any DataPool ID. Registering another callback will replace the previous one.

Parameters
eDataIDID of entry within the DataPool to which the given callback function shall be registered.
pCallbackfunction pointer to the callback, which shall be registered to eDataID

◆ RegisterDynamicDataPoolResource()

static DataPoolResource_t CGUIDataPool::RegisterDynamicDataPoolResource ( )
static

Creates a dynamic DataPool Entry and returns its ID.

Returns
ID of newly created entry within DataPool

◆ RemoveAutoRegister()

static void CGUIDataPool::RemoveAutoRegister ( const DataPoolResource_t  eDataID,
const ObjectHandle_t  eObjectID 
)
static

Removes a DataID from the Auto-Registry of the given ObjectID. Objects with this ObjectID will no longer be automatically registered to this DataID upon their construction.

Parameters
eDataIDID of entry within DataPool to which this ObjectID shall no longer be automatically registered
eObjectIDObjectID, which shall no longer be automatically registered to eDataID

◆ Set()

static void CGUIDataPool::Set ( const DataPoolResource_t  eDataID,
CGUIValue  kValue,
const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)
static

Sets the value of a DataPool entry. Setting a value in the Datapool will trigger a notification to all its observers during the next call to ProcessNotifications. This API is threadsafe.

Parameters
eDataIDID of entry within the DataPool, which shall be set
kValueNew value to of eDataID
uiXX-Index of value to be set within eDataID (if it is a multidimensional DataPoolEntry)
uiYY-Index of value to be set within eDataID (if it is a multidimensional DataPoolEntry)

◆ SetDataPoolEntry()

static void CGUIDataPool::SetDataPoolEntry ( const DataPoolResource_t  eDataID,
CDataPoolEntry pkEntry 
)
static

Sets a specific DataPoolEntry for the given DataPoolResource. This enables users to write custom DataPoolEntries, which e.g., read data from external data sources such as databases, or application specific data structures.

Parameters
eDataIDID of entry within the DataPool, which shall be set
pkEntryCustom DataPoolEntry to be assigned to eDataID

◆ SetQuantity()

static void CGUIDataPool::SetQuantity ( const DataPoolResource_t  eDataID,
const eC_UInt  uiX,
const eC_UInt  uiY,
const eC_Bool &  bPreserve = false 
)
static

Sets the Quantity of the given DataPoolEntry. The quantity is the number of values, which is stored in the entry. It is stored as a two-dimensional array.

Parameters
eDataIDID of entry whose quantity shall be set
uiXNew X Quantity
uiYNew Y Quantity
bPreserveif set the contents are retained as far as possible

◆ Unlock()

static eC_Bool CGUIDataPool::Unlock ( )
inlinestatic

Unlocks the DataPool after thread-critical operations.

Returns
True if the DataPool was unlocked successfully, False otherwise.

◆ Unregister() [1/4]

static void CGUIDataPool::Unregister ( CDataPoolConnector pkObserver)
static

Unregisters a DataPoolConnector from ALL Data entries.

Parameters
pkObserverPointer to DataPoolConnector, which shall be unregistered from all DataPoolEntries

◆ Unregister() [2/4]

static void CGUIDataPool::Unregister ( CGUIObject pkObserver)
static

Unregisters an object from ALL Data entries.

Parameters
pkObserverPointer to GUIObject, which shall be unregistered from all DataPoolEntries

◆ Unregister() [3/4]

static void CGUIDataPool::Unregister ( const DataPoolResource_t  eDataID,
CDataPoolConnector pkObserver 
)
static

Unregisters a DataPoolConnector to/from the data entry with the given ID.

Parameters
eDataIDID of entry within the DataPool from which the given DataPoolConnector shall be unregistered.
pkObserverPointer to DataPoolConnector, which shall be unregistered from eDataID

◆ Unregister() [4/4]

static void CGUIDataPool::Unregister ( const DataPoolResource_t  eDataID,
CGUIObject pkObserver 
)
static

Unregisters an object to/from the data entry with the given ID.

Parameters
eDataIDID of entry within the DataPool from which the given object shall be unregistered.
pkObserverPointer to GUIObject, which shall be unregistered from eDataID

◆ UnregisterCallback()

static void CGUIDataPool::UnregisterCallback ( const DataPoolResource_t  eDataID)
static

Unregisters the Callback function for the DataPoolEntry for the given ID.

Parameters
eDataIDID of entry within the DataPool for which the callback shall be unregistered.

◆ WriteDataPoolToFile()

static void CGUIDataPool::WriteDataPoolToFile ( const eC_String &  rkPath)
static

Writes the DataPool to a file. The DataPool file will contain the current Auto-Registry. All Object handles, which were registered to a DataPool entry through an earlier call to AutoRegister will be written to the DataPool file.

Parameters
rkPathFull filename (including path) of the file containing the data pool

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