Logo ROOT   6.10/09
Reference Guide
TStatus.h
Go to the documentation of this file.
1 // @(#)root/proofplayer:$Id$
2 // Author: Maarten Ballintijn 12/03/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TStatus
13 #define ROOT_TStatus
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TStatus //
18 // //
19 // This class holds the status of a ongoing operation and collects //
20 // error messages. It provides a Merge() operation allowing it to //
21 // be used in PROOF to monitor status in the slaves. //
22 // No messages indicates success. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #include "TNamed.h"
27 #include "THashList.h"
28 
29 #include <set>
30 #include <string>
31 #ifdef R__GLOBALSTL
32 namespace std { using ::set; using ::string; }
33 #endif
34 
35 class TStatus : public TNamed {
36 
37 public:
38  enum EProcStatus {
39  kNotOk = BIT(15) // True if status of things are not OK
40  };
41 
42 private:
43  TList fMsgs; // list of error messages
44  TIter fIter; //!iterator in messages
45  THashList fInfoMsgs; // list of info messages
46 
47  Int_t fExitStatus; // Query exit status ((Int_t)TVirtualProofPlayer::EExitStatus or -1);
48  Long_t fVirtMemMax; // Max virtual memory used by the worker
49  Long_t fResMemMax; // Max resident memory used by the worker
50  Long_t fVirtMaxMst; // Max virtual memory used by the master
51  Long_t fResMaxMst; // Max resident memory used by the master
52 
53 public:
54  TStatus();
55  virtual ~TStatus() { }
56 
57  inline Bool_t IsOk() const { return TestBit(kNotOk) ? kFALSE : kTRUE; }
58  void Add(const char *mesg);
59  void AddInfo(const char *mesg);
60  virtual Int_t Merge(TCollection *list);
61  virtual void Print(Option_t *option="") const;
62  void Reset();
63  const char *NextMesg();
64 
65  Int_t GetExitStatus() const { return fExitStatus; }
66  Long_t GetResMemMax(Bool_t master = kFALSE) const { return ((master) ? fResMaxMst : fResMemMax); }
67  Long_t GetVirtMemMax(Bool_t master = kFALSE) const { return ((master) ? fVirtMaxMst : fVirtMemMax); }
68 
69  void SetExitStatus(Int_t est) { fExitStatus = est; }
70  void SetMemValues(Long_t vmem = -1, Long_t rmem = -1, Bool_t master = kFALSE);
71 
72  ClassDef(TStatus,5); // Status class
73 };
74 
75 #endif
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:75
Long_t GetResMemMax(Bool_t master=kFALSE) const
Definition: TStatus.h:66
Long_t fResMemMax
Definition: TStatus.h:49
Int_t GetExitStatus() const
Definition: TStatus.h:65
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
STL namespace.
Long_t fVirtMaxMst
Definition: TStatus.h:50
Long_t GetVirtMemMax(Bool_t master=kFALSE) const
Definition: TStatus.h:67
Bool_t IsOk() const
Definition: TStatus.h:57
#define ClassDef(name, id)
Definition: Rtypes.h:297
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:34
This class holds the status of an ongoing operation and collects error messages.
Definition: TStatus.h:35
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
A doubly linked list.
Definition: TList.h:43
Long_t fResMaxMst
Definition: TStatus.h:51
Collection abstract base class.
Definition: TCollection.h:42
void Reset(Detail::TBranchProxy *x)
const Bool_t kFALSE
Definition: RtypesCore.h:92
long Long_t
Definition: RtypesCore.h:50
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
Definition: THist.hxx:336
void Print(std::ostream &os, const OptionType &opt)
TList fMsgs
Definition: TStatus.h:43
Long_t fVirtMemMax
Definition: TStatus.h:48
Int_t fExitStatus
Definition: TStatus.h:47
virtual ~TStatus()
Definition: TStatus.h:55
void SetExitStatus(Int_t est)
Definition: TStatus.h:69
TIter fIter
Definition: TStatus.h:44
THashList fInfoMsgs
iterator in messages
Definition: TStatus.h:45
const Bool_t kTRUE
Definition: RtypesCore.h:91
EProcStatus
Definition: TStatus.h:38