CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MessageDispatcher.h
Go to the documentation of this file.
1 #ifndef _DQM_TrackerCommon_MessageDispatcher_h_
2 #define _DQM_TrackerCommon_MessageDispatcher_h_
3 
4 #include <vector>
5 #include <string>
6 
7 #include "xgi/Utils.h"
8 #include "xgi/Method.h"
9 
10 
11 enum MessageType { info = 0, warning = 1, error = 2 };
12 
13 
14 class Message
15 {
16 
17  private:
18 
22 
23  public:
24 
25  Message(std::string the_title, std::string the_text, MessageType the_type)
26  {
27  type = the_type;
28  title = the_title;
29  text = the_text;
30  }
31 
32  std::string getTitle() { return title; }
33  std::string getText() { return text; }
35 };
36 
37 
39 {
40 
41  private:
42 
43  std::vector<Message *> undispatched;
44 
45  public:
46 
48  {
49  }
50 
51  void add(Message *new_message)
52  {
53  undispatched.push_back(new_message);
54  }
55 
57  {
58  return (!undispatched.empty());
59  }
60 
62 
63 };
64 
65 #endif
MessageType
std::vector< Message * > undispatched
type
Definition: HCALResponse.h:21
std::string getText()
Message(std::string the_title, std::string the_text, MessageType the_type)
std::string getType()
MessageType type
void dispatchMessages(xgi::Output *out)
void add(Message *new_message)
std::string text
tuple out
Definition: dbtoconf.py:99
std::string getTitle()
std::string title
#define Output(cl)
Definition: vmac.h:193