TQueryResult.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TQueryResult.h 34755 2010-08-10 10:47:41Z rdm $
00002 // Author: G Ganis Sep 2005
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TQueryResult
00013 #define ROOT_TQueryResult
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TQueryResult                                                         //
00019 //                                                                      //
00020 // A container class for the results of a query.                        //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TNamed
00025 #include "TNamed.h"
00026 #endif
00027 #ifndef ROOT_TDatime
00028 #include "TDatime.h"
00029 #endif
00030 #ifndef ROOT_TMacro
00031 #include "TMacro.h"
00032 #endif
00033 #ifndef ROOT_TString
00034 #include "TString.h"
00035 #endif
00036 
00037 class TBrowser;
00038 class TTreePlayer;
00039 class TQueryResult;
00040 
00041 Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2);
00042 
00043 
00044 class TQueryResult : public TNamed {
00045 
00046 friend class TTreePlayer;
00047 friend class TProofPlayerLite;
00048 friend class TProofPlayerRemote;
00049 friend class TProof;
00050 friend class TProofLite;
00051 friend class TProofServ;
00052 friend class TQueryResultManager;
00053 
00054 public:
00055    enum EQueryStatus {
00056       kAborted = 0, kSubmitted, kRunning, kStopped, kCompleted
00057    };
00058 
00059 protected:
00060    Int_t           fSeqNum;       //query unique sequential number
00061    Bool_t          fDraw;         //true if draw action query
00062    EQueryStatus    fStatus;       //query status
00063    TDatime         fStart;        //time when processing started
00064    TDatime         fEnd;          //time when processing ended
00065    Float_t         fUsedCPU;      //real CPU time used (seconds)
00066    TString         fOptions;      //processing options + aclic mode (<opt>#<aclic_mode>)
00067    TList          *fInputList;    //input list; contains also data sets, entry list, ...
00068    Long64_t        fEntries;      //number of entries processed
00069    Long64_t        fFirst;        //first entry processed
00070    Long64_t        fBytes;        //number of bytes processed
00071    TMacro         *fLogFile;      //file with log messages from the query
00072    TMacro         *fSelecHdr;     //selector header file
00073    TMacro         *fSelecImp;     //selector implementation file
00074    TString         fLibList;      //blank-separated list of libs loaded at fStart
00075    TString         fParList;      //colon-separated list of PAR loaded at fStart
00076    TList          *fOutputList;   //output list
00077    Bool_t          fFinalized;    //whether Terminate has been run
00078    Bool_t          fArchived;     //whether the query has been archived
00079    TString         fResultFile;   //URL of the file where results have been archived
00080    Float_t         fInitTime;     //Initialization time (seconds) (millisec precision)
00081    Float_t         fProcTime;     //Processing time (seconds) (millisec precision)
00082    Int_t           fNumWrks;      //Number of workers at start
00083 
00084    TQueryResult(Int_t seqnum, const char *opt, TList *inlist,
00085                 Long64_t entries, Long64_t first,
00086                 const char *selec);
00087 
00088    void            AddInput(TObject *obj);
00089    void            AddLogLine(const char *logline);
00090    TQueryResult   *CloneInfo();
00091    virtual void    RecordEnd(EQueryStatus status, TList *outlist = 0);
00092    void            SaveSelector(const char *selec);
00093    void            SetArchived(const char *archfile);
00094    virtual void    SetFinalized() { fFinalized = kTRUE; }
00095    virtual void    SetInputList(TList *in, Bool_t adopt = kTRUE);
00096    virtual void    SetOutputList(TList *out, Bool_t adopt = kTRUE);
00097    virtual void    SetProcessInfo(Long64_t ent, Float_t cpu = 0.,
00098                                   Long64_t siz = -1,
00099                                   Float_t inittime = 0., Float_t proctime = 0.);
00100 
00101 public:
00102    TQueryResult() : fSeqNum(-1), fDraw(0), fStatus(kSubmitted), fUsedCPU(0.),
00103                     fInputList(0), fEntries(-1), fFirst(-1), fBytes(0),
00104                     fLogFile(0), fSelecHdr(0), fSelecImp(0),
00105                     fLibList("-"), fOutputList(0),
00106                     fFinalized(kFALSE), fArchived(kFALSE),
00107                     fInitTime(0.), fProcTime(0.), fNumWrks(-1) { }
00108    virtual ~TQueryResult();
00109 
00110    void           Browse(TBrowser *b = 0);
00111 
00112    Int_t          GetSeqNum() const { return fSeqNum; }
00113    EQueryStatus   GetStatus() const { return fStatus; }
00114    TDatime        GetStartTime() const { return fStart; }
00115    TDatime        GetEndTime() const { return fEnd; }
00116    const char    *GetOptions() const { return fOptions; }
00117    TList         *GetInputList() { return fInputList; }
00118    TObject       *GetInputObject(const char *classname) const;
00119    Long64_t       GetEntries() const { return fEntries; }
00120    Long64_t       GetFirst() const { return fFirst; }
00121    Long64_t       GetBytes() const { return fBytes; }
00122    Float_t        GetUsedCPU() const { return fUsedCPU; }
00123    TMacro        *GetLogFile() const { return fLogFile; }
00124    TMacro        *GetSelecHdr() const { return fSelecHdr; }
00125    TMacro        *GetSelecImp() const { return fSelecImp; }
00126    const char    *GetLibList() const { return fLibList; }
00127    const char    *GetParList() const { return fParList; }
00128    TList         *GetOutputList() { return fOutputList; }
00129    const char    *GetResultFile() const { return fResultFile; }
00130    Float_t        GetInitTime() const { return fInitTime; }
00131    Float_t        GetProcTime() const { return fProcTime; }
00132    Int_t          GetNumWrks() const { return fNumWrks; }
00133 
00134    Bool_t         IsArchived() const { return fArchived; }
00135    virtual Bool_t IsDone() const { return (fStatus > kRunning); }
00136    Bool_t         IsDraw() const { return fDraw; }
00137    Bool_t         IsFinalized() const { return fFinalized; }
00138 
00139    Bool_t         Matches(const char *ref);
00140 
00141    void Print(Option_t *opt = "") const;
00142 
00143    ClassDef(TQueryResult,4)  //Class describing a query
00144 };
00145 
00146 inline Bool_t operator!=(const TQueryResult &qr1,  const TQueryResult &qr2)
00147    { return !(qr1 == qr2); }
00148 
00149 #endif

Generated on Tue Jul 5 14:28:07 2011 for ROOT_528-00b_version by  doxygen 1.5.1