CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MessageDispatcher.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 std::string Message::getType()
5 {
6  if (type == info) { return "INFO"; }
7  else if (type == warning) { return "WARNING"; }
8  else { return "ERROR"; }
9 }
10 
12 {
13  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
14 
15  *out << "<?xml version=\"1.0\" ?>" << std::endl;
16 
17  *out << "<Messages>" << std::endl;
18 
19  int i = 1;
20  std::vector<Message *>::iterator it;
21  for (it = undispatched.begin(); it != undispatched.end(); it++)
22  {
23  *out << "<Message" << i << ">" << std::endl;
24 
25  *out << "<Type>" << (*it)->getType() << "</Type>" << std::endl;
26  *out << "<Title>" << (*it)->getTitle() << "</Title>" << std::endl;
27  *out << "<Text>" << (*it)->getText() << "</Text>" << std::endl;
28 
29  *out << "</Message" << i << ">" << std::endl;
30 
31  i++;
32  }
33 
34  *out << "</Messages>" << std::endl;
35 
36  undispatched.clear();
37 }
std::vector< Message * > undispatched
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
std::string getType()
void dispatchMessages(xgi::Output *out)
tuple out
Definition: dbtoconf.py:99
#define Output(cl)
Definition: vmac.h:193