Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Friends | List of all members
orxonox::ChatManager Class Reference

This class collects and distributes chat messages. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/chat/ChatManager.h>

Inheritance diagram for orxonox::ChatManager:
orxonox::Singleton< ChatManager > orxonox::NetworkChatListener orxonox::Listable orxonox::Identifiable

Public Member Functions

 ChatManager ()
 
virtual ~ChatManager ()=default
 
- Public Member Functions inherited from orxonox::NetworkChatListener
 NetworkChatListener ()
 
virtual ~NetworkChatListener ()
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Static Public Member Functions

static void chat (const std::string &message, unsigned int targetID=NETWORK_PEER_ID_BROADCAST)
 Sends a chat message with the client as its sender to the chat. More...
 
static void message (const std::string &message, unsigned int targetID=NETWORK_PEER_ID_BROADCAST)
 Sends a message (usually gameplay related) without explicit sender to the chat. More...
 
- Static Public Member Functions inherited from orxonox::Singleton< ChatManager >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static ChatManagergetInstance ()
 Returns a reference to the singleton instance. More...
 

Protected Member Functions

 ChatManager (const ChatManager &)=delete
 
virtual void incomingChat (const std::string &message, unsigned int sourceID) override
 Inherited callback from NetworkChatListener, but gets also called directly by ChatManager itself if the client is offline. More...
 
ChatManageroperator= (const ChatManager &)=delete
 
- Protected Member Functions inherited from orxonox::Singleton< ChatManager >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Static Protected Attributes

static ChatManagersingletonPtr_s
 

Friends

class Singleton< ChatManager >
 

Detailed Description

This class collects and distributes chat messages.

If the client is online, all chat messages are sent and received through the network. Otherwise chat is handled directly by this class.

Constructor & Destructor Documentation

orxonox::ChatManager::ChatManager ( )
virtual orxonox::ChatManager::~ChatManager ( )
virtualdefault
orxonox::ChatManager::ChatManager ( const ChatManager )
protecteddelete

Member Function Documentation

void orxonox::ChatManager::chat ( const std::string &  message,
unsigned int  targetID = NETWORK_PEER_ID_BROADCAST 
)
static

Sends a chat message with the client as its sender to the chat.

Parameters
messageThe message
targetIDThe client ID (network) of the receiver. Usually the broadcast ID
void orxonox::ChatManager::incomingChat ( const std::string &  message,
unsigned int  sourceID 
)
overrideprotectedvirtual

Inherited callback from NetworkChatListener, but gets also called directly by ChatManager itself if the client is offline.

Distributes an incoming chat message to all ChatListeners.

Parameters
messageThe message
sourceIDThe client ID (network) of the sender

Implements orxonox::NetworkChatListener.

void orxonox::ChatManager::message ( const std::string &  message,
unsigned int  targetID = NETWORK_PEER_ID_BROADCAST 
)
static

Sends a message (usually gameplay related) without explicit sender to the chat.

Parameters
messageThe message
targetIDThe client ID (network) of the receiver. Usually the broadcast ID
ChatManager& orxonox::ChatManager::operator= ( const ChatManager )
protecteddelete

Friends And Related Function Documentation

friend class Singleton< ChatManager >
friend

Member Data Documentation

ChatManager* orxonox::ChatManager::singletonPtr_s
staticprotected

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