#include "PyROOT.h"
#include "TPyBufferFactory.h"
#include <map>
Go to the source code of this file.
#define PYROOT_IMPLEMENT_PYBUFFER_FROM_MEMORY |
( |
|
name, |
|
|
|
type |
|
) |
| |
Value:
{ \
size = size < 0 ? INT_MAX : size;
\
PyObject* buf = PyBuffer_FromReadWriteMemory( (
void*)address, size );
\
buf->ob_type = &Py##
name##Buffer_Type; \
} \
if ( buf != 0 && PyCallable_Check( scb ) ) { \
Py_INCREF( scb ); \
gSizeCallbacks[ buf ] = scb; \
}
if(pyself &&pyself!=Py_None)
PyObject * PyBuffer_FromMemory(Bool_t *buf, Py_ssize_t size=-1)
Definition at line 289 of file TPyBufferFactory.cxx.
#define PYROOT_INSTALL_PYBUFFER_METHODS |
( |
|
name, |
|
|
|
type |
|
) |
| |
Value:Py##
name##Buffer_Type.tp_name = (
char*)
"ROOT.Py"#
name"Buffer"; \
Py##
name##Buffer_Type.tp_base = &PyBuffer_Type; \
Py##
name##Buffer_Type.tp_as_buffer = PyBuffer_Type.tp_as_buffer; \
Py##
name##Buffer_SeqMethods.sq_length = (
lenfunc)buffer_length; \
Py##
name##Buffer_Type.tp_as_sequence = &Py##
name##Buffer_SeqMethods;
\
if ( PyBuffer_Type.tp_as_mapping ) { \
Py##
name##Buffer_MapMethods.mp_length = (
lenfunc)buffer_length; \
Py##
name##Buffer_MapMethods.mp_subscript = (binaryfunc)
name##_buffer_subscript;\
Py##
name##Buffer_MapMethods.mp_ass_subscript = (objobjargproc)pyroot_buffer_ass_subscript;\
Py##
name##Buffer_Type.tp_as_mapping = &Py##
name##Buffer_MapMethods; \
} \
Py##
name##Buffer_Type.tp_str = (reprfunc)
name##_buffer_str; \
Py##
name##Buffer_Type.tp_methods = buffer_methods; \
Py##
name##Buffer_Type.tp_getset = buffer_getset; \
PyType_Ready( &Py##
name##Buffer_Type );
if(pyself &&pyself!=Py_None)
Definition at line 248 of file TPyBufferFactory.cxx.
Referenced by PyROOT::TPyBufferFactory::TPyBufferFactory().
#define PYROOT_PREPARE_PYBUFFER_TYPE |
( |
|
name | ) |
|
Value:PyTypeObject Py##
name##Buffer_Type; \
PySequenceMethods Py##
name##Buffer_SeqMethods = *(PyBuffer_Type.tp_as_sequence);\
PyMappingMethods Py##
name##Buffer_MapMethods;
Definition at line 38 of file TPyBufferFactory.cxx.