]>
Commit | Line | Data |
---|---|---|
48beade4 | 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 | ||
cdf15cc5 | 9 | /// \ingroup core |
48beade4 | 10 | /// \class AliMUONLogger |
11 | /// \brief A logger that keeps track of the number of times a message appeared | |
12 | /// | |
78649106 | 13 | // Author Laurent Aphecetche |
48beade4 | 14 | |
38b84fe8 | 15 | #include <Riostream.h> |
16 | ||
48beade4 | 17 | #ifndef ROOT_TObject |
18 | # include "TObject.h" | |
19 | #endif | |
20 | ||
38b84fe8 | 21 | #ifndef ROOT_TString |
22 | # include "TString.h" | |
23 | #endif | |
24 | ||
48beade4 | 25 | class AliMUONStringIntMap; |
26 | ||
b80faac0 | 27 | using std::ofstream; |
28 | ||
48beade4 | 29 | class AliMUONLogger : public TObject |
30 | { | |
31 | public: | |
8804f584 | 32 | AliMUONLogger(Int_t maxNumberOfEntries=-1, const char* name="AliMUONLogger"); |
48beade4 | 33 | virtual ~AliMUONLogger(); |
34 | ||
38b84fe8 | 35 | Int_t Log(const char* message); |
36 | ||
37 | void Print(Option_t* opt="") const; | |
38 | ||
39 | void Print(TString& key, ofstream& out) const; | |
48beade4 | 40 | |
cdf15cc5 | 41 | void Clear(Option_t* /*option*/ =""); |
42 | ||
38b84fe8 | 43 | Bool_t Next(TString& msg, Int_t& occurance); |
64c2397e | 44 | |
38b84fe8 | 45 | void ResetItr(); |
48beade4 | 46 | |
64c2397e | 47 | Int_t NumberOfEntries() const; |
48 | ||
8804f584 | 49 | Long64_t Merge(TCollection* list); |
50 | ||
51 | const char* GetName() const { return fName.Data(); } | |
52 | ||
53 | ULong_t Hash() const { return fName.Hash(); } | |
54 | ||
48beade4 | 55 | private: |
71a2d3aa | 56 | /// Not implemented |
48beade4 | 57 | AliMUONLogger(const AliMUONLogger& rhs); // not implemented |
71a2d3aa | 58 | /// Not implemented |
48beade4 | 59 | AliMUONLogger& operator=(const AliMUONLogger& rhs); // not implemented |
60 | ||
61 | private: | |
62 | ||
63 | Int_t fMaxNumberOfEntries; //!< after this number, print and reset | |
64 | AliMUONStringIntMap* fLog; //!< map from message to number of times the message was issued | |
8804f584 | 65 | TString fName; //!< object name |
48beade4 | 66 | |
8804f584 | 67 | ClassDef(AliMUONLogger,2) // A logger that keeps track of the number of times a message appeared |
48beade4 | 68 | }; |
69 | ||
70 | #endif |