StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMessage.h
1 
11 #ifndef ClassStMessage
12 #define ClassStMessage
13 
14 #ifdef __ROOT__
15 #include "Rtypes.h"
16 #endif
17 #include <time.h>
18 
19 enum StMessOpt {
20  kMessOptNone = 0U,
21  kMessOptDash = 1U,
22  kMessOptO = (1U << 1),
23  kMessOptE = (1U << 2),
24  kMessOptT = (1U << 3),
25  kMessOptS = (1U << 4),
26  kMessOptP = (1U << 5)
27  };
28 
29 class StMessage {
30  friend class StMessageManager;
31 
32  private:
33  static int repeats;
34  static void IgnoreRepeats() { repeats=0; }
35  static void AllowRepeats() { repeats=1; }
36 
37  protected:
38  char type[2];
39 // char* location; //!
40 // unsigned long runNumber;
41 // pair<long, long> eventId;
42  unsigned int option;
43  time_t messTime;
44  char* message;
45 
46  public:
47  StMessage(const char* mess="", const char* ty="I", const char* opt="O");
48  StMessage(const StMessage&){option=0;messTime=0;message=0;}
49  virtual ~StMessage();
50  void PrintInfo();
51  int Print(int nChars=-1);
52  time_t& GetTime() {return messTime;}
53  const char* GetType() const {return type;}
54  char* GetMessage() const {return message;}
55  unsigned int GetOption() const {return option;}
56  char* GetOptions() const;
57  void SetOptions(const char* opt);
58  size_t GetMemoryUsage();
59 #ifdef __ROOT__
60  ClassDef(StMessage,0)
61 #endif
62 };
63 
64 #endif
65 
66 // $Id: StMessage.h,v 1.17 2016/06/14 06:26:34 genevb Exp $
67 // $Log: StMessage.h,v $
68 // Revision 1.17 2016/06/14 06:26:34 genevb
69 // better initializations (Coverity)
70 //
71 // Revision 1.16 2004/04/02 22:17:14 genevb
72 // Added protected Ignore/AllowRepeats() for friend StBFChain class
73 //
74 // Revision 1.15 2003/10/01 20:06:50 genevb
75 // Initialize and test ostrstream buffer sizes (support for gcc before 3.2)
76 //
77 // Revision 1.13 2003/09/25 21:18:14 genevb
78 // Changed option storage
79 //
80 // Revision 1.12 2003/09/22 01:30:41 perev
81 // some cleanup
82 //
83 // Revision 1.11 2001/05/16 15:50:56 genevb
84 // Switch TROOT.h to Rtypes.h
85 //
86 // Revision 1.10 2001/05/16 15:18:50 genevb
87 // Need include for TROOT
88 //
89 // Revision 1.9 2001/05/14 20:53:20 genevb
90 // Add features to examine memory use, switch from TDatime to time_t
91 //
92 // Revision 1.8 2000/06/10 21:19:02 genevb
93 // Remove use of virtual functions
94 //
95 // Revision 1.7 2000/01/05 19:53:46 genevb
96 // Fixed CC5 warnings, and several other small improvements under the hood
97 //
98 // Revision 1.6 1999/08/18 18:28:33 fine
99 // Various bugs have been fixed. share lib was not loaded under HP
100 //
101 // Revision 1.5 1999/07/08 22:58:18 genevb
102 // Created an abstract interface with StMessMgr.h hiding template implementation from others, a few other small fixes
103 //
104 // Revision 1.4 1999/06/30 17:24:50 genevb
105 // Better limit management, remove Bool_t
106 //
107 // Revision 1.3 1999/06/29 17:37:31 genevb
108 // Lots of fixes...
109 //
110 // Revision 1.2 1999/06/24 16:30:41 genevb
111 // Fixed some memory leaks
112 //
113 // Revision 1.1 1999/06/23 15:17:47 genevb
114 // Introduction of StMessageManager
115 //
116 // Revision 1.0 1999/01/27 10:28:29 genevb
117 //