Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPySelector.h
Go to the documentation of this file.
1 // Author: Wim Lavrijsen March 2008
2 
3 #ifndef ROOT_TPySelector
4 #define ROOT_TPySelector
5 
6 //////////////////////////////////////////////////////////////////////////////
7 // //
8 // TPySelector //
9 // //
10 // Python base class equivalent of PROOF TSelector. //
11 // //
12 //////////////////////////////////////////////////////////////////////////////
13 
14 
15 //- ROOT
16 #include "TSelector.h"
17 
18 #include "TTree.h"
19 
20 // Python
21 struct _object;
22 typedef _object PyObject;
23 
24 
25 class TPySelector : public TSelector {
26 public:
27  using TSelector::fStatus;
28 // using TSelector::fAbort;
29  using TSelector::fOption;
30  using TSelector::fObject;
31  using TSelector::fInput;
32  using TSelector::fOutput;
33 
34 public:
35  TTree* fChain;
36 
37 public:
38 // ctor/dtor ... cctor and assignment are private in base class
39  TPySelector( TTree* /* tree */ = 0, PyObject* self = 0 );
40  virtual ~TPySelector();
41 
42 // TSelector set of forwarded (overridden) methods
43  virtual Int_t Version() const;
44  virtual Int_t GetEntry( Long64_t entry, Int_t getall = 0 );
45  virtual Bool_t Notify();
46 
47  virtual void Init( TTree* tree );
48  virtual void Begin( TTree* tree = 0 /* not used */ );
49  virtual void SlaveBegin( TTree* tree );
50  virtual Bool_t Process( Long64_t entry );
51  virtual void SlaveTerminate();
52  virtual void Terminate();
53 
54  virtual void Abort( const char* why, EAbort what = kAbortProcess );
55 
56  ClassDef( TPySelector, 1 ); //Python equivalent base class for PROOF
57 
58 private:
59 // private helpers for forwarding to python
60  void SetupPySelf();
61  PyObject* CallSelf( const char* method, PyObject* pyobject = 0 );
62 
63 private:
64  PyObject* fPySelf; //! actual python object
65 };
66 
67 #endif