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

Subject Base class for Observer-Design-Pattern within Guiliani. More...

#include <GUISubject.h>

Inheritance diagram for CGUISubject:

Public Member Functions

 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 CGUIObject *const pkUpdatedObject)
 
void NotifyObservers (const CGUIValue &kObservedValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
void NotifyObservers (const eC_String &kMessage)
 
void RemoveObserver (CGUIObserver *pObserver)
 

Friends

class CGUIObserver
 

Detailed Description

Subject Base class for Observer-Design-Pattern within Guiliani.

Use this base class if you wish to follow the observer-design-pattern within your application. Simply derive the class that you want to act as a subject from CGUISubject and whenever you want to inform any potential observers about changes within your object, call NotifyObservers(). The AddObserver() and RemoveObserver() methods are used only to handle the list of objects observing your subject and do not need to be overridden in your derived class.

Member Function Documentation

◆ AddObserver()

void CGUISubject::AddObserver ( CGUIObserver pObserver)

Adds an observer to the internal observer list. The observer will be notified whenever the subject triggers an update.

Parameters
pObserverThe observer to add.

◆ GetObserverList()

const eC_TListDoubleLinked< CGUIObserver * > & CGUISubject::GetObserverList ( ) const
inline
Returns
The list of all observers that are currently observing this subject.

◆ NotifyObservers() [1/4]

void CGUISubject::NotifyObservers ( )

Triggers notification of all registered observers. CGUIObserver::OnNotification() will be called for each.

◆ NotifyObservers() [2/4]

void CGUISubject::NotifyObservers ( const CGUIObject *const  pkUpdatedObject)

Triggers notification of all registered observers. CGUIObserver::OnNotification(const CGUIObject* const) will be called for each.

Parameters
pkUpdatedObjectWill be passed to CGUIObserver::OnNotification(const CGUIObject* const)

◆ NotifyObservers() [3/4]

void CGUISubject::NotifyObservers ( const CGUIValue kObservedValue,
const CGUIObject *const  pkUpdatedObject,
const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)

Triggers notification of all registered observers. CGUIObserver::OnNotification(const CGUIValue&, const CGUIObject* const, const eC_UInt, const eC_UInt) will be called for each.

Parameters
kObservedValuethe updated value
pkUpdatedObjectthe updated object (can be NULL)
uiXX-Index of value to be set in case the updated value is part of a multidimensional array
uiYY-Index of value to be set in case the updated value is part of a multidimensional array

◆ NotifyObservers() [4/4]

void CGUISubject::NotifyObservers ( const eC_String &  kMessage)

Triggers notification of all registered observers. CGUIObserver::OnNotification(const eC_String&) will be called for each.

Parameters
kMessageWill be passed to CGUIObserver::OnNotification(const eC_String&)

◆ RemoveObserver()

void CGUISubject::RemoveObserver ( CGUIObserver pObserver)

Removes a registered observer from the internal observer list.

Parameters
pObserverThe observer to remove.

Friends And Related Function Documentation

◆ CGUIObserver

friend class CGUIObserver
friend

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