xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Events::NotificationManager Class Reference

The notification manager, handling all notifications. More...

#include <notifications.h>

Inheritance diagram for Events::NotificationManager:
Inheritance graph
[legend]
Collaboration diagram for Events::NotificationManager:
Collaboration graph
[legend]

Public Member Functions

 NotificationManager ()
 
 ~NotificationManager ()
 
void init ()
 
void resized (int oldWidth, int oldHeight, int newWidth, int newHeight)
 Notify all Notifyables that the screen size changed. More...
 
void cameraMoved ()
 Notify all Notifyables that the camera moved. More...
 

Private Member Functions

std::list< Notifyable * >::iterator registerNotifyable (Notifyable &notifyable)
 
void unregisterNotifyable (const std::list< Notifyable *>::iterator &it)
 

Private Attributes

Common::Mutex _mutex
 
std::list< Notifyable * > _notifyables
 

Friends

class Notifyable
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< NotificationManager >
static NotificationManager & instance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< NotificationManager >
typedef NotificationManager SingletonBaseType
 
- Protected Member Functions inherited from Common::Singleton< NotificationManager >
 Singleton ()
 
virtual ~Singleton ()
 

Detailed Description

The notification manager, handling all notifications.

Notifications are handed out to all classes of the Notifyable type for special backend code that need to be reacted to by the client game code.

One example would be a change in the display resolution: GUI elements with an affinity to a screen edge or corner need to told that this change occurred, so that they can reposition themselves to the new coordinates.

Definition at line 49 of file notifications.h.

Constructor & Destructor Documentation

◆ NotificationManager()

Events::NotificationManager::NotificationManager ( )

Definition at line 32 of file notifications.cpp.

◆ ~NotificationManager()

Events::NotificationManager::~NotificationManager ( )

Definition at line 35 of file notifications.cpp.

Member Function Documentation

◆ cameraMoved()

void Events::NotificationManager::cameraMoved ( )

Notify all Notifyables that the camera moved.

Definition at line 62 of file notifications.cpp.

References _mutex, and _notifyables.

◆ init()

void Events::NotificationManager::init ( )

Definition at line 38 of file notifications.cpp.

◆ registerNotifyable()

std::list< Notifyable * >::iterator Events::NotificationManager::registerNotifyable ( Notifyable notifyable)
private

Definition at line 41 of file notifications.cpp.

References _mutex, and _notifyables.

◆ resized()

void Events::NotificationManager::resized ( int  oldWidth,
int  oldHeight,
int  newWidth,
int  newHeight 
)

Notify all Notifyables that the screen size changed.

Definition at line 55 of file notifications.cpp.

References _mutex, and _notifyables.

◆ unregisterNotifyable()

void Events::NotificationManager::unregisterNotifyable ( const std::list< Notifyable *>::iterator &  it)
private

Definition at line 49 of file notifications.cpp.

References _mutex, and _notifyables.

Friends And Related Function Documentation

◆ Notifyable

friend class Notifyable
friend

Definition at line 69 of file notifications.h.

Member Data Documentation

◆ _mutex

Common::Mutex Events::NotificationManager::_mutex
private

Definition at line 62 of file notifications.h.

Referenced by cameraMoved(), registerNotifyable(), resized(), and unregisterNotifyable().

◆ _notifyables

std::list<Notifyable *> Events::NotificationManager::_notifyables
private

Definition at line 64 of file notifications.h.

Referenced by cameraMoved(), registerNotifyable(), resized(), and unregisterNotifyable().


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