Line data Source code
1 : #ifndef ALISYSINFO_H
2 : #define ALISYSINFO_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 :
7 : #include <TObject.h>
8 : class TStopwatch;
9 : class TTree;
10 : class TMemStatManager;
11 : using std::fstream;
12 :
13 0 : class AliSysInfo : public TObject {
14 : public:
15 : AliSysInfo();
16 : static AliSysInfo * Instance();
17 : static void AddStamp(const char *sname, Int_t id0=-1, Int_t id1=-1, Int_t id2=-1, Int_t id3=-1);
18 : static TTree * MakeTree(const char *lname, const char * fout=0);
19 : static void OpenMemStat();
20 : static void CloseMemStat();
21 : static Bool_t Contain(const char * str1, const char * str2);
22 : typedef void (*StampCallback_t)(const Char_t * desription);
23 : static void AddCallBack(StampCallback_t callback);
24 : //
25 : // Object size function
26 : static Double_t EstimateObjectSize(TObject* object);
27 : static TTree* Test();
28 :
29 0 : static void SetVerbose(Bool_t v=kFALSE) {fgVerbose = v;}
30 0 : static Bool_t GetVerbose() {return fgVerbose;}
31 0 : static void SetDisabled(Bool_t v=kTRUE) {fgDisabled = v; fgVerbose=kFALSE;}
32 0 : static Bool_t IsDisabled() {return fgDisabled;}
33 : static void PrintJiraTable(TTree * tree, const char *var, const char *cut, const char *format, const char *output="syswatch.table");
34 : private:
35 : AliSysInfo(const AliSysInfo& source);
36 : AliSysInfo& operator= (const AliSysInfo& rec);
37 :
38 : fstream *fSysWatch; // system watch - Memory and CPU usage
39 : TStopwatch *fTimer; // timer
40 : TMemStatManager *fMemStat;
41 : static AliSysInfo * fInstance; //instance pointer
42 : StampCallback_t *fCallBackFunc; // call back functions
43 : Int_t fNCallBack; // number of call back functions
44 : static Bool_t fgVerbose; // do we want actually to write the stamps ?
45 : static Bool_t fgDisabled; // do not even open the file
46 176 : ClassDef(AliSysInfo,0)
47 : };
48 :
49 : #endif
|