3 #ifndef PYROOT_CONVERTERS_H 4 #define PYROOT_CONVERTERS_H 31 #define PYROOT_DECLARE_BASIC_CONVERTER( name ) \ 32 class T##name##Converter : public TConverter { \ 34 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 35 virtual PyObject* FromMemory( void* ); \ 36 virtual Bool_t ToMemory( PyObject*, void* ); \ 39 class TConst##name##RefConverter : public TConverter { \ 41 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 45 #define PYROOT_DECLARE_BASIC_CONVERTER2( name, base ) \ 46 class T##name##Converter : public T##base##Converter { \ 48 virtual PyObject* FromMemory( void* ); \ 49 virtual Bool_t ToMemory( PyObject*, void* ); \ 52 class TConst##name##RefConverter : public TConverter { \ 54 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 57 #define PYROOT_DECLARE_REF_CONVERTER( name ) \ 58 class T##name##RefConverter : public TConverter { \ 60 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 63 #define PYROOT_DECLARE_ARRAY_CONVERTER( name ) \ 64 class T##name##Converter : public TConverter { \ 66 T##name##Converter( Py_ssize_t size = -1 ) { fSize = size; } \ 67 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 68 virtual PyObject* FromMemory( void* ); \ 69 virtual Bool_t ToMemory( PyObject*, void* ); \ 74 class T##name##RefConverter : public T##name##Converter { \ 76 using T##name##Converter::T##name##Converter; \ 77 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 145 virtual Bool_t GetAddressSpecialCase(
PyObject* pyobject,
void*& address );
195 using TStrictCppObjectConverter::TStrictCppObjectConverter;
213 template <
bool ISREFERENCE>
262 #define PYROOT_DECLARE_STRING_CONVERTER( name, strtype ) \ 263 class T##name##Converter : public TCppObjectConverter { \ 265 T##name##Converter( Bool_t keepControl = kTRUE ); \ 267 virtual Bool_t SetArg( PyObject*, TParameter&, TCallContext* ctxt = 0 );\ 268 virtual PyObject* FromMemory( void* address ); \ 269 virtual Bool_t ToMemory( PyObject* value, void* address ); \ 291 : fClass( klass ), fRawPtrType( rawPtrType ), fDereferencer( deref ),
292 fKeepControl( keepControl ), fHandlePtr( handlePtr ) {}
314 #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)
basic_string_view< char > string_view
PYROOT_DECLARE_STRING_CONVERTER(TString, TString)
TCStringConverter(UInt_t maxSize=UINT_MAX)
virtual Bool_t GetAddressSpecialCase(PyObject *, void *&)
TNonConstCStringConverter(UInt_t maxSize=UINT_MAX)