Python interface class for callbacks and GIL.
More...
#include <DDPython.h>
Python interface class for callbacks and GIL.
- Author
- M.Frank
- Version
- 1.0
Definition at line 34 of file DDPython.h.
◆ DDPython() [1/2]
dd4hep::DDPython::DDPython |
( |
| ) |
|
|
protected |
Standard constructor.
Standard constructor, initializes variables.
Definition at line 137 of file DDPython.cpp.
◆ DDPython() [2/2]
dd4hep::DDPython::DDPython |
( |
const DDPython & |
| ) |
|
|
inline |
◆ ~DDPython()
dd4hep::DDPython::~DDPython |
( |
| ) |
|
Destructor.
Default Destructor.
Definition at line 173 of file DDPython.cpp.
◆ afterFork()
void dd4hep::DDPython::afterFork |
( |
| ) |
const |
◆ allowThreads()
void dd4hep::DDPython::allowThreads |
( |
| ) |
|
|
static |
◆ assignObject()
void dd4hep::DDPython::assignObject |
( |
PyObject *& |
obj, |
|
|
PyObject * |
new_obj |
|
) |
| |
|
static |
◆ call()
PyObject * dd4hep::DDPython::call |
( |
PyObject * |
method, |
|
|
PyObject * |
args |
|
) |
| |
Call a python object with argument (typically a dictionary)
Note:
- Typical call from python -> C -> python
- Errors are printed and then cleared. A return code of NULL is passed to the caller in the event of an error condition
- The returned object is NOT owned by the caller.
- No GIL state handling by the caller necessary
Definition at line 261 of file DDPython.cpp.
◆ callC()
TPyReturn dd4hep::DDPython::callC |
( |
PyObject * |
method, |
|
|
PyObject * |
args |
|
) |
| |
Call a python object with argument (typically a dictionary).
Note:
- Typical call from C -> python -> C
- Errors are printed and then cleared. A return code of NULL is passed to the caller in the event of an error condition
- The returned object TPyReturn must be destructed (ie. leave scope) BEFORE the GIL is released.
- The caller MUST ensure the GIL state in case of multi-threading!
Definition at line 271 of file DDPython.cpp.
◆ evaluate()
int dd4hep::DDPython::evaluate |
( |
const std::string & |
cmd | ) |
const |
◆ execute()
int dd4hep::DDPython::execute |
( |
const std::string & |
cmd | ) |
const |
◆ instance()
◆ isMainThread()
bool dd4hep::DDPython::isMainThread |
( |
| ) |
|
|
staticprotected |
◆ prompt()
void dd4hep::DDPython::prompt |
( |
| ) |
const |
◆ releaseObject()
void dd4hep::DDPython::releaseObject |
( |
PyObject *& |
obj | ) |
|
|
static |
◆ restoreThread()
void dd4hep::DDPython::restoreThread |
( |
| ) |
|
|
static |
◆ run_interpreter()
int dd4hep::DDPython::run_interpreter |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
static |
Start the interpreter in normal mode without hacks like 'python.exe' does.
Start the interpreter in normal mode without hacks like 'pythopn.exe' does.
Definition at line 333 of file DDPython.cpp.
◆ runFile()
int dd4hep::DDPython::runFile |
( |
const std::string & |
fname | ) |
const |
◆ setArgs()
int dd4hep::DDPython::setArgs |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| const |
◆ setMainThread()
void dd4hep::DDPython::setMainThread |
( |
| ) |
|
|
static |
◆ shutdown()
void dd4hep::DDPython::shutdown |
( |
| ) |
|
|
static |
◆ context
void* dd4hep::DDPython::context |
|
protected |
The documentation for this class was generated from the following files: