source: JEM-EUSO/esaf_cc_at_lal/packages/common/base/src/EsafMsg.cc @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 2.5 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: EsafMsg.cc 2558 2006-03-14 01:10:20Z thea $
3// M. Pallavicini created Sep, 24 2004
4// ESAF Message
5//
6
7#include "EsafMsg.hh"
8#include "EsafMsgDispatcher.hh"
9
10//______________________________________________________________________________
11//
12//  ESAF message
13//  ============
14//
15//  See EsafMsgSource for details
16//
17
18
19ClassImp(EsafMsg)       
20
21//______________________________________________________________________________
22EsafMsg::EsafMsg() : ostringstream("") {
23    //
24        // empty ctor
25        // set message values to default
26    //
27
28    exceptions(std::ios_base::badbit);
29        fSender = "None";
30        fSeverity = EsafMsg::None;
31        fProgress = -1;
32}
33
34//______________________________________________________________________________
35EsafMsg::EsafMsg(const EsafMsg& o ) {
36    //
37    // Copy constructor
38    //
39
40    o.Copy(*this); 
41}
42
43//______________________________________________________________________________
44EsafMsg::EsafMsg(EsafMsg::MsgSeverity svr, const string& snd, const string& txt) : ostringstream(txt) {
45    //
46        // ctor
47    //
48       
49        fSender = snd;
50        fSeverity = svr;
51        fProgress = -1;
52}
53
54//______________________________________________________________________________
55EsafMsg::~EsafMsg() {
56    //
57        // dtor
58    //
59}
60
61//______________________________________________________________________________
62void EsafMsg::Copy( EsafMsg& o ) const {
63    //
64    // Copy this to o
65    //
66   
67    o.fSeverity = fSeverity;
68    o.fSender   = fSender;
69    o.fProgress = fProgress;
70    o.str(str());
71}
72//______________________________________________________________________________
73EsafMsg& EsafMsg::operator=(const EsafMsg& o ) {
74    //
75    //
76    //
77   
78    o.Copy(*this);
79    return *this;
80}
81
82//______________________________________________________________________________
83void EsafMsg::Clear() {
84    //
85        // clear message
86    //
87       
88        fSeverity = EsafMsg::None;
89        str("");
90        fProgress = -1;
91       
92}
93       
94//______________________________________________________________________________
95void EsafMsg::Dispatch() {
96    //
97        // Dispatch message
98    //
99
100        EsafMsgDispatcher::Get()->Dispatch( *this );
101    Clear();
102       
103}
104
105//______________________________________________________________________________
106void EsafMsg::Flush() {
107    //
108        // Dispatch message
109    //
110
111        EsafMsgDispatcher::Get()->Dispatch( *this, kFALSE);
112    Clear();
113       
114}
115
116//______________________________________________________________________________
117void EsafMsg::Count() {
118    //
119    // Counting progress
120    //
121
122    EsafMsgDispatcher::Get()->Dispatch( *this, kFALSE, kTRUE);
123    Clear();
124}
Note: See TracBrowser for help on using the repository browser.