A utility class to convert a C++ object to a PyObject.
More...
#include <PyReverseProxy.h>
A utility class to convert a C++ object to a PyObject.
- Author
- Tadashi Maeno
Definition at line 27 of file PyReverseProxy.h.
◆ ~PyReverseProxy()
| PyReverseProxy::~PyReverseProxy |
( |
| ) |
|
|
inline |
destructor
Definition at line 30 of file PyReverseProxy.h.
31 {
32 RootUtils::PyGILStateEnsure gil;
33 s_proxyMap.erase(
m_key);
34 }
◆ PyReverseProxy() [1/2]
| PyReverseProxy::PyReverseProxy |
( |
| ) |
|
|
inlineprivate |
◆ PyReverseProxy() [2/2]
| PyReverseProxy::PyReverseProxy |
( |
const std::string & | key | ) |
|
|
inlineprivate |
constructor
Definition at line 75 of file PyReverseProxy.h.
77 {}
PyObject * m_func
python code fragment to convert C++ obj to PyObj
◆ getObj()
| void PyReverseProxy::getObj |
( |
void *& | obj | ) |
|
|
inline |
◆ getProxy()
factory method
Definition at line 59 of file PyReverseProxy.h.
60 {
61 RootUtils::PyGILStateEnsure gil;
63 if (!prox) {
65 }
66 return prox;
67 }
PyReverseProxy()
default constructor : never used
◆ setFunc()
| void PyReverseProxy::setFunc |
( |
PyObject * | func | ) |
|
|
inline |
setter
Definition at line 37 of file PyReverseProxy.h.
38 {
39 RootUtils::PyGILStateEnsure gil;
43 }
◆ toPyObj()
| PyObject * PyReverseProxy::toPyObj |
( |
void * | obj | ) |
|
|
inline |
Definition at line 51 of file PyReverseProxy.h.
52 {
53 RootUtils::PyGILStateEnsure gil;
55 return PyObject_CallObject(
m_func,NULL);
56 }
◆ ATLAS_THREAD_SAFE
| std::unordered_map<std::string, PyReverseProxy *> s_proxyMap PyReverseProxy::ATLAS_THREAD_SAFE |
|
staticprivate |
◆ m_func
python code fragment to convert C++ obj to PyObj
Definition at line 86 of file PyReverseProxy.h.
◆ m_key
| std::string PyReverseProxy::m_key |
|
private |
◆ m_obj
| void* PyReverseProxy::m_obj |
|
private |
The documentation for this struct was generated from the following file: