Logo ROOT  
Reference Guide
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
8class TGlobal;
9
10// Standard
11#include <string>
12
13
14namespace PyROOT {
15
16// initialize ROOT
17 void InitRoot();
18
19// construct a Python shadow class for the named C++ class
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 );
29
30// clean up all objects controlled by TMemoryRegulator
32
33// bind a ROOT object into a Python object
35 Bool_t isRef = kFALSE, Bool_t isValue = kFALSE );
37 Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, Bool_t isRef = kFALSE );
39 Cppyy::TCppObject_t object, const std::string& clName, Bool_t isRef = kFALSE )
40 {
41 return BindCppObject( object, Cppyy::GetScope( clName ), isRef );
42 }
43
46
47} // namespace PyROOT
48
49#endif // !PYROOT_ROOTWRAPPER_H
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
char name[80]
Definition: TGX11.cxx:109
_object PyObject
Definition: TPyArg.h:20
Global variables class (global variables are obtained from CINT).
Definition: TGlobal.h:28
ptrdiff_t TCppScope_t
Definition: Cppyy.h:15
TCppScope_t TCppType_t
Definition: Cppyy.h:16
TCppScope_t GetScope(const std::string &scope_name)
Definition: Cppyy.cxx:197
void * TCppObject_t
Definition: Cppyy.h:17
PyObject * BindCppObject(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, Bool_t isRef=kFALSE)
if the object is a null pointer, return a typed one (as needed for overloading)
PyObject * GetScopeProxy(Cppyy::TCppScope_t)
Retrieve scope proxy from the known ones.
PyObject * BindCppGlobal(TGlobal *)
gbl == 0 means global does not exist (rather than gbl is NULL pointer)
void InitRoot()
PyObject * BindCppObjectArray(Cppyy::TCppObject_t address, Cppyy::TCppType_t klass, Int_t size)
TODO: this function exists for symmetry; need to figure out if it's useful.
PyObject * CreateScopeProxy(Cppyy::TCppScope_t)
Convenience function with a lookup first through the known existing proxies.
PyObject * GetCppGlobal(const std::string &name)
try named global variable/enum (first ROOT, then Cling: sync is too slow)
PyObject * BindCppObjectNoCast(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, Bool_t isRef=kFALSE, Bool_t isValue=kFALSE)
only known or knowable objects will be bound (null object is ok)
PyObject * ClearProxiedObjects()
Delete all memory-regulated objects.