Logo ROOT  
Reference Guide
TQueryResult.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: G Ganis Sep 2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, 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_TQueryResult
13 #define ROOT_TQueryResult
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TQueryResult //
19 // //
20 // A container class for the results of a query. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 #include "TDatime.h"
26 #include "TString.h"
27 
28 #ifdef R__LESS_INCLUDES
29 class TMacro;
30 #else
31 #include "TMacro.h"
32 #endif
33 
34 class TBrowser;
35 class TTreePlayer;
36 class TQueryResult;
37 
38 Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2);
39 
40 
41 class TQueryResult : public TNamed {
42 
43 friend class TTreePlayer;
44 friend class TProofPlayerLite;
45 friend class TProofPlayerRemote;
46 friend class TProof;
47 friend class TProofLite;
48 friend class TProofServ;
49 friend class TQueryResultManager;
50 
51 public:
52  enum EQueryStatus {
54  };
55 
56 protected:
57  Int_t fSeqNum; ///< query unique sequential number
58  Bool_t fDraw; ///< true if draw action query
59  EQueryStatus fStatus; ///< query status
60  TDatime fStart; ///< time when processing started
61  TDatime fEnd; ///< time when processing ended
62  Float_t fUsedCPU; ///< real CPU time used (seconds)
63  TString fOptions; ///< processing options + aclic mode (< opt >#< aclic_mode >)
64  TList *fInputList; ///< input list; contains also data sets, entry list, ...
65  Long64_t fEntries; ///< number of entries processed
66  Long64_t fFirst; ///< first entry processed
67  Long64_t fBytes; ///< number of bytes processed
68  TMacro *fLogFile; ///< file with log messages from the query
69  TMacro *fSelecHdr; ///< selector header file
70  TMacro *fSelecImp; ///< selector implementation file
71  TString fLibList; ///< blank-separated list of libs loaded at fStart
72  TString fParList; ///< colon-separated list of PAR loaded at fStart
73  TList *fOutputList; ///< output list
74  Bool_t fFinalized; ///< whether Terminate has been run
75  Bool_t fArchived; ///< whether the query has been archived
76  TString fResultFile; ///< URL of the file where results have been archived
77  Float_t fPrepTime; ///< Prepare time (seconds) (millisec precision)
78  Float_t fInitTime; ///< Initialization time (seconds) (millisec precision)
79  Float_t fProcTime; ///< Processing time (seconds) (millisec precision)
80  Float_t fMergeTime; ///< Merging time (seconds) (millisec precision)
81  Float_t fRecvTime; ///< Transfer-to-client time (seconds) (millisec precision)
82  Float_t fTermTime; ///< Terminate time (seconds) (millisec precision)
83  Int_t fNumWrks; ///< Number of workers at start
84  Int_t fNumMergers; ///< Number of submergers
85 
86  TQueryResult(Int_t seqnum, const char *opt, TList *inlist,
87  Long64_t entries, Long64_t first,
88  const char *selec);
89 
90  void AddInput(TObject *obj);
91  void AddLogLine(const char *logline);
93  virtual void RecordEnd(EQueryStatus status, TList *outlist = 0);
94  void SaveSelector(const char *selec);
95  void SetArchived(const char *archfile);
96  virtual void SetFinalized() { fFinalized = kTRUE; }
97  virtual void SetInputList(TList *in, Bool_t adopt = kTRUE);
98  virtual void SetOutputList(TList *out, Bool_t adopt = kTRUE);
99  virtual void SetProcessInfo(Long64_t ent, Float_t cpu = 0.,
100  Long64_t siz = -1,
101  Float_t inittime = 0., Float_t proctime = 0.);
102  void SetPrepTime(Float_t preptime) { fPrepTime = preptime; }
103  void SetMergeTime(Float_t mergetime) { fMergeTime = mergetime; }
104  void SetRecvTime(Float_t recvtime) { fRecvTime = recvtime; }
105  void SetTermTime(Float_t termtime) { fTermTime = termtime; }
106  void SetNumMergers(Int_t nmergers) { fNumMergers = nmergers; }
107 
108 public:
110  fInputList(0), fEntries(-1), fFirst(-1), fBytes(0),
111  fLogFile(0), fSelecHdr(0), fSelecImp(0),
112  fLibList("-"), fOutputList(0),
114  fInitTime(0.), fProcTime(0.), fMergeTime(0.),
115  fRecvTime(-1), fTermTime(0.), fNumWrks(-1), fNumMergers(-1) { }
116  virtual ~TQueryResult();
117 
118  void Browse(TBrowser *b = 0);
119 
120  Int_t GetSeqNum() const { return fSeqNum; }
121  EQueryStatus GetStatus() const { return fStatus; }
122  TDatime GetStartTime() const { return fStart; }
123  TDatime GetEndTime() const { return fEnd; }
124  const char *GetOptions() const { return fOptions; }
126  TObject *GetInputObject(const char *classname) const;
127  Long64_t GetEntries() const { return fEntries; }
128  Long64_t GetFirst() const { return fFirst; }
129  Long64_t GetBytes() const { return fBytes; }
130  Float_t GetUsedCPU() const { return fUsedCPU; }
131  TMacro *GetLogFile() const { return fLogFile; }
132  TMacro *GetSelecHdr() const { return fSelecHdr; }
133  TMacro *GetSelecImp() const { return fSelecImp; }
134  const char *GetLibList() const { return fLibList; }
135  const char *GetParList() const { return fParList; }
137  const char *GetResultFile() const { return fResultFile; }
138  Float_t GetPrepTime() const { return fPrepTime; }
139  Float_t GetInitTime() const { return fInitTime; }
140  Float_t GetProcTime() const { return fProcTime; }
141  Float_t GetMergeTime() const { return fMergeTime; }
142  Float_t GetRecvTime() const { return fRecvTime; }
143  Float_t GetTermTime() const { return fTermTime; }
144  Int_t GetNumWrks() const { return fNumWrks; }
145  Int_t GetNumMergers() const { return fNumMergers; }
146 
147  Bool_t IsArchived() const { return fArchived; }
148  virtual Bool_t IsDone() const { return (fStatus > kRunning); }
149  Bool_t IsDraw() const { return fDraw; }
150  Bool_t IsFinalized() const { return fFinalized; }
151 
152  Bool_t Matches(const char *ref);
153 
154  void Print(Option_t *opt = "") const;
155 
156  ClassDef(TQueryResult,5) //Class describing a query
157 };
158 
159 inline Bool_t operator!=(const TQueryResult &qr1, const TQueryResult &qr2)
160  { return !(qr1 == qr2); }
161 
162 #endif
TQueryResult::fProcTime
Float_t fProcTime
Processing time (seconds) (millisec precision)
Definition: TQueryResult.h:79
first
Definition: first.py:1
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TQueryResult::fOptions
TString fOptions
processing options + aclic mode (< opt >#< aclic_mode >)
Definition: TQueryResult.h:63
TQueryResult::CloneInfo
TQueryResult * CloneInfo()
Return an instance of TQueryResult containing only the local info fields, i.e.
Definition: TQueryResult.cxx:124
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TQueryResult::fFinalized
Bool_t fFinalized
whether Terminate has been run
Definition: TQueryResult.h:74
Option_t
const char Option_t
Definition: RtypesCore.h:66
TQueryResult::fEnd
TDatime fEnd
time when processing ended
Definition: TQueryResult.h:61
TQueryResult::kStopped
@ kStopped
Definition: TQueryResult.h:53
TQueryResult::GetOptions
const char * GetOptions() const
Definition: TQueryResult.h:124
TQueryResult::IsDone
virtual Bool_t IsDone() const
Definition: TQueryResult.h:148
TQueryResult::fNumMergers
Int_t fNumMergers
Number of submergers.
Definition: TQueryResult.h:84
TQueryResult::Print
void Print(Option_t *opt="") const
Print query content. Use opt = "F" for a full listing.
Definition: TQueryResult.cxx:315
TDatime.h
TQueryResult::GetRecvTime
Float_t GetRecvTime() const
Definition: TQueryResult.h:142
TQueryResult::fFirst
Long64_t fFirst
first entry processed
Definition: TQueryResult.h:66
TNamed.h
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TQueryResult::fParList
TString fParList
colon-separated list of PAR loaded at fStart
Definition: TQueryResult.h:72
TQueryResult::SaveSelector
void SaveSelector(const char *selec)
Save the selector header and implementation into the dedicated TMacro instances.
Definition: TQueryResult.cxx:175
Float_t
float Float_t
Definition: RtypesCore.h:57
TQueryResult::fOutputList
TList * fOutputList
output list
Definition: TQueryResult.h:73
TQueryResult::fPrepTime
Float_t fPrepTime
Prepare time (seconds) (millisec precision)
Definition: TQueryResult.h:77
TQueryResult::fLibList
TString fLibList
blank-separated list of libs loaded at fStart
Definition: TQueryResult.h:71
TMacro.h
TQueryResult::GetLogFile
TMacro * GetLogFile() const
Definition: TQueryResult.h:131
TQueryResult::fUsedCPU
Float_t fUsedCPU
real CPU time used (seconds)
Definition: TQueryResult.h:62
TProofLite
This class starts a PROOF session on the local machine: no daemons, client and master merged,...
Definition: TProofLite.h:40
TQueryResult
A container class for query results.
Definition: TQueryResult.h:41
TQueryResult::SetTermTime
void SetTermTime(Float_t termtime)
Definition: TQueryResult.h:105
TQueryResult::fResultFile
TString fResultFile
URL of the file where results have been archived.
Definition: TQueryResult.h:76
TString
Basic string class.
Definition: TString.h:136
TQueryResult::Browse
void Browse(TBrowser *b=0)
To support browsing of the results.
Definition: TQueryResult.cxx:419
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TProofPlayerLite
Version of TProofPlayerRemote merges the functionality needed by clients and masters.
Definition: TProofPlayerLite.h:28
TQueryResult::SetArchived
void SetArchived(const char *archfile)
Set (or update) query in archived state.
Definition: TQueryResult.cxx:303
TQueryResult::fSelecHdr
TMacro * fSelecHdr
selector header file
Definition: TQueryResult.h:69
b
#define b(i)
Definition: RSha256.hxx:100
TString.h
TQueryResult::AddInput
void AddInput(TObject *obj)
Add obj to the input list.
Definition: TQueryResult.cxx:294
TQueryResult::GetMergeTime
Float_t GetMergeTime() const
Definition: TQueryResult.h:141
bool
TQueryResult::fLogFile
TMacro * fLogFile
file with log messages from the query
Definition: TQueryResult.h:68
TQueryResult::kAborted
@ kAborted
Definition: TQueryResult.h:53
TQueryResult::GetOutputList
TList * GetOutputList()
Definition: TQueryResult.h:136
TQueryResult::SetFinalized
virtual void SetFinalized()
Definition: TQueryResult.h:96
TQueryResult::IsDraw
Bool_t IsDraw() const
Definition: TQueryResult.h:149
TQueryResult::SetMergeTime
void SetMergeTime(Float_t mergetime)
Definition: TQueryResult.h:103
TQueryResult::fBytes
Long64_t fBytes
number of bytes processed
Definition: TQueryResult.h:67
TTreePlayer
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition: TTreePlayer.h:37
TQueryResult::fEntries
Long64_t fEntries
number of entries processed
Definition: TQueryResult.h:65
TQueryResult::RecordEnd
virtual void RecordEnd(EQueryStatus status, TList *outlist=0)
End of query settings.
Definition: TQueryResult.cxx:246
TQueryResult::GetStartTime
TDatime GetStartTime() const
Definition: TQueryResult.h:122
TQueryResult::GetInputObject
TObject * GetInputObject(const char *classname) const
Return first instance of class 'classname' in the input list.
Definition: TQueryResult.cxx:516
TQueryResult::GetLibList
const char * GetLibList() const
Definition: TQueryResult.h:134
TQueryResult::AddLogLine
void AddLogLine(const char *logline)
Fill log file.
Definition: TQueryResult.cxx:285
TQueryResult::SetRecvTime
void SetRecvTime(Float_t recvtime)
Definition: TQueryResult.h:104
TQueryResult::GetEntries
Long64_t GetEntries() const
Definition: TQueryResult.h:127
TQueryResult::GetInitTime
Float_t GetInitTime() const
Definition: TQueryResult.h:139
TQueryResult::GetSelecHdr
TMacro * GetSelecHdr() const
Definition: TQueryResult.h:132
TQueryResult::GetResultFile
const char * GetResultFile() const
Definition: TQueryResult.h:137
TQueryResult::SetInputList
virtual void SetInputList(TList *in, Bool_t adopt=kTRUE)
Set / change the input list.
Definition: TQueryResult.cxx:431
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TQueryResult::fInitTime
Float_t fInitTime
Initialization time (seconds) (millisec precision)
Definition: TQueryResult.h:78
TQueryResult::TQueryResult
TQueryResult()
Definition: TQueryResult.h:109
TQueryResult::fArchived
Bool_t fArchived
whether the query has been archived
Definition: TQueryResult.h:75
TQueryResult::kSubmitted
@ kSubmitted
Definition: TQueryResult.h:53
TQueryResult::GetPrepTime
Float_t GetPrepTime() const
Definition: TQueryResult.h:138
TQueryResult::Matches
Bool_t Matches(const char *ref)
Return TRUE if reference ref matches.
Definition: TQueryResult.cxx:502
TProofPlayerRemote
Definition: TProofPlayer.h:279
TQueryResult::IsFinalized
Bool_t IsFinalized() const
Definition: TQueryResult.h:150
TQueryResult::GetEndTime
TDatime GetEndTime() const
Definition: TQueryResult.h:123
TQueryResult::SetPrepTime
void SetPrepTime(Float_t preptime)
Definition: TQueryResult.h:102
TQueryResult::GetUsedCPU
Float_t GetUsedCPU() const
Definition: TQueryResult.h:130
TQueryResult::~TQueryResult
virtual ~TQueryResult()
Destructor.
Definition: TQueryResult.cxx:109
TQueryResult::GetInputList
TList * GetInputList()
Definition: TQueryResult.h:125
TQueryResult::GetSelecImp
TMacro * GetSelecImp() const
Definition: TQueryResult.h:133
TQueryResult::fTermTime
Float_t fTermTime
Terminate time (seconds) (millisec precision)
Definition: TQueryResult.h:82
TQueryResult::EQueryStatus
EQueryStatus
Definition: TQueryResult.h:52
TMacro
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
TQueryResult::GetTermTime
Float_t GetTermTime() const
Definition: TQueryResult.h:143
TQueryResult::GetNumWrks
Int_t GetNumWrks() const
Definition: TQueryResult.h:144
TQueryResult::SetProcessInfo
virtual void SetProcessInfo(Long64_t ent, Float_t cpu=0., Long64_t siz=-1, Float_t inittime=0., Float_t proctime=0.)
Set processing info.
Definition: TQueryResult.cxx:272
TQueryResult::fStatus
EQueryStatus fStatus
query status
Definition: TQueryResult.h:59
TProofServ
Class providing the PROOF server.
Definition: TProofServ.h:66
TQueryResult::GetProcTime
Float_t GetProcTime() const
Definition: TQueryResult.h:140
TQueryResult::GetFirst
Long64_t GetFirst() const
Definition: TQueryResult.h:128
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TQueryResult::kRunning
@ kRunning
Definition: TQueryResult.h:53
TQueryResult::SetOutputList
virtual void SetOutputList(TList *out, Bool_t adopt=kTRUE)
Set / change the output list.
Definition: TQueryResult.cxx:457
TQueryResult::fNumWrks
Int_t fNumWrks
Number of workers at start.
Definition: TQueryResult.h:83
TQueryResultManager
Class managing the query-result area.
Definition: TQueryResultManager.h:35
TProof
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:316
TQueryResult::GetBytes
Long64_t GetBytes() const
Definition: TQueryResult.h:129
TDatime
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:37
TQueryResult::GetSeqNum
Int_t GetSeqNum() const
Definition: TQueryResult.h:120
TQueryResult::IsArchived
Bool_t IsArchived() const
Definition: TQueryResult.h:147
TQueryResult::GetNumMergers
Int_t GetNumMergers() const
Definition: TQueryResult.h:145
TQueryResult::fSeqNum
Int_t fSeqNum
query unique sequential number
Definition: TQueryResult.h:57
operator!=
Bool_t operator!=(const TQueryResult &qr1, const TQueryResult &qr2)
Definition: TQueryResult.h:159
TQueryResult::fStart
TDatime fStart
time when processing started
Definition: TQueryResult.h:60
operator==
Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2)
Compare two query result instances for equality.
Definition: TQueryResult.cxx:491
TQueryResult::fMergeTime
Float_t fMergeTime
Merging time (seconds) (millisec precision)
Definition: TQueryResult.h:80
TQueryResult::fDraw
Bool_t fDraw
true if draw action query
Definition: TQueryResult.h:58
TQueryResult::kCompleted
@ kCompleted
Definition: TQueryResult.h:53
TList
A doubly linked list.
Definition: TList.h:44
TQueryResult::fInputList
TList * fInputList
input list; contains also data sets, entry list, ...
Definition: TQueryResult.h:64
TQueryResult::fRecvTime
Float_t fRecvTime
Transfer-to-client time (seconds) (millisec precision)
Definition: TQueryResult.h:81
int
TQueryResult::SetNumMergers
void SetNumMergers(Int_t nmergers)
Definition: TQueryResult.h:106
TQueryResult::fSelecImp
TMacro * fSelecImp
selector implementation file
Definition: TQueryResult.h:70
TQueryResult::GetStatus
EQueryStatus GetStatus() const
Definition: TQueryResult.h:121
TQueryResult::GetParList
const char * GetParList() const
Definition: TQueryResult.h:135