Version: 8.3.0
YACS::ENGINE::AutoPyRef Class Reference

#include <AutoGIL.hxx>

Collaboration diagram for YACS::ENGINE::AutoPyRef:

Public Member Functions

 AutoPyRef (PyObject *pyobj=0)
 
 ~AutoPyRef ()
 
 AutoPyRef (const AutoPyRef &other)
 
AutoPyRefoperator= (const AutoPyRef &other)
 
 operator PyObject * ()
 
void set (PyObject *pyobj)
 
PyObject * get ()
 
bool isNull () const
 
PyObject * retn ()
 

Private Member Functions

void release ()
 

Private Attributes

PyObject * _pyobj
 

Detailed Description

Definition at line 39 of file AutoGIL.hxx.

Constructor & Destructor Documentation

YACS::ENGINE::AutoPyRef::AutoPyRef ( PyObject *  pyobj = 0)
inline

Definition at line 42 of file AutoGIL.hxx.

42 :_pyobj(pyobj) { }
YACS::ENGINE::AutoPyRef::~AutoPyRef ( )
inline

Definition at line 43 of file AutoGIL.hxx.

References release().

43 { release(); }
YACS::ENGINE::AutoPyRef::AutoPyRef ( const AutoPyRef other)
inline

Definition at line 44 of file AutoGIL.hxx.

References _pyobj.

44 :_pyobj(other._pyobj) { if(_pyobj) Py_XINCREF(_pyobj); }

Member Function Documentation

PyObject* YACS::ENGINE::AutoPyRef::get ( )
inline

Definition at line 48 of file AutoGIL.hxx.

References _pyobj.

48 { return _pyobj; }
bool YACS::ENGINE::AutoPyRef::isNull ( ) const
inline

Definition at line 49 of file AutoGIL.hxx.

References _pyobj.

Referenced by YACS::ENGINE::evalFuncPyWithNoParams(), and YACS::ENGINE::evalPy().

49 { return _pyobj==0; }
YACS::ENGINE::AutoPyRef::operator PyObject * ( )
inline

Definition at line 46 of file AutoGIL.hxx.

References _pyobj.

46 { return _pyobj; }
AutoPyRef& YACS::ENGINE::AutoPyRef::operator= ( const AutoPyRef other)
inline

Definition at line 45 of file AutoGIL.hxx.

References _pyobj, and release().

45 { if(_pyobj==other._pyobj) return *this; release(); _pyobj=other._pyobj; Py_XINCREF(_pyobj); return *this; }
void YACS::ENGINE::AutoPyRef::release ( )
inlineprivate

Definition at line 52 of file AutoGIL.hxx.

References _pyobj.

Referenced by operator=(), set(), and ~AutoPyRef().

52 { if(_pyobj) Py_XDECREF(_pyobj); _pyobj=0; }
PyObject* YACS::ENGINE::AutoPyRef::retn ( )
inline

Definition at line 50 of file AutoGIL.hxx.

References _pyobj.

Referenced by YACS::ENGINE::evalFuncPyWithNoParams().

50 { if(_pyobj) Py_XINCREF(_pyobj); return _pyobj; }
void YACS::ENGINE::AutoPyRef::set ( PyObject *  pyobj)
inline

Definition at line 47 of file AutoGIL.hxx.

References _pyobj, and release().

47 { if(pyobj==_pyobj) return ; release(); _pyobj=pyobj; }

Member Data Documentation

PyObject* YACS::ENGINE::AutoPyRef::_pyobj
private

Definition at line 54 of file AutoGIL.hxx.

Referenced by AutoPyRef(), get(), isNull(), operator PyObject *(), operator=(), release(), retn(), and set().


The documentation for this class was generated from the following file: