ROOT logo
// @(#)root/proof:$Id: TVirtualProofPlayer.h 26382 2008-11-22 17:18:42Z ganis $
// Author: Fons Rademakers   15/03/07

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TVirtualProofPlayer
#define ROOT_TVirtualProofPlayer


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TVirtualProofPlayer                                                  //
//                                                                      //
// Abstract interface for the PROOF player.                             //
// See the concrete implementations under 'proofplayer' for details.    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TQObject
#include "TQObject.h"
#endif

class TDSet;
class TDSetElement;
class TEventList;
class TQueryResult;
class TDrawFeedback;
class TList;
class TSlave;
class TMessage;
class TProof;
class TSocket;
class TVirtualPacketizer;
class TProofProgressStatus;


class TVirtualProofPlayer : public TObject, public TQObject {

public:
   enum EExitStatus { kFinished, kStopped, kAborted };

   TVirtualProofPlayer() { }
   virtual ~TVirtualProofPlayer() { }

   virtual Long64_t  Process(TDSet *set,
                             const char *selector, Option_t *option = "",
                             Long64_t nentries = -1, Long64_t firstentry = 0) = 0;
   virtual Long64_t  Finalize(Bool_t force = kFALSE, Bool_t sync = kFALSE) = 0;
   virtual Long64_t  Finalize(TQueryResult *qr) = 0;
   virtual Long64_t  DrawSelect(TDSet *set, const char *varexp,
                                const char *selection, Option_t *option = "",
                                Long64_t nentries = -1, Long64_t firstentry = 0) = 0;
   virtual Int_t     GetDrawArgs(const char *var, const char *sel, Option_t *opt,
                                 TString &selector, TString &objname) = 0;
   virtual void      HandleGetTreeHeader(TMessage *mess) = 0;
   virtual void      HandleRecvHisto(TMessage *mess) = 0;

   virtual void      StopProcess(Bool_t abort, Int_t timeout = -1) = 0;
   virtual void      AddInput(TObject *inp) = 0;
   virtual void      ClearInput() = 0;
   virtual TObject  *GetOutput(const char *name) const = 0;
   virtual TList    *GetOutputList() const = 0;
   virtual TList    *GetInputList() const = 0;
   virtual TList    *GetListOfResults() const = 0;
   virtual void      AddQueryResult(TQueryResult *q) = 0;
   virtual TQueryResult *GetCurrentQuery() const = 0;
   virtual TQueryResult *GetQueryResult(const char *ref) = 0;
   virtual void      RemoveQueryResult(const char *ref) = 0;
   virtual void      SetCurrentQuery(TQueryResult *q) = 0;
   virtual void      SetMaxDrawQueries(Int_t max) = 0;
   virtual void      RestorePreviousQuery() =0 ;
   virtual Int_t     AddOutputObject(TObject *obj) = 0;
   virtual void      AddOutput(TList *out) = 0;   // Incorporate a list
   virtual void      StoreOutput(TList *out) = 0;   // Adopts the list
   virtual void      StoreFeedback(TObject *slave, TList *out) = 0; // Adopts the list
   virtual void      Progress(Long64_t total, Long64_t processed) = 0; // *SIGNAL*
   virtual void      Progress(TSlave *, Long64_t total, Long64_t processed) = 0;
   virtual void      Progress(Long64_t total, Long64_t processed, Long64_t bytesread,
                              Float_t initTime, Float_t procTime,
                              Float_t evtrti, Float_t mbrti) = 0; // *SIGNAL*
   virtual void      Progress(TSlave *, Long64_t total, Long64_t processed,
                              Long64_t bytesread, Float_t initTime, Float_t procTime,
                              Float_t evtrti, Float_t mbrti) = 0; // *SIGNAL*
   virtual void      Feedback(TList *objs) = 0; // *SIGNAL*

   virtual TDrawFeedback *CreateDrawFeedback(TProof *p) = 0;
   virtual void           SetDrawFeedbackOption(TDrawFeedback *f, Option_t *opt) = 0;
   virtual void           DeleteDrawFeedback(TDrawFeedback *f) = 0;

   virtual TDSetElement *GetNextPacket(TSlave *slave, TMessage *r) = 0;

   virtual Int_t     ReinitSelector(TQueryResult *qr) = 0;

   virtual void      UpdateAutoBin(const char *name,
                                   Double_t& xmin, Double_t& xmax,
                                   Double_t& ymin, Double_t& ymax,
                                   Double_t& zmin, Double_t& zmax) = 0;

   virtual Bool_t    IsClient() const = 0;

   virtual EExitStatus GetExitStatus() const = 0;
   virtual Long64_t    GetEventsProcessed() const = 0;
   virtual void        AddEventsProcessed(Long64_t ev) = 0;
   virtual TProofProgressStatus*  GetProgressStatus() const = 0;

   virtual void      SetDispatchTimer(Bool_t on = kTRUE) = 0;
   virtual void      SetStopTimer(Bool_t on = kTRUE,
                                  Bool_t abort = kFALSE, Int_t timeout = 0) = 0;
   virtual void      SetInitTime() = 0;

   virtual TVirtualPacketizer   *GetPacketizer() const { return 0; }
   static TVirtualProofPlayer *Create(const char *player, TProof *p, TSocket *s = 0);

   ClassDef(TVirtualProofPlayer,0)  // Abstract PROOF player
};

#endif
 TVirtualProofPlayer.h:1
 TVirtualProofPlayer.h:2
 TVirtualProofPlayer.h:3
 TVirtualProofPlayer.h:4
 TVirtualProofPlayer.h:5
 TVirtualProofPlayer.h:6
 TVirtualProofPlayer.h:7
 TVirtualProofPlayer.h:8
 TVirtualProofPlayer.h:9
 TVirtualProofPlayer.h:10
 TVirtualProofPlayer.h:11
 TVirtualProofPlayer.h:12
 TVirtualProofPlayer.h:13
 TVirtualProofPlayer.h:14
 TVirtualProofPlayer.h:15
 TVirtualProofPlayer.h:16
 TVirtualProofPlayer.h:17
 TVirtualProofPlayer.h:18
 TVirtualProofPlayer.h:19
 TVirtualProofPlayer.h:20
 TVirtualProofPlayer.h:21
 TVirtualProofPlayer.h:22
 TVirtualProofPlayer.h:23
 TVirtualProofPlayer.h:24
 TVirtualProofPlayer.h:25
 TVirtualProofPlayer.h:26
 TVirtualProofPlayer.h:27
 TVirtualProofPlayer.h:28
 TVirtualProofPlayer.h:29
 TVirtualProofPlayer.h:30
 TVirtualProofPlayer.h:31
 TVirtualProofPlayer.h:32
 TVirtualProofPlayer.h:33
 TVirtualProofPlayer.h:34
 TVirtualProofPlayer.h:35
 TVirtualProofPlayer.h:36
 TVirtualProofPlayer.h:37
 TVirtualProofPlayer.h:38
 TVirtualProofPlayer.h:39
 TVirtualProofPlayer.h:40
 TVirtualProofPlayer.h:41
 TVirtualProofPlayer.h:42
 TVirtualProofPlayer.h:43
 TVirtualProofPlayer.h:44
 TVirtualProofPlayer.h:45
 TVirtualProofPlayer.h:46
 TVirtualProofPlayer.h:47
 TVirtualProofPlayer.h:48
 TVirtualProofPlayer.h:49
 TVirtualProofPlayer.h:50
 TVirtualProofPlayer.h:51
 TVirtualProofPlayer.h:52
 TVirtualProofPlayer.h:53
 TVirtualProofPlayer.h:54
 TVirtualProofPlayer.h:55
 TVirtualProofPlayer.h:56
 TVirtualProofPlayer.h:57
 TVirtualProofPlayer.h:58
 TVirtualProofPlayer.h:59
 TVirtualProofPlayer.h:60
 TVirtualProofPlayer.h:61
 TVirtualProofPlayer.h:62
 TVirtualProofPlayer.h:63
 TVirtualProofPlayer.h:64
 TVirtualProofPlayer.h:65
 TVirtualProofPlayer.h:66
 TVirtualProofPlayer.h:67
 TVirtualProofPlayer.h:68
 TVirtualProofPlayer.h:69
 TVirtualProofPlayer.h:70
 TVirtualProofPlayer.h:71
 TVirtualProofPlayer.h:72
 TVirtualProofPlayer.h:73
 TVirtualProofPlayer.h:74
 TVirtualProofPlayer.h:75
 TVirtualProofPlayer.h:76
 TVirtualProofPlayer.h:77
 TVirtualProofPlayer.h:78
 TVirtualProofPlayer.h:79
 TVirtualProofPlayer.h:80
 TVirtualProofPlayer.h:81
 TVirtualProofPlayer.h:82
 TVirtualProofPlayer.h:83
 TVirtualProofPlayer.h:84
 TVirtualProofPlayer.h:85
 TVirtualProofPlayer.h:86
 TVirtualProofPlayer.h:87
 TVirtualProofPlayer.h:88
 TVirtualProofPlayer.h:89
 TVirtualProofPlayer.h:90
 TVirtualProofPlayer.h:91
 TVirtualProofPlayer.h:92
 TVirtualProofPlayer.h:93
 TVirtualProofPlayer.h:94
 TVirtualProofPlayer.h:95
 TVirtualProofPlayer.h:96
 TVirtualProofPlayer.h:97
 TVirtualProofPlayer.h:98
 TVirtualProofPlayer.h:99
 TVirtualProofPlayer.h:100
 TVirtualProofPlayer.h:101
 TVirtualProofPlayer.h:102
 TVirtualProofPlayer.h:103
 TVirtualProofPlayer.h:104
 TVirtualProofPlayer.h:105
 TVirtualProofPlayer.h:106
 TVirtualProofPlayer.h:107
 TVirtualProofPlayer.h:108
 TVirtualProofPlayer.h:109
 TVirtualProofPlayer.h:110
 TVirtualProofPlayer.h:111
 TVirtualProofPlayer.h:112
 TVirtualProofPlayer.h:113
 TVirtualProofPlayer.h:114
 TVirtualProofPlayer.h:115
 TVirtualProofPlayer.h:116
 TVirtualProofPlayer.h:117
 TVirtualProofPlayer.h:118
 TVirtualProofPlayer.h:119
 TVirtualProofPlayer.h:120
 TVirtualProofPlayer.h:121
 TVirtualProofPlayer.h:122
 TVirtualProofPlayer.h:123
 TVirtualProofPlayer.h:124
 TVirtualProofPlayer.h:125
 TVirtualProofPlayer.h:126