Universita' di GenovaINFN Sezione di Genova  
AIRWATCH / EUSO Genova

EsafMsg - source file

// ESAF : Euso Simulation and Analysis Framework
// $Id: EsafMsg.cc,v 1.8 2005/09/23 17:02:00 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;
	fProgress = -1;
}

//______________________________________________________________________________
 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;
	fProgress = -1;
}

//______________________________________________________________________________
 EsafMsg::~EsafMsg() {
    // 
	// dtor
    //
}

//______________________________________________________________________________
 void EsafMsg::Copy( EsafMsg& o ) const {
    //
    // Copy this to o
    // 
    
    o.fSeverity = fSeverity;
    o.fSender   = fSender;
    o.fProgress = fProgress;
}
//______________________________________________________________________________
EsafMsg& EsafMsg::operator=(const EsafMsg& o ) {
    //
    //
    //
    
    o.Copy(*this);
    return *this;
}

//______________________________________________________________________________
 void EsafMsg::Clear() {
    // 
	// clear message
    //
	
	fSeverity = EsafMsg::None;
	str("");
	fProgress = -1;
	
}
	
//______________________________________________________________________________
 void EsafMsg::Dispatch() {
    // 
	// Dispatch message
    // 

	EsafMsgDispatcher::Get()->Dispatch( *this );
    Clear();
	
}

//______________________________________________________________________________
 void EsafMsg::Flush() {
    // 
	// Dispatch message
    // 

	EsafMsgDispatcher::Get()->Dispatch( *this, kFALSE);
    Clear();
	
}

//______________________________________________________________________________
 void EsafMsg::Count() {
    //
    // Counting progress
    //

    EsafMsgDispatcher::Get()->Dispatch( *this, kFALSE, kTRUE);
    Clear();
}
About Us | EUSO Official Website | Web pages created by Roberto Pesce and Alessandro Thea - Last Update Wed Nov 16 16:57:39 2005 Wed Nov 16 16:29:22 2005