00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ROOT_TQueryResultManager
00014 #define ROOT_TQueryResultManager
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027 #ifndef ROOT_TStopwatch
00028 #include "TStopwatch.h"
00029 #endif
00030 #ifndef ROOT_TString
00031 #include "TString.h"
00032 #endif
00033
00034 class TList;
00035 class TProof;
00036 class TProofLockPath;
00037 class TProofQueryResult;
00038 class TQueryResult;
00039 class TVirtualProofPlayer;
00040
00041 class TQueryResultManager : public TObject {
00042
00043 private:
00044 TString fQueryDir;
00045 TString fSessionTag;
00046 TString fSessionDir;
00047 Int_t fSeqNum;
00048 Int_t fDrawQueries;
00049 Int_t fKeptQueries;
00050 TList *fQueries;
00051 TList *fPreviousQueries;
00052 TProofLockPath *fLock;
00053 FILE *fLogFile;
00054 TStopwatch fCompute;
00055
00056 void AddLogFile(TProofQueryResult *pq);
00057
00058 public:
00059 TQueryResultManager(const char *qdir, const char *stag, const char *sdir,
00060 TProofLockPath *lck, FILE *logfile = 0);
00061 virtual ~TQueryResultManager();
00062
00063 const char *QueryDir() const { return fQueryDir.Data(); }
00064 Int_t SeqNum() const { return fSeqNum; }
00065 Int_t DrawQueries() const { return fDrawQueries; }
00066 Int_t KeptQueries() const { return fKeptQueries; }
00067 TList *Queries() const { return fQueries; }
00068 TList *PreviousQueries() const { return fPreviousQueries; }
00069
00070 void IncrementSeqNum() { fSeqNum++; }
00071 void IncrementDrawQueries() { fDrawQueries++; }
00072
00073 Int_t ApplyMaxQueries(Int_t mxq);
00074 Int_t CleanupQueriesDir();
00075 Bool_t FinalizeQuery(TProofQueryResult *pq,
00076 TProof *proof, TVirtualProofPlayer *player);
00077 Float_t GetCpuTime() { return fCompute.CpuTime(); }
00078 Float_t GetRealTime() { return fCompute.RealTime(); }
00079 TProofQueryResult *LocateQuery(TString queryref, Int_t &qry, TString &qdir);
00080 void RemoveQuery(TQueryResult *qr, Bool_t soft = kFALSE);
00081 void RemoveQuery(const char *queryref, TList *otherlist = 0);
00082 void ResetTime() { fCompute.Start(); }
00083 void SaveQuery(TProofQueryResult *qr, const char *fout = 0);
00084 void SaveQuery(TProofQueryResult *qr, Int_t mxq);
00085
00086 Int_t LockSession(const char *sessiontag, TProofLockPath **lck);
00087 Int_t CleanupSession(const char *sessiontag);
00088 void ScanPreviousQueries(const char *dir);
00089
00090 ClassDef(TQueryResultManager,0)
00091 };
00092
00093 #endif
00094