// $Id: EsafMsgSource.hh,v 1.8 2005/01/15 16:56:58 thea Exp $ // Author: M. Pallavicini Sep, 24 2004 /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: EsafMsgSource * * Package: Base * * Coordinator: Marco.Pallavicini * * * *****************************************************************************/ #ifndef __ESAFMSGSOURCE_HH_ #define __ESAFMSGSOURCE_HH_ #include #include "euso.hh" #include "EsafMsg.hh" //////////////////////////////////////////////////////////////////////////////// // // // EsafMsgSource // // // // ESAF Message Source // // // //////////////////////////////////////////////////////////////////////////////// class EsafMsgSource { protected: EsafMsgSource(); // default ctor EsafMsgSource(const EsafMsgSource& ); public: virtual ~EsafMsgSource() {} // dtor EsafMsg& Msg( EsafMsg::MsgSeverity ) const; // prepare message and returns it for writing void MsgForm( EsafMsg::MsgSeverity, const char *fmt, ...) const; // prepare and send a message with printf syntax inline void Dispatch() const { fMsg.Dispatch(); } // dispatch message inline void FatalError( const string& ) const; // private: mutable EsafMsg fMsg; // the message public: ClassDef(EsafMsgSource,0) }; inline void EsafMsgSource::FatalError( const string& errmsg ) const { Msg(EsafMsg::Panic) << errmsg << MsgDispatch; } #endif /* __ESAFMSGSOURCE_HH_ */