ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #ifndef ROOT_TNamed
27 #include "TNamed.h"
28 #endif
29 #ifndef ROOT_THashList
30 #include "THashList.h"
31 #endif
32 
33 #include <set>
34 #include <string>
35 #ifdef R__GLOBALSTL
36 namespace std { using ::set; using ::string; }
37 #endif
38 
39 class TStatus : public TNamed {
40 
41 public:
42  enum EProcStatus {
43  kNotOk = BIT(15) // True if status of things are not OK
44  };
45 
46 private:
47  TList fMsgs; // list of error messages
48  TIter fIter; //!iterator in messages
49  THashList fInfoMsgs; // list of info messages
50 
51  Int_t fExitStatus; // Query exit status ((Int_t)TVirtualProofPlayer::EExitStatus or -1);
52  Long_t fVirtMemMax; // Max virtual memory used by the worker
53  Long_t fResMemMax; // Max resident memory used by the worker
54  Long_t fVirtMaxMst; // Max virtual memory used by the master
55  Long_t fResMaxMst; // Max resident memory used by the master
56 
57 public:
58  TStatus();
59  virtual ~TStatus() { }
60 
61  inline Bool_t IsOk() const { return TestBit(kNotOk) ? kFALSE : kTRUE; }
62  void Add(const char *mesg);
63  void AddInfo(const char *mesg);
64  virtual Int_t Merge(TCollection *list);
65  virtual void Print(Option_t *option="") const;
66  void Reset();
67  const char *NextMesg();
68 
69  Int_t GetExitStatus() const { return fExitStatus; }
70  Long_t GetResMemMax(Bool_t master = kFALSE) const { return ((master) ? fResMaxMst : fResMemMax); }
71  Long_t GetVirtMemMax(Bool_t master = kFALSE) const { return ((master) ? fVirtMaxMst : fVirtMemMax); }
72 
73  void SetExitStatus(Int_t est) { fExitStatus = est; }
74  void SetMemValues(Long_t vmem = -1, Long_t rmem = -1, Bool_t master = kFALSE);
75 
76  ClassDef(TStatus,5); // Status class
77 };
78 
79 #endif
Bool_t IsOk() const
Definition: TStatus.h:61
void SetMemValues(Long_t vmem=-1, Long_t rmem=-1, Bool_t master=kFALSE)
Set max memory values.
Definition: TStatus.cxx:159
const char Option_t
Definition: RtypesCore.h:62
const char * NextMesg()
Return the next message or 0.
Definition: TStatus.cxx:149
void AddInfo(const char *mesg)
Add an info message.
Definition: TStatus.cxx:56
Long_t GetVirtMemMax(Bool_t master=kFALSE) const
Definition: TStatus.h:71
#define BIT(n)
Definition: Rtypes.h:120
void Add(const char *mesg)
Add an error message.
Definition: TStatus.cxx:46
Long_t fResMemMax
Definition: TStatus.h:53
Int_t GetExitStatus() const
Definition: TStatus.h:69
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Long_t fVirtMaxMst
Definition: TStatus.h:54
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:36
This class holds the status of an ongoing operation and collects error messages.
Definition: TStatus.h:39
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Int_t Merge(TCollection *list)
PROOF Merge() function.
Definition: TStatus.cxx:64
Long_t GetResMemMax(Bool_t master=kFALSE) const
Definition: TStatus.h:70
A doubly linked list.
Definition: TList.h:47
ClassDef(TStatus, 5)
Long_t fResMaxMst
Definition: TStatus.h:55
Collection abstract base class.
Definition: TCollection.h:48
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
long Long_t
Definition: RtypesCore.h:50
TList fMsgs
Definition: TStatus.h:47
Long_t fVirtMemMax
Definition: TStatus.h:52
void Reset()
Reset the iterator on the messages.
Definition: TStatus.cxx:141
Int_t fExitStatus
Definition: TStatus.h:51
virtual ~TStatus()
Definition: TStatus.h:59
virtual void Print(Option_t *option="") const
Standard print function.
Definition: TStatus.cxx:109
void SetExitStatus(Int_t est)
Definition: TStatus.h:73
TIter fIter
Definition: TStatus.h:48
THashList fInfoMsgs
iterator in messages
Definition: TStatus.h:49
const Bool_t kTRUE
Definition: Rtypes.h:91
EProcStatus
Definition: TStatus.h:42