Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RootWrapper.h
Go to the documentation of this file.
1 // @(#)root/pyroot:$Id$
2 // Author: Wim Lavrijsen, Apr 2004
3 
4 #ifndef PYROOT_ROOTWRAPPER_H
5 #define PYROOT_ROOTWRAPPER_H
6 
7 // ROOT
8 class TGlobal;
9 
10 // Standard
11 #include <string>
12 
13 
14 namespace PyROOT {
15 
16 // initialize ROOT
17  void InitRoot();
18 
19 // construct a Python shadow class for the named C++ class
20  PyObject* GetScopeProxy( Cppyy::TCppScope_t );
21  PyObject* CreateScopeProxy( Cppyy::TCppScope_t );
22  PyObject* CreateScopeProxy( PyObject*, PyObject* args );
23  PyObject* CreateScopeProxy(
24  const std::string& scope_name, PyObject* parent = 0 );
25 
26 // convenience function to retrieve global variables and enums
27  PyObject* GetCppGlobal( const std::string& name );
28  PyObject* GetCppGlobal( PyObject*, PyObject* args );
29 
30 // clean up all objects controlled by TMemoryRegulator
31  PyObject *ClearProxiedObjects();
32 
33 // bind a ROOT object into a Python object
34  PyObject* BindCppObjectNoCast( Cppyy::TCppObject_t object, Cppyy::TCppType_t klass,
35  Bool_t isRef = kFALSE, Bool_t isValue = kFALSE );
36  PyObject* BindCppObject(
37  Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, Bool_t isRef = kFALSE );
38  inline PyObject* BindCppObject(
39  Cppyy::TCppObject_t object, const std::string& clName, Bool_t isRef = kFALSE )
40  {
41  return BindCppObject( object, Cppyy::GetScope( clName ), isRef );
42  }
43 
44  PyObject* BindCppObjectArray( Cppyy::TCppObject_t address, Cppyy::TCppType_t klass, Int_t size );
45  PyObject* BindCppGlobal( TGlobal* );
46 
47 } // namespace PyROOT
48 
49 #endif // !PYROOT_ROOTWRAPPER_H