15 #ifndef ClassStMessageManager
16 #define ClassStMessageManager
18 #include "StMessage.h"
19 #include "StMessTypeList.h"
20 #include "StMessageCounter.h"
25 typedef StVector(
StMessage*)::iterator messVecIter;
26 typedef StVector(messVec*) messTypeVec;
29 #include "StMessMgr.h"
46 messTypeVec messCollection;
47 virtual messVecIter FindMessageIter(
const char* s1,
const char* s2=
"",
48 const char* s3=
"",
const char* s4=
"", messVec* list=0);
49 virtual void BuildMessage(
const char* mess=
"",
const char* type=
"",
51 virtual void IgnoreRepeats() { StMessage::IgnoreRepeats(); }
52 virtual void AllowRepeats() { StMessage::AllowRepeats(); }
59 virtual std::ostream& OperatorShift(std::ostream& os,
StMessage* stm);
62 virtual std::ostringstream& Message(
const char* mess=
"",
const char* type=
"",
63 const char* opt=0,
const char *sourceFileName=0,
int lineNumber=-1);
65 virtual int PrintList(messVec* list);
66 virtual int PrintAll() {
return PrintList(&messList); }
67 virtual const messVec* GetAll() {
return (&messList);}
68 virtual StMessage* FindMessage(
const char* s1,
const char* s2=
"",
69 const char* s3=
"",
const char* s4=
"", messVec* list=0);
70 virtual messVec* FindMessageList(
const char* s1,
const char* s2=
"",
71 const char* s3=
"",
const char* s4=
"", messVec* list=0);
72 virtual int RemoveMessage(
StMessage* mess);
73 virtual int RemoveMessage(
const char* s1,
const char* s2=
"",
74 const char* s3=
"",
const char* s4=
"")
75 {
return RemoveMessage(FindMessage(s1,s2,s3,s4));}
76 virtual void SetLimit(
const char* str,
int n=0)
77 {messCounter->SetLimit(str,n);}
78 virtual int GetLimit(
const char* str)
79 {
return messCounter->GetLimit(str);}
80 virtual void ListLimits() {messCounter->ListLimits();}
81 virtual void RemoveLimit(
const char* str) {SetLimit(str,-1);}
82 virtual void SetLevel(Int_t logLevel);
83 virtual Int_t GetLevel(Int_t logLevel)
const;
84 virtual const char *GetName()
const;
85 virtual void SwitchOff(
const char* str) {SetLimit(str,0);}
86 virtual void SwitchOn(
const char* str) {RemoveLimit(str);}
87 virtual void FixOn(
const char* str) {SetLimit(str,-5);}
88 virtual void NoLimits() {messCounter->NoLimits();}
89 virtual void Summary(
size_t nTerms=1);
90 virtual void MemorySummary();
91 virtual void MemoryOn() {remember=1;}
92 virtual void MemoryOff() {remember=0;}
93 virtual int AddType(
const char* type,
const char* text);
94 virtual int ListTypes() {
return messTypeList->ListTypes();}
97 virtual std::ostringstream& Info(
const char* mess=
"",
const char* opt=
"O",
const char *sourceFileName=0,
int lineNumber=-1)
98 {
return Message(mess,
"I", opt);}
99 virtual int PrintInfos() {
return PrintList(messCollection[1]); }
100 virtual const messVec* GetInfos() {
return (messCollection[1]);}
101 virtual StMessage* FindInfo(
const char* s1,
const char* s2=
"",
102 const char* s3=
"",
const char* s4=
"")
103 {
return FindMessage(s1,s2,s3,s4,messCollection[1]);}
104 virtual messVec* FindInfoList(
const char* s1,
const char* s2=
"",
105 const char* s3=
"",
const char* s4=
"")
106 {
return FindMessageList(s1,s2,s3,s4,messCollection[1]);}
109 virtual std::ostringstream& Warning(
const char* mess=
"",
const char* opt=
"E",
const char *sourceFileName=0,
int lineNumber=-1)
110 {
return Message(mess,
"W", opt,sourceFileName,lineNumber);}
111 virtual int PrintWarnings() {
return PrintList(messCollection[2]); }
112 virtual const messVec* GetWarnings() {
return (messCollection[2]);}
113 virtual StMessage* FindWarning(
const char* s1,
const char* s2=
"",
114 const char* s3=
"",
const char* s4=
"")
115 {
return FindMessage(s1,s2,s3,s4,messCollection[2]);}
116 virtual messVec* FindWarningList(
const char* s1,
const char* s2=
"",
117 const char* s3=
"",
const char* s4=
"")
118 {
return FindMessageList(s1,s2,s3,s4,messCollection[2]);}
121 virtual std::ostringstream&
Error(
const char* mess=
"",
const char* opt=
"E",
const char *sourceFileName=0,
int lineNumber=-1)
122 {
return Message(mess,
"E", opt,sourceFileName,lineNumber);}
123 virtual int PrintErrors() {
return PrintList(messCollection[3]); }
124 virtual const messVec* GetErrors() {
return (messCollection[3]);}
125 virtual StMessage* FindError(
const char* s1,
const char* s2=
"",
126 const char* s3=
"",
const char* s4=
"")
127 {
return FindMessage(s1,s2,s3,s4,messCollection[3]);}
128 virtual messVec* FindErrorList(
const char* s1,
const char* s2=
"",
129 const char* s3=
"",
const char* s4=
"")
130 {
return FindMessageList(s1,s2,s3,s4,messCollection[3]);}
133 virtual std::ostringstream& Debug(
const char* mess=
"",
const char* opt=
"OT",
const char *sourceFileName=0,
int lineNumber=-1)
134 {
return Message(mess,
"D", opt,sourceFileName,lineNumber);}
135 virtual int PrintDebug() {
return PrintList(messCollection[4]); }
136 virtual const messVec* GetDebugs() {
return (messCollection[4]);}
137 virtual StMessage* FindDebug(
const char* s1,
const char* s2=
"",
138 const char* s3=
"",
const char* s4=
"")
139 {
return FindMessage(s1,s2,s3,s4,messCollection[4]);}
140 virtual messVec* FindDebugList(
const char* s1,
const char* s2=
"",
141 const char* s3=
"",
const char* s4=
"")
142 {
return FindMessageList(s1,s2,s3,s4,messCollection[4]);}
145 virtual std::ostringstream& QAInfo(
const char* mess=
"",
const char* opt=
"OS",
const char *sourceFileName=0,
int lineNumber=-1)
146 {
return Message(mess,
"Q", opt,sourceFileName,lineNumber);}
147 virtual int PrintQAInfo() {
return PrintList(messCollection[5]); }
148 virtual const messVec* GetQAInfos() {
return (messCollection[5]);}
149 virtual StMessage* FindQAInfo(
const char* s1,
const char* s2=
"",
150 const char* s3=
"",
const char* s4=
"")
151 {
return FindMessage(s1,s2,s3,s4,messCollection[5]);}
152 virtual messVec* FindQAInfoList(
const char* s1,
const char* s2=
"",
153 const char* s3=
"",
const char* s4=
"")
154 {
return FindMessageList(s1,s2,s3,s4,messCollection[5]);}
157 virtual std::ostringstream& UCMInfo(
const char* mess=
"",
const char* opt=
"OS",
const char *sourceFileName=0,
int lineNumber=-1)
158 {
return Message(mess,
"U", opt,sourceFileName,lineNumber);}
159 virtual int PrintUCMInfo() {
return PrintList(messCollection[6]); }
160 virtual const messVec* GetUCMInfos() {
return (messCollection[6]);}
161 virtual StMessage* FindUCMInfo(
const char* s1,
const char* s2=
"",
162 const char* s3=
"",
const char* s4=
"")
163 {
return FindMessage(s1,s2,s3,s4,messCollection[6]);}
164 virtual messVec* FindUCMInfoList(
const char* s1,
const char* s2=
"",
165 const char* s3=
"",
const char* s4=
"")
166 {
return FindMessageList(s1,s2,s3,s4,messCollection[6]);}
169 virtual std::ostringstream& out(
const char* mess=
"")
170 {
return Message(mess,
"I",
"OP-");}
171 virtual std::ostringstream& err(
const char* mess=
"")
172 {
return Message(mess,
"E",
"EP-");}
174 virtual void PrintInfo();
176 virtual std::ostringstream& Fatal(
const char* mess=
"",
const char* opt=
"E",
const char *sourceFileName=0,
int lineNumber=-1)
177 {
return Message(mess,
"E", opt,sourceFileName,lineNumber);}