Line data Source code
1 : #ifndef ALIMUONLOGGER_H
2 : #define ALIMUONLOGGER_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : // $Id$
8 :
9 : /// \ingroup core
10 : /// \class AliMUONLogger
11 : /// \brief A logger that keeps track of the number of times a message appeared
12 : ///
13 : // Author Laurent Aphecetche
14 :
15 :
16 : #include "TObject.h"
17 : #include "TString.h"
18 : #include <iosfwd>
19 :
20 : class AliMUONStringIntMap;
21 :
22 : using std::ofstream;
23 :
24 : class AliMUONLogger : public TObject
25 : {
26 : public:
27 : AliMUONLogger(Int_t maxNumberOfEntries=-1, const char* name="AliMUONLogger");
28 : virtual ~AliMUONLogger();
29 :
30 : Int_t Log(const char* message);
31 :
32 : void Print(Option_t* opt="") const;
33 :
34 : void Print(TString& key, ofstream& out) const;
35 :
36 : void Clear(Option_t* /*option*/ ="");
37 :
38 : Bool_t Next(TString& msg, Int_t& occurance);
39 :
40 : void ResetItr();
41 :
42 : Int_t NumberOfEntries() const;
43 :
44 : Long64_t Merge(TCollection* list);
45 :
46 0 : const char* GetName() const { return fName.Data(); }
47 :
48 0 : ULong_t Hash() const { return fName.Hash(); }
49 :
50 : private:
51 : /// Not implemented
52 : AliMUONLogger(const AliMUONLogger& rhs); // not implemented
53 : /// Not implemented
54 : AliMUONLogger& operator=(const AliMUONLogger& rhs); // not implemented
55 :
56 : private:
57 :
58 : Int_t fMaxNumberOfEntries; //!<! after this number, print and reset
59 : AliMUONStringIntMap* fLog; //!<! map from message to number of times the message was issued
60 : TString fName; //!<! object name
61 :
62 18 : ClassDef(AliMUONLogger,2) // A logger that keeps track of the number of times a message appeared
63 : };
64 :
65 : #endif
|