ROOT  6.06/09
Reference Guide
Macros
TPyBufferFactory.cxx File Reference
#include "PyROOT.h"
#include "TPyBufferFactory.h"
#include <map>
+ Include dependency graph for TPyBufferFactory.cxx:

Go to the source code of this file.

Macros

#define PYROOT_PREPARE_PYBUFFER_TYPE(name)
 
#define PYROOT_IMPLEMENT_PYBUFFER_METHODS(name, type, stype, F1, F2)
 
#define PYROOT_INSTALL_PYBUFFER_METHODS(name, type)
 
#define PYROOT_IMPLEMENT_PYBUFFER_FROM_MEMORY(name, type)
 

Macro Definition Documentation

#define PYROOT_IMPLEMENT_PYBUFFER_FROM_MEMORY (   name,
  type 
)
Value:
{ \
size = size < 0 ? INT_MAX : size; \
PyObject* buf = PyBuffer_FromReadWriteMemory( (void*)address, size ); \
if ( buf ) { \
Py_INCREF( (PyObject*)(void*)&Py##name##Buffer_Type ); \
buf->ob_type = &Py##name##Buffer_Type; \
} \
return buf; \
} \
\
{ \
PyObject* buf = PyBuffer_FromMemory( address, Py_ssize_t(0) ); \
if ( buf != 0 && PyCallable_Check( scb ) ) { \
Py_INCREF( scb ); \
gSizeCallbacks[ buf ] = scb; \
} \
return buf; \
}
if(pyself &&pyself!=Py_None)
return
Definition: TBase64.cxx:62
PyObject * PyBuffer_FromMemory(Bool_t *buf, Py_ssize_t size=-1)
int type
Definition: TGX11.cxx:120
#define name(a, b)
Definition: linkTestLib0.cpp:5
int Py_ssize_t
Definition: PyROOT.h:154
_object PyObject
Definition: TPyArg.h:22

Definition at line 289 of file TPyBufferFactory.cxx.

#define PYROOT_IMPLEMENT_PYBUFFER_METHODS (   name,
  type,
  stype,
  F1,
  F2 
)

Definition at line 113 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_item = (ssizeargfunc)name##_buffer_item; \
Py##name##Buffer_SeqMethods.sq_ass_item = (ssizeobjargproc)name##_buffer_ass_item;\
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 ) { /* p2.6 and later */ \
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 );
#define ssizeobjargproc
Definition: PyROOT.h:162
#define lenfunc
Definition: PyROOT.h:163
#define ssizeargfunc
Definition: PyROOT.h:164
if(pyself &&pyself!=Py_None)
#define name(a, b)
Definition: linkTestLib0.cpp:5

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;
#define name(a, b)
Definition: linkTestLib0.cpp:5

Definition at line 38 of file TPyBufferFactory.cxx.