// ESAF : Euso Simulation and Analysis Framework
// $Id: EsafMsg.cc,v 1.6 2005/01/15 16:56:59 thea Exp $
// M. Pallavicini created Sep, 24 2004
// ESAF Message
//
#include "EsafMsg.hh"
#include "EsafMsgDispatcher.hh"
//______________________________________________________________________________
//
// ESAF message
// ============
//
// See EsafMsgSource for details
//
ClassImp(EsafMsg)
//______________________________________________________________________________
EsafMsg::EsafMsg() : ostringstream("") {
//
// empty ctor
// set message values to default
//
fSender = "None";
fSeverity = EsafMsg::None;
}
//______________________________________________________________________________
EsafMsg::EsafMsg(const EsafMsg& o ) {
//
// Copy constructor
//
o.Copy(*this);
}
//______________________________________________________________________________
EsafMsg::EsafMsg(EsafMsg::MsgSeverity svr, const string& snd, const string& txt) : ostringstream(txt) {
//
// ctor
//
fSender = snd;
fSeverity = svr;
}
//______________________________________________________________________________
EsafMsg::~EsafMsg() {
//
// dtor
//
}
//______________________________________________________________________________
void EsafMsg::Copy( EsafMsg& o ) const {
//
// Copy this to o
//
o.fSeverity = fSeverity;
o.fSender = fSender;
}
//______________________________________________________________________________
EsafMsg& EsafMsg::operator=(const EsafMsg& o ) {
//
//
//
o.Copy(*this);
return *this;
}
//______________________________________________________________________________
void EsafMsg::Clear() {
//
// clear message
//
fSeverity = EsafMsg::None;
str("");
}
//______________________________________________________________________________
void EsafMsg::Dispatch() {
//
// Dispatch message
//
EsafMsgDispatcher::Get()->Dispatch( *this );
Clear();
}
//______________________________________________________________________________
void EsafMsg::Flush() {
//
// Dispatch message
//
EsafMsgDispatcher::Get()->Dispatch( *this, kFALSE);
Clear();
}