33 PyErr_Format(PyExc_RuntimeError,
"Failed to create new object at index %d of TClonesArray",
index);
38 auto newObj = (
TObject *)(arrObj + baseOffset);
50 newObj->Streamer(buffer);
67 PyErr_SetString(PyExc_RuntimeError,
"unable to get the size of TClonesArray");
73 if (idx >=
size || (idx < 0 && idx < -
size)) {
74 PyErr_SetString(PyExc_IndexError,
"index out of range");
83 pyindex = PyLong_FromSsize_t(
size + idx);
95 if (!PyArg_ParseTuple(args,
const_cast<char *
>(
"OO!:__setitem__"), &idx, &
CPPInstance_Type, &pyobj))
99 PyErr_SetString(PyExc_TypeError,
"unsubscriptable object");
106 auto index = (
int)PyLong_AsLong(pyindex);
113 PyErr_SetString(PyExc_TypeError,
"attempt to call with null object");
118 PyErr_Format(PyExc_TypeError,
"require object of type %s, but %s given", cla->GetClass()->GetName(),
134 auto pyclass = PyObject_GetAttrString((
PyObject*)pyobj,
"__class__");
140 delete static_cast<TObject *
>(pyobj->GetObject());
169 PyObject *pyclass = PyTuple_GetItem(args, 0);
TClass * GetTClass(const CPyCppyy::CPPInstance *pyobj)
PyObject * CallPyObjMethod(PyObject *obj, const char *meth)
Set of helper functions that are invoked from the C++ implementation of pythonizations.
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static PyObject * PyStyleIndex(PyObject *self, PyObject *index)
PyObject * SetItem(CPPInstance *self, PyObject *args)
static TObject * CloneObjectInPlace(const TObject *obj, TClonesArray *cla, int index)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
void Streamer(TBuffer &) override
Cppyy::TCppType_t ObjectIsA(bool check_smart=true) const
static bool RegisterPyObject(CPPInstance *pyobj, void *cppobj)
static bool UnregisterPyObject(CPPInstance *pyobj, PyObject *pyclass)
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void MapObject(const TObject *obj, UInt_t offset=1) override
Add object to the fMap container.
void ResetMap() override
Delete existing fMap and reset map counter.
void SetBufferOffset(Int_t offset=0)
void SetReadMode()
Set buffer in read mode.
void * DynamicCast(const TClass *base, void *obj, Bool_t up=kTRUE)
Cast obj of this class type up to baseclass cl if up is true.
Int_t Size() const
Return size of object of this class.
Int_t GetBaseClassOffset(const TClass *toBase, void *address=nullptr, bool isDerivedObject=true)
An array of clone (identical) objects.
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
TClass * GetClass() const
TObject * ConstructedAt(Int_t idx)
Get an object at index 'idx' that is guaranteed to have been constructed.
Mother of all ROOT objects.
virtual TClass * IsA() const
bool AddToClass(PyObject *pyclass, const char *label, PyCFunction cfunc, int flags=METH_VARARGS)
Set of helper functions that are invoked from the pythonizors, on the Python side.
PyTypeObject CPPInstance_Type
RPY_EXPORTED TCppScope_t GetScope(const std::string &scope_name)
RPY_EXPORTED std::string GetFinalName(TCppType_t type)
PyObject * AddSetItemTCAPyz(PyObject *self, PyObject *args)
Customize the setting of an item of a TClonesArray.