Global class which accepts messages from different threads and sends them to different receivers. More...
#include <MessageHandler.hh>
Classes | |
class | Messenger |
struct | MsgData |
class | PrintToStream |
A useful message function for cout, fstream. More... | |
class | VMessenger |
Public Member Functions | |
void | End () |
Finish with messages, so you can print help dialogues to cout. | |
void | Post (std::ostringstream *mgs, MESSAGE_LEVEL level) |
This handles incoming Messages. | |
template<class MsgAction > | |
void * | AddMessenger (MESSAGE_LEVEL thresh, MsgAction act) |
Allow the user to change message delivery; returns id of new Messenger. | |
void | RemoveMessenger (void *m) |
Remove an already registered messenger. | |
void | SetThreshold (MESSAGE_LEVEL thresh, void *messenger=0) |
Set the severity threshold for which messages to print. | |
void | UpdateThreshold () |
Update the severity threshold if changed in config file. | |
MESSAGE_LEVEL | GetDefaultMessageThreshold () |
Get the default message threshold. | |
void | operator() () |
should only be called by a boost thread | |
Static Public Member Functions | |
static MessageHandler * | GetInstance () |
Singleton access. | |
Private Member Functions | |
MessageHandler (const MessageHandler &) | |
MessageHandler & | operator= (const MessageHandler &) |
void | Deliver (std::ostringstream *msg, MESSAGE_LEVEL level, time_t t=time(0)) |
Private Attributes | |
std::set< VMessenger * > | _messengers |
MESSAGE_LEVEL | _default_threshold |
std::queue< MsgData > | _inbox |
bool | _kill_thread |
boost::mutex * | _inbox_mutex |
boost::condition_variable * | _message_waiting |
boost::thread * | _delivery_thread |
Static Private Attributes | |
static MessageHandler | _instance |
Global class which accepts messages from different threads and sends them to different receivers.
Definition at line 53 of file MessageHandler.hh.