Guiliani  Version 2.4 revision 5970 (build 3)
CDataPoolEntry Class Reference

A single entry in the DataPool. The DataPoolEntry class represents a single entry (unique id + a value/array of values) within the DataPool. DataPoolEntries are observed by DataPoolConnectors and will be notified of changes to the DataPoolConnector via the OnNotification(value, object, x, y) interface. In the opposite direction, a DataPooolEntry notifies its observers by calling their OnNotification(DataPoolEntry) interfaces. More...

#include <GUIDataPool.h>

Inheritance diagram for CDataPoolEntry:

Public Member Functions

virtual const CGUIValueGet (const eC_UInt uiX=0, const eC_UInt uiY=0)
 
DataPoolResource_t GetID () const
 
void GetQuantity (eC_UInt &uiX, eC_UInt &uiY)
 
- Public Member Functions inherited from CGUIObserver
 CGUIObserver ()
 Default constructor.
 
virtual ~CGUIObserver ()
 Default destructor. Notifies all subjects of destruction.
 
const eC_TListDoubleLinked< CGUISubject * > & GetSubjectList () const
 
virtual void OnNotification ()
 Called by CGUISubject whenever an observed object triggers an update.
 
virtual void OnNotification (const eC_String &kMessage)
 
virtual void OnNotification (const CGUIObject *const pkUpdatedObject)
 
void SetAutoDelete (const eC_Bool bAutoDelete)
 
- Public Member Functions inherited from CGUISubject
 CGUISubject ()
 Default constructor.
 
virtual ~CGUISubject ()
 Default destructor.
 
void AddObserver (CGUIObserver *pObserver)
 
void ClearObservers ()
 Removes all observers from the internal list.
 
const eC_TListDoubleLinked< CGUIObserver * > & GetObserverList () const
 
void NotifyObservers ()
 
void NotifyObservers (const eC_String &kMessage)
 
void NotifyObservers (const CGUIObject *const pkUpdatedObject)
 
void NotifyObservers (const CGUIValue &kObservedValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
void RemoveObserver (CGUIObserver *pObserver)
 

Protected Member Functions

 CDataPoolEntry ()
 Default constructor.
 
 CDataPoolEntry (const CGUIValue &kValue)
 
virtual ~CDataPoolEntry ()
 protected Destructor: only friend class CGUIDataPool is allowed to delete DataPoolEntries
 
void AddObserver (CDataPoolConnector *pObserver)
 
void NotifyDataPoolConnectors ()
 Call OnNotification(CDataPoolEntry&) on observing DataPoolConnectors and call registered callback function.
 
virtual void OnNotification (const CGUIValue &kValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
virtual CDataPoolEntryoperator= (const CDataPoolEntry &kDataPoolEntry)
 
virtual void Set (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
void SetCallback (DataPoolCallback pCallback)
 
void SetQuantity (const eC_UInt uiX, const eC_UInt uiY, const eC_Bool &bPreserve=false)
 
- Protected Member Functions inherited from CGUIObserver
virtual void AddSubject (CGUISubject *pSubjectToAdd)
 
virtual void RemoveSubject (CGUISubject *pSubjectToRemove)
 

Protected Attributes

DataPoolResource_t m_eDataID
 DataPool resource ID associated with this entry.
 
eC_TArray< CGUIValuem_kValue
 Internal array of GUIValues.
 
DataPoolCallback m_pDataPoolCallback
 Callback function, which will be called within NotifyDataPoolConnectors.
 
eC_UInt m_uiMaxX
 Maximum X-Size of internal array.
 
eC_UInt m_uiMaxY
 Maximum Y-Size of internal array.
 

Friends

class CGUIDataPool
 Declare CGUIDataPool as friend, so only it may set DataPoolResource_t and delete DataPool entries. More...
 

Detailed Description

A single entry in the DataPool. The DataPoolEntry class represents a single entry (unique id + a value/array of values) within the DataPool. DataPoolEntries are observed by DataPoolConnectors and will be notified of changes to the DataPoolConnector via the OnNotification(value, object, x, y) interface. In the opposite direction, a DataPooolEntry notifies its observers by calling their OnNotification(DataPoolEntry) interfaces.

Attention
Instances of CDataPoolEntry may only be accessed from the GUI-Thread and all operations must be guarded by locking the DataPool via CGUIDataPool::Lock() and CGUIDataPool::Unlock().

Constructor & Destructor Documentation

◆ CDataPoolEntry()

CDataPoolEntry::CDataPoolEntry ( const CGUIValue kValue)
protected

Constructor

Parameters
kValueThe value of the entry

Member Function Documentation

◆ AddObserver()

void CDataPoolEntry::AddObserver ( CDataPoolConnector pObserver)
inlineprotected

Overloaded AddObserver Implementation, so only DataPoolConnectors may be added/removed to this subject

Parameters
pObserverDataPoolconnector, which shall observe this DataPoolEntry

◆ Get()

const CGUIValue & CDataPoolEntry::Get ( const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)
virtual

Gets the value from the internal value-array at the given indices

Parameters
uiXX - Index for which to set the value
uiYY - Index for which to set the value
Returns
the requested value

◆ GetID()

DataPoolResource_t CDataPoolEntry::GetID ( ) const
inline

Returns the associated DataPool resource ID

Returns
associated DataPool resource ID

◆ GetQuantity()

void CDataPoolEntry::GetQuantity ( eC_UInt &  uiX,
eC_UInt &  uiY 
)
inline

Gets the maximum quantity of the internal array of CGUIValues

Parameters
[out]uiXX - Quantity
[out]uiYY - Quantity

◆ OnNotification()

void CDataPoolEntry::OnNotification ( const CGUIValue kValue,
const CGUIObject *const  pkUpdatedObject,
const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)
protectedvirtual

Notification slot, which is called by associated Subjects (e.g. objects within the GUI) when their value changes. The default implementation locks the DataPool, calls Set(kValue, uiX, uiY). and unlocks the DataPool again.

Parameters
kValueNew value, which shall be set in the DataPoolEntry
pkUpdatedObjectObject from which notification was triggered. (Can be NULL)
uiXX-Index for which to set the value
uiYY-Index for which to set the value

Reimplemented from CGUIObserver.

◆ operator=()

CDataPoolEntry & CDataPoolEntry::operator= ( const CDataPoolEntry kDataPoolEntry)
protectedvirtual

Copy constructor. Note that only the list of Subjects/Observers will be copied, but NOT the internal array of CGUIValues.

Parameters
kDataPoolEntryWhere to copy from
Returns
Where to copy to

◆ Set()

void CDataPoolEntry::Set ( const CGUIValue kValue,
const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)
protectedvirtual

Sets the value in the internal value-array at the given indices. When overriding this method, make sure to notify the DataPool about changed values via CGUIDataPool::AddToNotificationQueue(*this) Also make sure to update values only if they have actually changed either in value or type.

Parameters
kValueThe new Value to set
uiXX-Index for which to set the value
uiYY-Index for which to set the value

◆ SetCallback()

void CDataPoolEntry::SetCallback ( DataPoolCallback  pCallback)
inlineprotected

Register a callback function with this DataPoolEntry, which will be notified along with all observers.

Parameters
pCallbackPointer to callback function of type DataPoolCallback

◆ SetQuantity()

void CDataPoolEntry::SetQuantity ( const eC_UInt  uiX,
const eC_UInt  uiY,
const eC_Bool &  bPreserve = false 
)
protected

Sets the maximum quantity of the internal array of CGUIValues. The quantity is the number of values, which is stored in the entry. It is stored as a two-dimensional array.

Note
The entries former content will be deleted by this operation.
Parameters
uiXNew X Quantity
uiYNew Y Quantity
bPreserveif set, the contents are retained as far as possible

Friends And Related Function Documentation

◆ CGUIDataPool

friend class CGUIDataPool
friend

Declare CGUIDataPool as friend, so only it may set DataPoolResource_t and delete DataPool entries.


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