3 #ifndef PYROOT_CONVERTERS_H 4 #define PYROOT_CONVERTERS_H 30 #define PYROOT_DECLARE_BASIC_CONVERTER( name ) \ 31 class T##name##Converter : public TConverter { \ 33 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 34 virtual PyObject* FromMemory( void* ); \ 35 virtual Bool_t ToMemory( PyObject*, void* ); \ 38 class TConst##name##RefConverter : public TConverter { \ 40 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 44 #define PYROOT_DECLARE_BASIC_CONVERTER2( name, base ) \ 45 class T##name##Converter : public T##base##Converter { \ 47 virtual PyObject* FromMemory( void* ); \ 48 virtual Bool_t ToMemory( PyObject*, void* ); \ 51 class TConst##name##RefConverter : public TConverter { \ 53 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 56 #define PYROOT_DECLARE_REF_CONVERTER( name ) \ 57 class T##name##RefConverter : public TConverter { \ 59 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 62 #define PYROOT_DECLARE_ARRAY_CONVERTER( name ) \ 63 class T##name##Converter : public TConverter { \ 65 T##name##Converter( Py_ssize_t size = -1 ) { fSize = size; } \ 66 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 67 virtual PyObject* FromMemory( void* ); \ 68 virtual Bool_t ToMemory( PyObject*, void* ); \ 73 class T##name##RefConverter : public T##name##Converter { \ 75 using T##name##Converter::T##name##Converter; \ 76 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 144 virtual Bool_t GetAddressSpecialCase(
PyObject* pyobject,
void*& address );
193 using TStrictCppObjectConverter::TStrictCppObjectConverter;
210 template <
bool ISREFERENCE>
259 #define PYROOT_DECLARE_STRING_CONVERTER( name, strtype ) \ 260 class T##name##Converter : public TCppObjectConverter { \ 262 T##name##Converter( Bool_t keepControl = kTRUE ); \ 264 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 265 virtual PyObject* FromMemory( void* address ); \ 266 virtual Bool_t ToMemory( PyObject* value, void* address ); \ 288 : fClass( klass ), fRawPtrType( rawPtrType ), fDereferencer( deref ),
289 fKeepControl( keepControl ), fHandlePtr( handlePtr ) {}
311 #endif // !PYROOT_CONVERTERS_H
virtual Bool_t ToMemory(PyObject *value, void *address)
could happen if no derived class override
Cppyy::TCppType_t fRawPtrType
TVoidArrayConverter(Bool_t keepControl=kTRUE)
Cppyy::TCppMethod_t fDereferencer
PYROOT_DECLARE_REF_CONVERTER(Int)
virtual PyObject * FromMemory(void *address)
TRefCppObjectConverter(Cppyy::TCppType_t klass)
TNonConstUCStringConverter(UInt_t maxSize=UINT_MAX)
TCppObjectConverter(Cppyy::TCppType_t klass, Bool_t keepControl=kFALSE)
TConverter * CreateConverter(const std::string &fullType, Long_t size=-1)
TSmartPtrCppObjectConverter(Cppyy::TCppType_t klass, Cppyy::TCppType_t rawPtrType, Cppyy::TCppMethod_t deref, Bool_t keepControl=kFALSE, Bool_t handlePtr=kFALSE)
Named parameter, streamable and storable.
virtual Bool_t GetAddressSpecialCase(PyObject *, void *&)
(1): "null pointer" or C++11 style nullptr
PYROOT_DECLARE_BASIC_CONVERTER2(UInt, ULong)
PYROOT_DECLARE_ARRAY_CONVERTER(BoolArray)
virtual Bool_t SetArg(PyObject *, TParameter &, TCallContext *ctxt=0)=0
PYROOT_DECLARE_BASIC_CONVERTER(Long)
TCppObjectArrayConverter(Cppyy::TCppType_t klass, size_t size, Bool_t keepControl=kFALSE)
PYROOT_DECLARE_STRING_CONVERTER(TString, TString)
TCStringConverter(UInt_t maxSize=UINT_MAX)
virtual Bool_t GetAddressSpecialCase(PyObject *, void *&)
TNonConstCStringConverter(UInt_t maxSize=UINT_MAX)