48 PyGILState_STATE m_GILState;
50 PyGILRAII() : m_GILState(PyGILState_Ensure()) { }
51 ~PyGILRAII() { PyGILState_Release(m_GILState); }
118TPyReturn::operator
char *()
const
123 return (
char *)((
const char *)*
this);
129TPyReturn::operator
const char *()
const
136 const char *s = PyUnicode_AsUTF8AndSize(
fPyObject,
nullptr);
137 if (PyErr_Occurred()) {
152 std::string s =
operator const char *();
168 if (PyErr_Occurred())
183 if (PyErr_Occurred())
198 if (PyErr_Occurred())
208TPyReturn::operator
void *()
const
char Char_t
Character 1 byte (char).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
double Double_t
Double 8 bytes.
TPyReturn & operator=(const TPyReturn &)
Assignment operator. Applies python object reference counting.
virtual ~TPyReturn()
Destructor. Reference counting for the held python object is in effect.
PyObject * fPyObject
! actual python object
CPYCPPYY_EXTERN bool Instance_Check(PyObject *pyobject)
CPYCPPYY_EXTERN void Instance_SetCppOwns(PyObject *pyobject)
CPYCPPYY_EXTERN void * Instance_AsVoidPtr(PyObject *pyobject)