29 if ( ! address || (ptrdiff_t)address == -1 )
38 if ( ! ptr || (ptrdiff_t)ptr == -1 ) {
59 PyErr_Format( PyExc_NotImplementedError,
60 "no converter available for \"%s\"", pyprop->
GetName().c_str() );
69 const int errret = -1;
73 PyErr_SetString( PyExc_TypeError,
"assignment to const data not allowed" );
77 ptrdiff_t address = (ptrdiff_t)pyprop->
GetAddress( pyobj );
78 if ( ! address || address == -1 )
82 void* ptr = (
void*)address;
91 if ( ! PyErr_Occurred() )
92 PyErr_SetString( PyExc_RuntimeError,
"property type mismatch or assignment not allowed" );
108 new ( &pyprop->
fName ) std::string();
120 pyprop->
fName.~string();
132 (
char*)
"ROOT.PropertyProxy",
135 (destructor)pp_dealloc,
151 (
char*)
"PyROOT property proxy (internal)",
163 (descrgetfunc)pp_get,
164 (descrsetfunc)pp_set,
176 #
if PY_VERSION_HEX >= 0x02030000
179 #
if PY_VERSION_HEX >= 0x02060000
182 #
if PY_VERSION_HEX >= 0x03040000
193 fEnclosingScope = scope;
218 fEnclosingScope = scope;
220 fOffset = (ptrdiff_t)address;
230 return (
void*)fOffset;
238 PyErr_Format( PyExc_TypeError,
239 "object instance required for access to property \"%s\"",
GetName().c_str() );
245 PyErr_SetString( PyExc_ReferenceError,
"attempt to access a null-pointer" );
250 ptrdiff_t offset = 0;
251 if ( pyobj->
ObjectIsA() != fEnclosingScope)
254 return (
void*)((ptrdiff_t)obj + offset + fOffset);
std::string GetName(const std::string &scope_name)
virtual Bool_t ToMemory(PyObject *value, void *address)
could happen if no derived class override
ptrdiff_t GetBaseOffset(TCppType_t derived, TCppType_t base, TCppObject_t address, int direction, bool rerror=false)
PyTypeObject PropertyProxy_Type
ptrdiff_t GetDatamemberOffset(TCppScope_t scope, TCppIndex_t idata)
Bool_t IsEnumData(TCppScope_t scope, TCppIndex_t idata)
std::string GetDatamemberType(TCppScope_t scope, TCppIndex_t idata)
Int_t GetDimensionSize(TCppScope_t scope, TCppIndex_t idata, int dimension)
#define PyVarObject_HEAD_INIT(type, size)
void * GetAddress(ObjectProxy *pyobj)
class attributes, global properties
virtual PyObject * FromMemory(void *address)
Bool_t IsConstData(TCppScope_t scope, TCppIndex_t idata)
TConverter * CreateConverter(const std::string &fullType, Long_t size=-1)
Bool_t ObjectProxy_Check(T *object)
void Set(Cppyy::TCppScope_t scope, Cppyy::TCppIndex_t idata)
PyObject_HEAD ptrdiff_t fOffset
R__EXTERN PyObject * gLifeLine
std::string GetDatamemberName(TCppScope_t scope, TCppIndex_t idata)
Bool_t IsStaticData(TCppScope_t scope, TCppIndex_t idata)
Cppyy::TCppScope_t fEnclosingScope
Cppyy::TCppType_t ObjectIsA() const