Orxonox: orxonox::Notification Class Reference

# orxonox::Notification Class Reference

A Notification is a short message used to inform the player about something that just happened. A Notification can be sent from any part of orxonox and is then displayed in the proper NotificationQueue (depending on which senders the specific NotificationQueue accepts). More...

`#include <src/orxonox/overlays/notifications/Notification.h>`

Inheritance diagram for orxonox::Notification:

List of all members.

## Public Member Functions

const std::string & | getMessage (void) const
| Returns the message of the Notification.
const std::string & | getSender (void) const
bool | isSent (void) const
| Checks whether the Notification was sent.
| Notification (const std::string &message)
| Constructor. Creates a Notification with the input message.
| Notification (BaseObject *creator)
| Default constructor. Initializes the object.
bool | send (const std::string &sender)
| Sends the Notification to the Notificationmanager.
bool | send (void)
| Sends the Notification to the Notificationmanager, with sender NotificationManager::NONE;.
bool | setMessage (const std::string &message)
| Sets the message of the notification.
virtual | ~Notification ()
| Destructor.

## Private Member Functions

void | initialize (void)
| Registers the object and sets some default values.

## Private Attributes

std::string | message_
| The Notification message.
std::string | sender_
| The sender of the notification.
bool | sent_
| Whether Notification has been sent, if so it cannot be changed.

## Detailed Description

A Notification is a short message used to inform the player about something that just happened. A Notification can be sent from any part of orxonox and is then displayed in the proper NotificationQueue (depending on which senders the specific NotificationQueue accepts).

Author:
  Damian 'Mozork' Frick

## Constructor & Destructor Documentation

orxonox::Notification::Notification | ( | BaseObject * | creator | ) |

Default constructor. Initializes the object.

References initialize(), and RegisterObject.

orxonox::Notification::Notification | ( | const std::string & | message | ) |

Constructor. Creates a Notification with the input message.

Parameters:

  | message | The message of the Notification.

References message_.

orxonox::Notification::~Notification | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

const std::string& orxonox::Notification::getMessage | ( | void |  | ) | const`[inline]`

Returns the message of the Notification.

Returns:
  Returns the message of the Notification.

Referenced by orxonox::NotificationOverlay::processNotification(), and send().

const std::string& orxonox::Notification::getSender | ( | void |  | ) | const`[inline]`

Referenced by orxonox::NotificationManager::registerNotification().

void orxonox::Notification::initialize | ( | void |  | ) | `[private]`

Registers the object and sets some default values.

Reimplemented in orxonox::QuestNotification.

References message_, orxonox::NotificationManager::NONE, sender_, and sent_.

Referenced by Notification().

bool orxonox::Notification::isSent | ( | void |  | ) | const`[inline]`

Checks whether the Notification was sent.

Returns:
  Returns true if the Notification was sent already.

Referenced by setMessage().

bool orxonox::Notification::send | ( | const std::string & | sender | ) |

Sends the Notification to the Notificationmanager.

Sends the Notification to the Notificationmanager, which then in turn distributes it to the different NotificationQueues.

Parameters:

  | sender | The sender the Notification was sent by. Used by the NotificationManager to distributes the notification to the correct NotificationQueues.

Returns:
  Returns true if successful.

References COUT, orxonox::NotificationManager::getInstance(), getMessage(), orxonox::NotificationManager::registerNotification(), sender_, and sent_.

bool orxonox::Notification::send | ( | void |  | ) |

Sends the Notification to the Notificationmanager, with sender NotificationManager::NONE;.

Sends the Notification to the Notificationmanager, with sender NetificationManager::NONE.

Returns:
  Returns true if successful.

Reimplemented in orxonox::QuestNotification.

References orxonox::NotificationManager::NONE.

Referenced by orxonox::QuestNotification::send().

bool orxonox::Notification::setMessage | ( | const std::string & | message | ) |

Sets the message of the notification.

Parameters:

  | message | The message to be set.

Returns:
  Returns true if successful.

< The message cannot be changed if the message has already been sent.

References isSent(), and message_.

## Member Data Documentation

std::string orxonox::Notification::message_`[private]`

The Notification message.

Referenced by initialize(), Notification(), and setMessage().

std::string orxonox::Notification::sender_`[private]`

The sender of the notification.

Referenced by initialize(), and send().

bool orxonox::Notification::sent_`[private]`

Whether Notification has been sent, if so it cannot be changed.

Referenced by initialize(), and send().

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

- src/orxonox/overlays/notifications/Notification.h
- src/orxonox/overlays/notifications/Notification.cc