Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TQueryResult.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/tree:$Id$
0002 // Author: G Ganis Sep 2005
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TQueryResult
0013 #define ROOT_TQueryResult
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TQueryResult                                                         //
0019 //                                                                      //
0020 // A container class for the results of a query.                        //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TNamed.h"
0025 #include "TDatime.h"
0026 #include "TString.h"
0027 
0028 #ifdef R__LESS_INCLUDES
0029 class TMacro;
0030 #else
0031 #include "TMacro.h"
0032 #endif
0033 
0034 class TBrowser;
0035 class TTreePlayer;
0036 class TQueryResult;
0037 
0038 bool operator==(const TQueryResult &qr1, const TQueryResult &qr2);
0039 
0040 
0041 class TQueryResult : public TNamed {
0042 
0043 friend class TTreePlayer;
0044 friend class TProofPlayerLite;
0045 friend class TProofPlayerRemote;
0046 friend class TProof;
0047 friend class TProofLite;
0048 friend class TProofServ;
0049 friend class TQueryResultManager;
0050 
0051 public:
0052    enum EQueryStatus {
0053       kAborted = 0, kSubmitted, kRunning, kStopped, kCompleted
0054    };
0055 
0056 protected:
0057    Int_t           fSeqNum;       ///< query unique sequential number
0058    bool            fDraw;         ///< true if draw action query
0059    EQueryStatus    fStatus;       ///< query status
0060    TDatime         fStart;        ///< time when processing started
0061    TDatime         fEnd;          ///< time when processing ended
0062    Float_t         fUsedCPU;      ///< real CPU time used (seconds)
0063    TString         fOptions;      ///< processing options + aclic mode (< opt >#< aclic_mode >)
0064    TList          *fInputList;    ///< input list; contains also data sets, entry list, ...
0065    Long64_t        fEntries;      ///< number of entries processed
0066    Long64_t        fFirst;        ///< first entry processed
0067    Long64_t        fBytes;        ///< number of bytes processed
0068    TMacro         *fLogFile;      ///< file with log messages from the query
0069    TMacro         *fSelecHdr;     ///< selector header file
0070    TMacro         *fSelecImp;     ///< selector implementation file
0071    TString         fLibList;      ///< blank-separated list of libs loaded at fStart
0072    TString         fParList;      ///< colon-separated list of PAR loaded at fStart
0073    TList          *fOutputList;   ///< output list
0074    bool            fFinalized;    ///< whether Terminate has been run
0075    bool            fArchived;     ///< whether the query has been archived
0076    TString         fResultFile;   ///< URL of the file where results have been archived
0077    Float_t         fPrepTime;     ///< Prepare time (seconds) (millisec precision)
0078    Float_t         fInitTime;     ///< Initialization time (seconds) (millisec precision)
0079    Float_t         fProcTime;     ///< Processing time (seconds) (millisec precision)
0080    Float_t         fMergeTime;    ///< Merging time (seconds) (millisec precision)
0081    Float_t         fRecvTime;     ///< Transfer-to-client time (seconds) (millisec precision)
0082    Float_t         fTermTime;     ///< Terminate time (seconds) (millisec precision)
0083    Int_t           fNumWrks;      ///< Number of workers at start
0084    Int_t           fNumMergers;   ///< Number of submergers
0085 
0086    TQueryResult(Int_t seqnum, const char *opt, TList *inlist,
0087                 Long64_t entries, Long64_t first,
0088                 const char *selec);
0089 
0090    void            AddInput(TObject *obj);
0091    void            AddLogLine(const char *logline);
0092    TQueryResult   *CloneInfo();
0093    virtual void    RecordEnd(EQueryStatus status, TList *outlist = nullptr);
0094    void            SaveSelector(const char *selec);
0095    void            SetArchived(const char *archfile);
0096    virtual void    SetFinalized() { fFinalized = true; }
0097    virtual void    SetInputList(TList *in, bool adopt = true);
0098    virtual void    SetOutputList(TList *out, bool adopt = true);
0099    virtual void    SetProcessInfo(Long64_t ent, Float_t cpu = 0.,
0100                                   Long64_t siz = -1,
0101                                   Float_t inittime = 0., Float_t proctime = 0.);
0102    void            SetPrepTime(Float_t preptime) { fPrepTime = preptime; }
0103    void            SetMergeTime(Float_t mergetime) { fMergeTime = mergetime; }
0104    void            SetRecvTime(Float_t recvtime) { fRecvTime = recvtime; }
0105    void            SetTermTime(Float_t termtime) { fTermTime = termtime; }
0106    void            SetNumMergers(Int_t nmergers) { fNumMergers = nmergers; }
0107 
0108 public:
0109    TQueryResult() : fSeqNum(-1), fDraw(false), fStatus(kSubmitted), fUsedCPU(0.),
0110                     fInputList(nullptr), fEntries(-1), fFirst(-1), fBytes(0),
0111                     fLogFile(nullptr), fSelecHdr(nullptr), fSelecImp(nullptr),
0112                     fLibList("-"), fOutputList(nullptr),
0113                     fFinalized(false), fArchived(false), fPrepTime(0.),
0114                     fInitTime(0.), fProcTime(0.), fMergeTime(0.),
0115                     fRecvTime(-1), fTermTime(0.), fNumWrks(-1), fNumMergers(-1) { }
0116    ~TQueryResult() override;
0117 
0118    void           Browse(TBrowser *b = nullptr) override;
0119 
0120    Int_t          GetSeqNum() const { return fSeqNum; }
0121    EQueryStatus   GetStatus() const { return fStatus; }
0122    TDatime        GetStartTime() const { return fStart; }
0123    TDatime        GetEndTime() const { return fEnd; }
0124    const char    *GetOptions() const { return fOptions; }
0125    TList         *GetInputList() { return fInputList; }
0126    TObject       *GetInputObject(const char *classname) const;
0127    Long64_t       GetEntries() const { return fEntries; }
0128    Long64_t       GetFirst() const { return fFirst; }
0129    Long64_t       GetBytes() const { return fBytes; }
0130    Float_t        GetUsedCPU() const { return fUsedCPU; }
0131    TMacro        *GetLogFile() const { return fLogFile; }
0132    TMacro        *GetSelecHdr() const { return fSelecHdr; }
0133    TMacro        *GetSelecImp() const { return fSelecImp; }
0134    const char    *GetLibList() const { return fLibList; }
0135    const char    *GetParList() const { return fParList; }
0136    TList         *GetOutputList() { return fOutputList; }
0137    const char    *GetResultFile() const { return fResultFile; }
0138    Float_t        GetPrepTime() const { return fPrepTime; }
0139    Float_t        GetInitTime() const { return fInitTime; }
0140    Float_t        GetProcTime() const { return fProcTime; }
0141    Float_t        GetMergeTime() const { return fMergeTime; }
0142    Float_t        GetRecvTime() const { return fRecvTime; }
0143    Float_t        GetTermTime() const { return fTermTime; }
0144    Int_t          GetNumWrks() const { return fNumWrks; }
0145    Int_t          GetNumMergers() const { return fNumMergers; }
0146 
0147    bool           IsArchived() const { return fArchived; }
0148    virtual bool   IsDone() const { return (fStatus > kRunning); }
0149    bool           IsDraw() const { return fDraw; }
0150    bool           IsFinalized() const { return fFinalized; }
0151 
0152    bool           Matches(const char *ref);
0153 
0154    void           Print(Option_t *opt = "") const override;
0155 
0156    ClassDefOverride(TQueryResult,5)  //Class describing a query
0157 };
0158 
0159 inline bool operator!=(const TQueryResult &qr1,  const TQueryResult &qr2)
0160    { return !(qr1 == qr2); }
0161 
0162 #endif