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

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

Inheritance diagram for orxonox::ChatHistory:
orxonox::ChatListener orxonox::Singleton< ChatHistory > orxonox::Listable orxonox::Identifiable

Public Member Functions

 ChatHistory ()
 
virtual ~ChatHistory ()
 
void debug_printhist ()
 debug-print: output the whole history to stdout More...
 
virtual void incomingChat (const std::string &message, const std::string &name) override
 what to do with incoming chat More...
 
int syncLog ()
 Synchronize logfile onto the hard drive. More...
 
- Public Member Functions inherited from orxonox::ChatListener
 ChatListener ()
 
virtual ~ChatListener ()
 
- 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...
 

Private Member Functions

int chat_hist_addline (const std::string &toadd)
 Append line to chat history. More...
 
void chat_hist_closelog ()
 close logfile More...
 
int chat_hist_logline (const std::string &toadd)
 Append line to logfile. More...
 
int chat_hist_openlog ()
 open logfile to log to More...
 

Private Attributes

std::deque< std::string > hist_buffer
 Vector to store the history in. More...
 
bool hist_log_enabled
 is logging enabled? More...
 
std::ofstream hist_logfile
 Output file stream for logfile. More...
 
std::string hist_logfile_path
 path of logfile on the file system More...
 
unsigned int hist_maxlines
 Maximum number of lines stored in this history. More...
 

Static Private Attributes

static ChatHistorysingletonPtr_s
 

Friends

class Singleton< ChatHistory >
 

Additional Inherited Members

- Static Public Member Functions inherited from orxonox::Singleton< ChatHistory >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static ChatHistorygetInstance ()
 Returns a reference to the singleton instance. More...
 
- Protected Member Functions inherited from orxonox::Singleton< ChatHistory >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Constructor & Destructor Documentation

orxonox::ChatHistory::ChatHistory ( )
orxonox::ChatHistory::~ChatHistory ( )
virtual

Member Function Documentation

int orxonox::ChatHistory::chat_hist_addline ( const std::string &  toadd)
private

Append line to chat history.

Parameters
toaddThe line to add to the history
Returns
0 for success, other for error TODO: Throw exception
void orxonox::ChatHistory::chat_hist_closelog ( )
private

close logfile

int orxonox::ChatHistory::chat_hist_logline ( const std::string &  toadd)
private

Append line to logfile.

Parameters
toaddThe line to add to the logfile
Returns
0 for success, other for error TODO: Throw exception
int orxonox::ChatHistory::chat_hist_openlog ( )
private

open logfile to log to

Returns
0 for success,s other for error
void orxonox::ChatHistory::debug_printhist ( )

debug-print: output the whole history to stdout

void orxonox::ChatHistory::incomingChat ( const std::string &  message,
const std::string &  name 
)
overridevirtual

what to do with incoming chat

Parameters
messageThe incoming message
nameName of the sender

Implements orxonox::ChatListener.

int orxonox::ChatHistory::syncLog ( )

Synchronize logfile onto the hard drive.

Returns
0 for success, other for error

Friends And Related Function Documentation

friend class Singleton< ChatHistory >
friend

Member Data Documentation

std::deque<std::string> orxonox::ChatHistory::hist_buffer
private

Vector to store the history in.

bool orxonox::ChatHistory::hist_log_enabled
private

is logging enabled?

std::ofstream orxonox::ChatHistory::hist_logfile
private

Output file stream for logfile.

std::string orxonox::ChatHistory::hist_logfile_path
private

path of logfile on the file system

unsigned int orxonox::ChatHistory::hist_maxlines
private

Maximum number of lines stored in this history.

ChatHistory* orxonox::ChatHistory::singletonPtr_s
staticprivate

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