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>
|
DataPoolResource_t | m_eDataID |
| DataPool resource ID associated with this entry.
|
|
eC_TArray< CGUIValue > | m_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.
|
|
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().
◆ CDataPoolEntry()
CDataPoolEntry::CDataPoolEntry |
( |
const CGUIValue & |
kValue | ) |
|
|
protected |
Constructor
- Parameters
-
kValue | The value of the entry |
◆ AddObserver()
Overloaded AddObserver Implementation, so only DataPoolConnectors may be added/removed to this subject
- Parameters
-
pObserver | DataPoolconnector, which shall observe this DataPoolEntry |
◆ Get()
virtual 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
-
uiX | X - Index for which to set the value |
uiY | Y - Index for which to set the value |
- Returns
- the requested value
◆ GetID()
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] | uiX | X - Quantity |
[out] | uiY | Y - Quantity |
◆ OnNotification()
virtual 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
-
kValue | New value, which shall be set in the DataPoolEntry |
pkUpdatedObject | Object from which notification was triggered. (Can be NULL) |
uiX | X-Index for which to set the value |
uiY | Y-Index for which to set the value |
Reimplemented from CGUIObserver.
◆ operator=()
Copy constructor. Note that only the list of Subjects/Observers will be copied, but NOT the internal array of CGUIValues.
- Parameters
-
kDataPoolEntry | Where to copy from |
- Returns
- Where to copy to
◆ Set()
virtual 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
-
kValue | The new Value to set |
uiX | X-Index for which to set the value |
uiY | Y-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
-
pCallback | Pointer 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
-
uiX | New X Quantity |
uiY | New Y Quantity |
bPreserve | if set, the contents are retained as far as possible |
◆ CGUIDataPool
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 file: