47 PyGILState_STATE m_GILState;
49 PyGILRAII() : m_GILState(PyGILState_Ensure()) { }
50 ~PyGILRAII() { PyGILState_Release(m_GILState); }
117TPyReturn::operator
char *()
const
122 return (
char *)((
const char *)*
this);
128TPyReturn::operator
const char *()
const
132 if (fPyObject == Py_None)
135 const char *s = PyUnicode_AsUTF8(fPyObject);
136 if (PyErr_Occurred()) {
151 std::string s =
operator const char *();
165 Long_t l = PyLong_AsLong(fPyObject);
167 if (PyErr_Occurred())
180 ULong_t ul = PyLong_AsUnsignedLong(fPyObject);
182 if (PyErr_Occurred())
195 Double_t d = PyFloat_AsDouble(fPyObject);
197 if (PyErr_Occurred())
207TPyReturn::operator
void *()
const
211 if (fPyObject == Py_None)
224 if (fPyObject == Py_None)
227 Py_INCREF(fPyObject);
TPyReturn & operator=(const TPyReturn &)
Assignment operator. Applies python object reference counting.
virtual ~TPyReturn()
Destructor. Reference counting for the held python object is in effect.