#ifndef ROOT_TQueryResultManager
#define ROOT_TQueryResultManager
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TStopwatch
#include "TStopwatch.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class TList;
class TProof;
class TProofLockPath;
class TProofQueryResult;
class TQueryResult;
class TVirtualProofPlayer;
class TQueryResultManager : public TObject {
private:
TString fQueryDir;
TString fSessionTag;
TString fSessionDir;
Int_t fSeqNum;
Int_t fDrawQueries;
Int_t fKeptQueries;
TList *fQueries;
TList *fPreviousQueries;
TProofLockPath *fLock;
FILE *fLogFile;
TStopwatch fCompute;
void AddLogFile(TProofQueryResult *pq);
public:
TQueryResultManager(const char *qdir, const char *stag, const char *sdir,
TProofLockPath *lck, FILE *logfile = 0);
virtual ~TQueryResultManager();
const char *QueryDir() const { return fQueryDir.Data(); }
Int_t SeqNum() const { return fSeqNum; }
Int_t DrawQueries() const { return fDrawQueries; }
Int_t KeptQueries() const { return fKeptQueries; }
TList *Queries() const { return fQueries; }
TList *PreviousQueries() const { return fPreviousQueries; }
void IncrementSeqNum() { fSeqNum++; }
void IncrementDrawQueries() { fDrawQueries++; }
Int_t ApplyMaxQueries(Int_t mxq);
Int_t CleanupQueriesDir();
Bool_t FinalizeQuery(TProofQueryResult *pq,
TProof *proof, TVirtualProofPlayer *player);
Float_t GetCpuTime() { return fCompute.CpuTime(); }
Float_t GetRealTime() { return fCompute.RealTime(); }
TProofQueryResult *LocateQuery(TString queryref, Int_t &qry, TString &qdir);
void RemoveQuery(TQueryResult *qr, Bool_t soft = kFALSE);
void RemoveQuery(const char *queryref, TList *otherlist = 0);
void ResetTime() { fCompute.Start(); }
void SaveQuery(TProofQueryResult *qr, const char *fout = 0);
void SaveQuery(TProofQueryResult *qr, Int_t mxq);
Int_t LockSession(const char *sessiontag, TProofLockPath **lck);
Int_t CleanupSession(const char *sessiontag);
void ScanPreviousQueries(const char *dir);
ClassDef(TQueryResultManager,0)
};
#endif