17#include "TPyClassGenerator.h"
102 CachedPyString(CachedPyString
const&) =
delete;
103 CachedPyString(CachedPyString &&) =
delete;
104 CachedPyString&
operator=(CachedPyString
const&) =
delete;
105 CachedPyString&
operator=(CachedPyString &&) =
delete;
118 static CachedPyString
wrapper{
"__bases__"};
123 static CachedPyString
wrapper{
"__cpp_name__"};
128 static CachedPyString
wrapper{
"__module__"};
133 static CachedPyString
wrapper{
"__name__"};
151#if PY_VERSION_HEX < 0x03020000
156#if PY_VERSION_HEX < 0x03000000
157 char *
argv[] = {
const_cast<char *
>(
"root")};
159 wchar_t *
argv[] = {
const_cast<wchar_t *
>(L
"root")};
162#if PY_VERSION_HEX < 0x030b0000
173 std::cerr <<
"Error when setting command line arguments." << std::endl;
180 std::cerr <<
"Error when initializing Python." << std::endl;
185#if PY_VERSION_HEX >= 0x03020000
186#if PY_VERSION_HEX < 0x03090000
194 std::cerr <<
"Error: python has not been intialized; returning." << std::endl;
198#if PY_VERSION_HEX < 0x030b0000
206 std::cerr <<
"Error: import ROOT failed, check your PYTHONPATH environmental variable." << std::endl;
297#if PY_VERSION_HEX < 0x03000000
298 Exec((std::string(
"execfile(\"") +
name +
"\")").c_str());
300 Exec((std::string(
"__pyroot_f = open(\"") +
name +
"\"); "
301 "exec(__pyroot_f.read()); "
302 "__pyroot_f.close(); del __pyroot_f")
366 std::cerr <<
"Error: no file name specified." << std::endl;
370 std::vector<std::string> args(
argc);
371 for (
int i = 0; i <
argc; ++i) {
431 PyObject *
module = PyObject_GetAttr(pyclass, PyStrings::moduleStr());
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static PyObject * gMainDict
Binding & operator=(OUT(*fun)(void))
TClass instances represent classes, structs and namespaces in the ROOT type system.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Mother of all ROOT objects.
Accessing the Python interpreter from C++.
static void Prompt()
Enter an interactive python session (exit with ^D).
static Bool_t CPPOverload_Check(PyObject *pyobject)
Test whether the type of the given pyobject is of CPPOverload type or any derived type.
static void * CPPInstance_AsVoidPtr(PyObject *pyobject)
Extract the object pointer held by the CPPInstance pyobject.
static void ExecScript(const char *name, int argc=0, const char **argv=nullptr)
Execute a python stand-alone script, with argv CLI arguments.
static Bool_t Import(const char *name)
Import the named python module and create Cling equivalents for its classes and methods.
static Bool_t CPPInstance_CheckExact(PyObject *pyobject)
Test whether the type of the given pyobject is CPPinstance type.
static Bool_t Bind(TObject *object, const char *label)
Bind a ROOT object with, at the python side, the name "label".
static void LoadMacro(const char *name)
Execute the give python script as if it were a macro (effectively an execfile in main),...
static Bool_t CPPOverload_CheckExact(PyObject *pyobject)
Test whether the type of the given pyobject is CPPOverload type.
static Bool_t Initialize()
Initialization method: setup the python interpreter and load the ROOT module.
static Bool_t Exec(const char *cmd)
Execute a python statement (e.g. "import ROOT").
static Bool_t CPPInstance_Check(PyObject *pyobject)
Test whether the type of the given pyobject is of CPPInstance type or any derived type.
static const TPyReturn Eval(const char *expr)
Evaluate a python expression (e.g.
static PyObject * CPPInstance_FromVoidPtr(void *addr, const char *classname, Bool_t python_owns=kFALSE)
Bind the addr to a python object of class defined by classname.
CPYCPPYY_EXTERN bool Instance_CheckExact(PyObject *pyobject)
CPYCPPYY_EXTERN bool Overload_Check(PyObject *pyobject)
CPYCPPYY_EXTERN bool Overload_CheckExact(PyObject *pyobject)
CPYCPPYY_EXTERN bool Import(const std::string &name)
CPYCPPYY_EXTERN void ExecScript(const std::string &name, const std::vector< std::string > &args)
CPYCPPYY_EXTERN bool Instance_Check(PyObject *pyobject)
CPYCPPYY_EXTERN PyObject * Instance_FromVoidPtr(void *addr, const std::string &classname, bool python_owns=false)
CPYCPPYY_EXTERN void * Instance_AsVoidPtr(PyObject *pyobject)