| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Message.h
Go to the documentation of this file.
1 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/Message.h,v 1.5 2008/02/20 19:16:23 hmd Exp $
2 #ifndef GAUDIKERNEL_MESSAGE_H
3 #define GAUDIKERNEL_MESSAGE_H
4
5 #include <string>
6 #include <iostream>
7
15 class GAUDI_API Message {
16 public:
18 Message();
19
21 Message ( const char* src, int type, const char* msg );
22
24 Message ( const std::string& src, int type, const std::string& msg );
25
27 ~Message() {}
28
30 const std::string& getMessage() const;
31
33 void setMessage( const std::string& msg );
34
36 int getType() const;
37
39 void setType( int msg_type );
40
42 const std::string& getSource() const;
43
45 void setSource( const std::string& src );
46
48 const std::string& getFormat() const;
49
51 static const std::string getDefaultFormat();
52
54 void setFormat( const std::string& msg ) const;
55
57 const std::string& getTimeFormat() const;
58
60 static const std::string getDefaultTimeFormat() ;
61
63 void setTimeFormat( const std::string& timeFormat ) const;
64
66 bool operator < ( const Message& test );
67
69 friend std::ostream& operator << ( std::ostream& stream, const Message& msg );
70
72 friend bool operator == ( const Message& a, const Message& b );
73
74 protected:
76 void invalidFormat() const;
77
79 void makeFormattedMsg( const std::string& format ) const;
80
82 void decodeFormat( const std::string& format ) const;
83
85 void sizeField( const std::string& text ) const;
86
88 void setWidth( const std::string& formatArg ) const;
89
91 std::string m_message;
92
94 std::string m_source;
95
97 mutable std::string m_format;
98
100 mutable std::string m_time_format;
101
103 int m_type;
104
106 mutable std::string m_formatted_msg;
107
109 mutable char m_fill;
110
112 mutable int m_width;
113
115 mutable bool m_left;
116
118 static const char FORMAT_PREFIX;
119
121 static const char JUSTIFY_LEFT;
122
124 static const char JUSTIFY_RIGHT;
125
127 static const char MESSAGE;
128
130 static const char TYPE;
131
133 static const char TIME;
134
137 static const char UTIME;
138
140 static const char SOURCE;
141
145 static const char FILL;
146
150 static const char WIDTH;
151
153 static const char* DEFAULT_FORMAT;
154
156 static const char* DEFAULT_TIME_FORMAT;
157
158 };
159
161 GAUDI_API std::ostream& operator << ( std::ostream& stream, const Message& msg );
162
164 GAUDI_API bool operator == ( const Message& a, const Message& b );
165
166 #endif