CMS 3D CMS Logo

MessageDispatcher Class Reference

#include <DQM/TrackerCommon/interface/MessageDispatcher.h>

List of all members.

Public Member Functions

void add (Message *new_message)
void add (Message *new_message)
void dispatchMessages (xgi::Output *out)
void dispatchMessages (xgi::Output *out)
bool hasAnyMessages ()
bool hasAnyMessages ()
 MessageDispatcher ()
 MessageDispatcher ()

Private Attributes

std::vector< Message * > undispatched
std::vector< Message * > undispatched


Detailed Description

Definition at line 38 of file MessageDispatcher.h.


Constructor & Destructor Documentation

MessageDispatcher::MessageDispatcher (  )  [inline]

Definition at line 47 of file MessageDispatcher.h.

00048     {
00049     }

MessageDispatcher::MessageDispatcher (  )  [inline]

Definition at line 47 of file MessageDispatcher.h.

00048     {
00049     }


Member Function Documentation

void MessageDispatcher::add ( Message new_message  )  [inline]

Definition at line 51 of file MessageDispatcher.h.

References undispatched.

00052     {
00053       undispatched.push_back(new_message);
00054     }

void MessageDispatcher::add ( Message new_message  )  [inline]

Definition at line 51 of file MessageDispatcher.h.

References undispatched.

Referenced by WebInterface::sendMessage().

00052     {
00053       undispatched.push_back(new_message);
00054     }

void MessageDispatcher::dispatchMessages ( xgi::Output *  out  ) 

void MessageDispatcher::dispatchMessages ( xgi::Output *  out  ) 

Definition at line 11 of file MessageDispatcher.cc.

References lat::endl(), i, it, and undispatched.

Referenced by WebInterface::handleRequest().

00012 {
00013   out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
00014   
00015   *out << "<?xml version=\"1.0\" ?>" << std::endl;
00016    
00017   *out << "<Messages>" << std::endl;
00018   
00019   int i = 1;
00020   std::vector<Message *>::iterator it;
00021   for (it = undispatched.begin(); it != undispatched.end(); it++)
00022     {
00023       *out << "<Message"  << i << ">" << std::endl;
00024       
00025       *out << "<Type>"  << (*it)->getType()  << "</Type>"  << std::endl;
00026       *out << "<Title>" << (*it)->getTitle() << "</Title>" << std::endl;
00027       *out << "<Text>"  << (*it)->getText()  << "</Text>"  << std::endl;
00028       
00029       *out << "</Message" << i << ">" << std::endl;
00030 
00031       i++;
00032     }
00033   
00034   *out << "</Messages>" << std::endl;
00035 
00036   undispatched.clear();
00037 }

bool MessageDispatcher::hasAnyMessages (  )  [inline]

Definition at line 56 of file MessageDispatcher.h.

References undispatched.

00057     { 
00058       return (!undispatched.empty()); 
00059     }

bool MessageDispatcher::hasAnyMessages (  )  [inline]

Definition at line 56 of file MessageDispatcher.h.

References undispatched.

Referenced by WebInterface::handleRequest().

00057     { 
00058       return (!undispatched.empty()); 
00059     }


Member Data Documentation

std::vector<Message *> MessageDispatcher::undispatched [private]

Definition at line 43 of file MessageDispatcher.h.

std::vector<Message *> MessageDispatcher::undispatched [private]

Definition at line 43 of file MessageDispatcher.h.

Referenced by add(), dispatchMessages(), and hasAnyMessages().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:14 2009 for CMSSW by  doxygen 1.5.4