1 #ifndef StMuException_hh
2 #define StMuException_hh
9 #ifndef ST_NO_NAMESPACES
15 enum StMuExceptionTypes {kUnknown=0, kNullPointer, kBadFlag, kBadValue, kEOF};
26 StMuExceptionTypes mException;
30 StMuException(StMuExceptionTypes=kUnknown,
const char* m=
"",
const char* in=
"???") : mMessage(m), mIn(in) { }
32 virtual string message() {
return mMessage; }
33 virtual void print() { cout <<
"*** StMuException #" << (
unsigned long)mException <<
" *** " << mIn <<
" *** " << message() <<
" ***" << endl; }
34 virtual StMuExceptionTypes type() {
return mException; }
38 #define THROW(key,text) StMuException##key(text,__PRETTYF_)
39 #define EXE(x) class StMuException##x : public StMuException { public: StMuException##x (const char* m="", const char* in="???") : StMuException(k##x, m, in) { } };