MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / getreadbuf

Function getreadbuf

src/python/PyImath/PyImathBufferProtocol.cpp:168–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167template <class ArrayT>
168Py_ssize_t
169getreadbuf (PyObject *obj, Py_ssize_t segment, void **buf)
170{
171 if (segment != 0)
172 {
173 PyErr_SetString (PyExc_ValueError, "FixedArrays are not segmented");
174 return -1;
175 }
176
177 boost::python::extract<ArrayT> eObj (obj);
178 if (!eObj.check())
179 {
180 PyErr_SetString (PyExc_ValueError, "Cannot extract FixedArray");
181 return -1;
182 }
183
184 ArrayT array = eObj();
185 return bufferInfo<ArrayT> (array, buf);
186}
187
188
189template <class ArrayT>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected