TPySelector.h

Go to the documentation of this file.
00001 // Author: Wim Lavrijsen   March 2008
00002 
00003 #ifndef ROOT_TPySelector
00004 #define ROOT_TPySelector
00005 
00006 //////////////////////////////////////////////////////////////////////////////
00007 //                                                                          //
00008 // TPySelector                                                              //
00009 //                                                                          //
00010 // Python base class equivalent of PROOF TSelector.                         //
00011 //                                                                          //
00012 //////////////////////////////////////////////////////////////////////////////
00013 
00014 
00015 //- ROOT
00016 #ifndef ROOT_TSelector
00017 #include "TSelector.h"
00018 #endif
00019 
00020 #ifndef ROOT_TTree
00021 #include "TTree.h"
00022 #endif
00023 
00024 // Python
00025 struct _object;
00026 typedef _object PyObject;
00027 
00028 
00029 class TPySelector : public TSelector {
00030 public:
00031    using TSelector::fStatus;
00032 // using TSelector::fAbort;
00033    using TSelector::fOption;
00034    using TSelector::fObject;
00035    using TSelector::fInput;
00036    using TSelector::fOutput;
00037 
00038 public:
00039    TTree* fChain;
00040 
00041 public:
00042 // ctor/dtor ... cctor and assignment are private in base class
00043    TPySelector( TTree* /* tree */ = 0, PyObject* self = 0 );
00044    virtual ~TPySelector();
00045 
00046 // TSelector set of forwarded (overridden) methods
00047    virtual Int_t  Version() const;
00048    virtual Int_t  GetEntry( Long64_t entry, Int_t getall = 0 );
00049    virtual Bool_t Notify();
00050 
00051    virtual void   Init( TTree* tree );
00052    virtual void   Begin( TTree* tree = 0 /* not used */ );
00053    virtual void   SlaveBegin( TTree* tree );
00054    virtual Bool_t Process( Long64_t entry );
00055    virtual void   SlaveTerminate();
00056    virtual void   Terminate();
00057 
00058    virtual void Abort( const char* why, EAbort what = kAbortProcess );
00059 
00060    ClassDef( TPySelector, 1 );   //Python equivalent base class for PROOF
00061 
00062 private:
00063 // private helpers for forwarding to python
00064    void SetupPySelf();
00065    PyObject* CallSelf( const char* method, PyObject* pyobject = 0 );
00066 
00067 private:
00068    PyObject* fPySelf;              //! actual python object
00069 };
00070 
00071 #endif

Generated on Tue Jul 5 14:10:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1