ROOT logo
// Author: Wim Lavrijsen   Aug 2007

#ifndef ROOT_TPyDispatcher
#define ROOT_TPyDispatcher

//////////////////////////////////////////////////////////////////////////////
//                                                                          //
// TPyDispatcher                                                            //
//                                                                          //
// Dispatcher for CINT callbacks into python code.                          //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////


// ROOT
#ifndef ROOT_TObject
#include "TObject.h"
#endif

// Python
struct _object;
typedef _object PyObject;


class TPyDispatcher : public TObject {
public:
   TPyDispatcher( PyObject* callable );
   TPyDispatcher( const TPyDispatcher& );
   TPyDispatcher& operator=( const TPyDispatcher& );
   ~TPyDispatcher();

public:
#ifndef __CINT__
   PyObject* DispatchVA( const char* format = 0, ... );
#else
   PyObject* DispatchVA( const char* format, ... );
#endif

// pre-defined dispatches, same as per TQObject::Emit(); note that
// Emit() maps exclusively to this set, so several builtin types (e.g.
// Int_t, Bool_t, Float_t, etc.) have been omitted here
   PyObject* Dispatch() { return DispatchVA( 0 ); }
   PyObject* Dispatch( const char* param ) { return DispatchVA( "s", param ); }
   PyObject* Dispatch( Double_t param )    { return DispatchVA( "d", param ); }
   PyObject* Dispatch( Long_t param )      { return DispatchVA( "l", param ); }
   PyObject* Dispatch( Long64_t param )    { return DispatchVA( "L", param ); }

   ClassDef( TPyDispatcher, 1 );   // Python dispatcher class

private:
   PyObject* fCallable;            //! callable object to be dispatched
};

#endif
 TPyDispatcher.h:1
 TPyDispatcher.h:2
 TPyDispatcher.h:3
 TPyDispatcher.h:4
 TPyDispatcher.h:5
 TPyDispatcher.h:6
 TPyDispatcher.h:7
 TPyDispatcher.h:8
 TPyDispatcher.h:9
 TPyDispatcher.h:10
 TPyDispatcher.h:11
 TPyDispatcher.h:12
 TPyDispatcher.h:13
 TPyDispatcher.h:14
 TPyDispatcher.h:15
 TPyDispatcher.h:16
 TPyDispatcher.h:17
 TPyDispatcher.h:18
 TPyDispatcher.h:19
 TPyDispatcher.h:20
 TPyDispatcher.h:21
 TPyDispatcher.h:22
 TPyDispatcher.h:23
 TPyDispatcher.h:24
 TPyDispatcher.h:25
 TPyDispatcher.h:26
 TPyDispatcher.h:27
 TPyDispatcher.h:28
 TPyDispatcher.h:29
 TPyDispatcher.h:30
 TPyDispatcher.h:31
 TPyDispatcher.h:32
 TPyDispatcher.h:33
 TPyDispatcher.h:34
 TPyDispatcher.h:35
 TPyDispatcher.h:36
 TPyDispatcher.h:37
 TPyDispatcher.h:38
 TPyDispatcher.h:39
 TPyDispatcher.h:40
 TPyDispatcher.h:41
 TPyDispatcher.h:42
 TPyDispatcher.h:43
 TPyDispatcher.h:44
 TPyDispatcher.h:45
 TPyDispatcher.h:46
 TPyDispatcher.h:47
 TPyDispatcher.h:48
 TPyDispatcher.h:49
 TPyDispatcher.h:50
 TPyDispatcher.h:51
 TPyDispatcher.h:52
 TPyDispatcher.h:53
 TPyDispatcher.h:54