Logo ROOT  
Reference Guide
Converters.cxx File Reference
#include "CPyCppyy.h"
#include "DeclareConverters.h"
#include "CallContext.h"
#include "CPPExcInstance.h"
#include "CPPInstance.h"
#include "CPPOverload.h"
#include "CustomPyTypes.h"
#include "LowLevelViews.h"
#include "MemoryRegulator.h"
#include "ProxyWrappers.h"
#include "PyStrings.h"
#include "TemplateProxy.h"
#include "TupleOfInstances.h"
#include "TypeManip.h"
#include "Utility.h"
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include <array>
#include <utility>
#include <sstream>
#include "ROOT/RStringView.hxx"
Include dependency graph for Converters.cxx:

Namespaces

 CPyCppyy
 Set of helper functions that are invoked from the pythonizors, on the Python side.
 

Macros

#define CPPYY_IMPL_ARRAY_CONVERTER(name, ctype, type, code)
 
#define CPPYY_IMPL_BASIC_CHAR_CONVERTER(name, type, low, high)
 
#define CPPYY_IMPL_BASIC_CONST_CHAR_REFCONVERTER(name, type, ctype, low, high)
 
#define CPPYY_IMPL_BASIC_CONST_REFCONVERTER(name, type, ctype, F1)
 
#define CPPYY_IMPL_BASIC_CONVERTER(name, type, stype, ctype, F1, F2, tc)
 
#define CPPYY_IMPL_REFCONVERTER(name, ctype, type, code)
 
#define CPPYY_IMPL_REFCONVERTER_FROM_MEMORY(name, ctype)
 
#define CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER(name, type, F1, F2)
 
#define ct_c_bool   0
 
#define ct_c_byte   3
 
#define ct_c_char   1
 
#define ct_c_char_p   18
 
#define ct_c_complex   21
 
#define ct_c_double   16
 
#define ct_c_float   15
 
#define ct_c_int   8
 
#define ct_c_int8   3
 
#define ct_c_long   11
 
#define ct_c_longdouble   17
 
#define ct_c_longlong   13
 
#define ct_c_shar   1
 
#define ct_c_short   5
 
#define ct_c_ubyte   4
 
#define ct_c_uchar   4
 
#define ct_c_uint   9
 
#define ct_c_uint16   7
 
#define ct_c_uint32   10
 
#define ct_c_uint8   4
 
#define ct_c_ulong   12
 
#define ct_c_ulonglong   14
 
#define ct_c_ushort   6
 
#define ct_c_void_p   20
 
#define ct_c_wchar   2
 
#define ct_c_wchar_p   19
 
#define NO_KNOWN_INITIALIZER_LIST   1
 
#define NTYPES   22
 
#define STRINGVIEW   "basic_string_view<char,char_traits<char> >"
 
#define UNKNOWN_ARRAY_SIZE   -2
 
#define UNKNOWN_SIZE   -1
 
#define WSTRING   "basic_string<wchar_t,char_traits<wchar_t>,allocator<wchar_t> >"
 

Typedefs

typedef std::map< std::string, cf_t > CPyCppyy::ConvFactories_t
 
typedef std::pair< std::string, std::string > RetSigKey_t
 

Functions

static bool CArraySetArg (PyObject *pyobject, CPyCppyy::Parameter &para, char tc, int size)
 
static bool ConvertImplicit (Cppyy::TCppType_t klass, PyObject *pyobject, CPyCppyy::Parameter &para, CPyCppyy::CallContext *ctxt)
 
 CPPYY_IMPL_BASIC_CONVERTER (Bool, bool, long, c_bool, PyInt_FromLong, CPyCppyy_PyLong_AsBool, 'l') PyObject *CPyCppyy
 
 CPPYY_IMPL_BASIC_CONVERTER (Float, float, double, c_float, PyFloat_FromDouble, PyFloat_AsDouble, 'f') CPPYY_IMPL_BASIC_CONVERTER(Double
 
l unsigned l CPPYY_IMPL_BASIC_CONVERTER (Int, int, long, c_uint, PyInt_FromLong, CPyCppyy_PyLong_AsStrictInt, 'l') bool CPyCppyy
 
 CPPYY_IMPL_BASIC_CONVERTER (Int8, int8_t, long, c_int8, PyInt_FromLong, CPyCppyy_PyLong_AsInt8, 'l') CPPYY_IMPL_BASIC_CONVERTER(UInt8
 
d CPPYY_IMPL_BASIC_CONVERTER (LDouble, LongDouble_t, LongDouble_t, c_longdouble, PyFloat_FromDouble, PyFloat_AsDouble, 'g') CPyCppyy
 
l CPPYY_IMPL_BASIC_CONVERTER (Short, short, long, c_short, PyInt_FromLong, CPyCppyy_PyLong_AsShort, 'l') CPPYY_IMPL_BASIC_CONVERTER(UShort
 
 CPPYY_IMPL_REFCONVERTER (Bool, c_bool, bool, '?')
 
 CPPYY_IMPL_REFCONVERTER (Char, c_char, char, 'b')
 
 CPPYY_IMPL_REFCONVERTER (Char16, c_uint16, char16_t, 'H')
 
 CPPYY_IMPL_REFCONVERTER (Char32, c_uint32, char32_t, 'I')
 
 CPPYY_IMPL_REFCONVERTER (Float, c_float, float, 'f')
 
 CPPYY_IMPL_REFCONVERTER (Int8, c_int8, int8_t, 'b')
 
 CPPYY_IMPL_REFCONVERTER (LDouble, c_longdouble, LongDouble_t, 'D')
 
 CPPYY_IMPL_REFCONVERTER (LLong, c_longlong, long long, 'q')
 
 CPPYY_IMPL_REFCONVERTER (SChar, c_byte, signed char, 'b')
 
 CPPYY_IMPL_REFCONVERTER (Short, c_short, short, 'h')
 
 CPPYY_IMPL_REFCONVERTER (UChar, c_ubyte, unsigned char, 'B')
 
 CPPYY_IMPL_REFCONVERTER (UInt, c_uint, unsigned int, 'I')
 
 CPPYY_IMPL_REFCONVERTER (UInt8, c_uint8, uint8_t, 'B')
 
 CPPYY_IMPL_REFCONVERTER (ULLong, c_ulonglong, unsigned long long, 'Q')
 
 CPPYY_IMPL_REFCONVERTER (ULong, c_ulong, unsigned long, 'L')
 
 CPPYY_IMPL_REFCONVERTER (UShort, c_ushort, unsigned short, 'H')
 
 CPPYY_IMPL_REFCONVERTER (WChar, c_wchar, wchar_t, 'u')
 
 CPPYY_IMPL_REFCONVERTER_FROM_MEMORY (Double, c_double)
 
 CPPYY_IMPL_REFCONVERTER_FROM_MEMORY (Int, c_int)
 
 CPPYY_IMPL_REFCONVERTER_FROM_MEMORY (Long, c_long)
 
static bool CPyCppyy_PyLong_AsBool (PyObject *pyobject)
 
static int8_t CPyCppyy_PyLong_AsInt8 (PyObject *pyobject)
 
static short CPyCppyy_PyLong_AsShort (PyObject *pyobject)
 
static int CPyCppyy_PyLong_AsStrictInt (PyObject *pyobject)
 
static long CPyCppyy_PyLong_AsStrictLong (PyObject *pyobject)
 
static uint8_t CPyCppyy_PyLong_AsUInt8 (PyObject *pyobject)
 
static unsigned short CPyCppyy_PyLong_AsUShort (PyObject *pyobject)
 
static char CPyCppyy_PyText_AsChar (PyObject *pyobject)
 
static int ExtractChar (PyObject *pyobject, const char *tname, int low, int high)
 
static CPyCppyy::CPPInstanceGetCppInstance (PyObject *pyobject)
 
static PyTypeObject * GetCTypesPtrType (int nidx)
 
static PyTypeObject * GetCTypesType (int nidx)
 
static bool IsCTypesArrayOrPointer (PyObject *pyobject)
 
static bool IsPyCArgObject (PyObject *pyobject)
 
static voidPyFunction_AsCPointer (PyObject *pyobject, const std::string &rettype, const std::string &signature)
 
static CPyCppyy::ConverterselectInstanceCnv (Cppyy::TCppScope_t klass, const std::string &cpd, long size, dims_t dims, bool isConst, bool control)
 
static PyObjectWrapperCacheEraser (PyObject *, PyObject *pyref)
 

Variables

 c_double
 
 c_uint8
 
l unsigned c_ushort
 
 CPyCppyy_PyLong_AsUInt8
 
l unsigned CPyCppyy_PyLong_AsUShort
 
 double
 
static const char * FPCFM_ERRMSG = "conversion to std::function failed"
 
static ConvFactories_t CPyCppyy::gConvFactories
 
static std::array< const char *, NTYPESgCTypesNames
 
static std::array< PyTypeObject *, NTYPESgCTypesPtrTypes
 
static std::array< PyTypeObject *, NTYPESgCTypesTypes
 
PyObjectCPyCppyy::gNullPtrObject = nullptr
 
static PyMethodDef gWrapperCacheEraserMethodDef
 
 long
 
const size_t MOVE_REFCOUNT_CUTOFF = 1
 
 PyFloat_AsDouble
 
 PyFloat_FromDouble
 
 PyInt_FromLong
 
static std::map< void *, std::string > sFuncWrapperLookup
 
l unsigned short
 
static unsigned int sWrapperCounter = 0
 
static std::map< RetSigKey_t, std::vector< void * > > sWrapperFree
 
static std::map< RetSigKey_t, std::map< PyObject *, void * > > sWrapperLookup
 
static std::map< void *, PyObject ** > sWrapperReference
 
static std::map< PyObject *, std::pair< void *, RetSigKey_t > > sWrapperWeakRefs
 
 uint8_t
 

Macro Definition Documentation

◆ CPPYY_IMPL_ARRAY_CONVERTER

#define CPPYY_IMPL_ARRAY_CONVERTER (   name,
  ctype,
  type,
  code 
)

Definition at line 1468 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CHAR_CONVERTER

#define CPPYY_IMPL_BASIC_CHAR_CONVERTER (   name,
  type,
  low,
  high 
)

Definition at line 551 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONST_CHAR_REFCONVERTER

#define CPPYY_IMPL_BASIC_CONST_CHAR_REFCONVERTER (   name,
  type,
  ctype,
  low,
  high 
)
Value:
bool CPyCppyy::Const##name##RefConverter::SetArg( \
PyObject* pyobject, Parameter& para, CallContext* /* ctxt */) \
{ \
/* convert <pyobject> to C++ <<type>>, set arg for call, allow int -> char */\
type val = (type)ExtractChar(pyobject, #type, low, high); \
if (val == (type)-1 && PyErr_Occurred()) \
return false; \
para.fValue.fLong = val; \
para.fTypeCode = 'l'; \
return true; \
} \
CPPYY_IMPL_REFCONVERTER_FROM_MEMORY(Const##name, ctype)

Definition at line 535 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONST_REFCONVERTER

#define CPPYY_IMPL_BASIC_CONST_REFCONVERTER (   name,
  type,
  ctype,
  F1 
)
Value:
bool CPyCppyy::Const##name##RefConverter::SetArg( \
PyObject* pyobject, Parameter& para, CallContext* /* ctxt */) \
{ \
type val = (type)F1(pyobject); \
if (val == (type)-1 && PyErr_Occurred()) \
return false; \
para.fValue.f##name = val; \
para.fRef = &para.fValue.f##name; \
para.fTypeCode = 'r'; \
return true; \
} \
CPPYY_IMPL_REFCONVERTER_FROM_MEMORY(Const##name, ctype)

Definition at line 520 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONVERTER

#define CPPYY_IMPL_BASIC_CONVERTER (   name,
  type,
  stype,
  ctype,
  F1,
  F2,
  tc 
)

Definition at line 439 of file Converters.cxx.

◆ CPPYY_IMPL_REFCONVERTER

#define CPPYY_IMPL_REFCONVERTER (   name,
  ctype,
  type,
  code 
)
Value:
bool CPyCppyy::name##RefConverter::SetArg( \
PyObject* pyobject, Parameter& para, CallContext* /* ctxt */) \
{ \
/* convert a reference to int to Python through ctypes pointer object */ \
if (Py_TYPE(pyobject) == GetCTypesType(ct_##ctype)) { \
para.fValue.fVoidp = (void*)((CPyCppyy_tagCDataObject*)pyobject)->b_ptr;\
para.fTypeCode = 'V'; \
return true; \
} \
bool res = CArraySetArg(pyobject, para, code, sizeof(type)); \
if (!res) { \
PyErr_SetString(PyExc_TypeError, "use ctypes."#ctype" for pass-by-ref of "#type);\
return false; \
} \
para.fTypeCode = 'V'; \
return res; \
} \
CPPYY_IMPL_REFCONVERTER_FROM_MEMORY(name, ctype)

Definition at line 679 of file Converters.cxx.

◆ CPPYY_IMPL_REFCONVERTER_FROM_MEMORY

#define CPPYY_IMPL_REFCONVERTER_FROM_MEMORY (   name,
  ctype 
)
Value:
PyObject* CPyCppyy::name##RefConverter::FromMemory(void* ptr) \
{ \
/* convert a reference to int to Python through ctypes pointer object */ \
PyTypeObject* ctypes_type = GetCTypesType(ct_##ctype); \
if (!ctypes_type) { \
PyErr_SetString(PyExc_RuntimeError, "no ctypes available"); \
return nullptr; \
} \
PyObject* ref = ctypes_type->tp_new(ctypes_type, nullptr, nullptr); \
((CPyCppyy_tagCDataObject*)ref)->b_ptr = (char*)ptr; \
((CPyCppyy_tagCDataObject*)ref)->b_needsfree = 0; \
return ref; \
}

Definition at line 504 of file Converters.cxx.

◆ CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER

#define CPPYY_IMPL_STRING_AS_PRIMITIVE_CONVERTER (   name,
  type,
  F1,
  F2 
)

Definition at line 1598 of file Converters.cxx.

◆ ct_c_bool

#define ct_c_bool   0

Definition at line 75 of file Converters.cxx.

◆ ct_c_byte

#define ct_c_byte   3

Definition at line 79 of file Converters.cxx.

◆ ct_c_char

#define ct_c_char   1

Definition at line 76 of file Converters.cxx.

◆ ct_c_char_p

#define ct_c_char_p   18

Definition at line 97 of file Converters.cxx.

◆ ct_c_complex

#define ct_c_complex   21

Definition at line 100 of file Converters.cxx.

◆ ct_c_double

#define ct_c_double   16

Definition at line 95 of file Converters.cxx.

◆ ct_c_float

#define ct_c_float   15

Definition at line 94 of file Converters.cxx.

◆ ct_c_int

#define ct_c_int   8

Definition at line 87 of file Converters.cxx.

◆ ct_c_int8

#define ct_c_int8   3

Definition at line 80 of file Converters.cxx.

◆ ct_c_long

#define ct_c_long   11

Definition at line 90 of file Converters.cxx.

◆ ct_c_longdouble

#define ct_c_longdouble   17

Definition at line 96 of file Converters.cxx.

◆ ct_c_longlong

#define ct_c_longlong   13

Definition at line 92 of file Converters.cxx.

◆ ct_c_shar

#define ct_c_shar   1

Definition at line 77 of file Converters.cxx.

◆ ct_c_short

#define ct_c_short   5

Definition at line 84 of file Converters.cxx.

◆ ct_c_ubyte

#define ct_c_ubyte   4

Definition at line 81 of file Converters.cxx.

◆ ct_c_uchar

#define ct_c_uchar   4

Definition at line 82 of file Converters.cxx.

◆ ct_c_uint

#define ct_c_uint   9

Definition at line 88 of file Converters.cxx.

◆ ct_c_uint16

#define ct_c_uint16   7

Definition at line 86 of file Converters.cxx.

◆ ct_c_uint32

#define ct_c_uint32   10

Definition at line 89 of file Converters.cxx.

◆ ct_c_uint8

#define ct_c_uint8   4

Definition at line 83 of file Converters.cxx.

◆ ct_c_ulong

#define ct_c_ulong   12

Definition at line 91 of file Converters.cxx.

◆ ct_c_ulonglong

#define ct_c_ulonglong   14

Definition at line 93 of file Converters.cxx.

◆ ct_c_ushort

#define ct_c_ushort   6

Definition at line 85 of file Converters.cxx.

◆ ct_c_void_p

#define ct_c_void_p   20

Definition at line 99 of file Converters.cxx.

◆ ct_c_wchar

#define ct_c_wchar   2

Definition at line 78 of file Converters.cxx.

◆ ct_c_wchar_p

#define ct_c_wchar_p   19

Definition at line 98 of file Converters.cxx.

◆ NO_KNOWN_INITIALIZER_LIST

#define NO_KNOWN_INITIALIZER_LIST   1

Definition at line 2535 of file Converters.cxx.

◆ NTYPES

#define NTYPES   22

Definition at line 101 of file Converters.cxx.

◆ STRINGVIEW

#define STRINGVIEW   "basic_string_view<char,char_traits<char> >"

Definition at line 2875 of file Converters.cxx.

◆ UNKNOWN_ARRAY_SIZE

#define UNKNOWN_ARRAY_SIZE   -2

Definition at line 31 of file Converters.cxx.

◆ UNKNOWN_SIZE

#define UNKNOWN_SIZE   -1

Definition at line 30 of file Converters.cxx.

◆ WSTRING

#define WSTRING   "basic_string<wchar_t,char_traits<wchar_t>,allocator<wchar_t> >"

Definition at line 2876 of file Converters.cxx.

Typedef Documentation

◆ RetSigKey_t

typedef std::pair<std::string, std::string> RetSigKey_t

Definition at line 2156 of file Converters.cxx.

Function Documentation

◆ CArraySetArg()

static bool CArraySetArg ( PyObject pyobject,
CPyCppyy::Parameter para,
char  tc,
int  size 
)
inlinestatic

Definition at line 332 of file Converters.cxx.

◆ ConvertImplicit()

static bool ConvertImplicit ( Cppyy::TCppType_t  klass,
PyObject pyobject,
CPyCppyy::Parameter para,
CPyCppyy::CallContext ctxt 
)
inlinestatic

Definition at line 356 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONVERTER() [1/6]

CPPYY_IMPL_BASIC_CONVERTER ( Bool  ,
bool  ,
long  ,
c_bool  ,
PyInt_FromLong  ,
CPyCppyy_PyLong_AsBool  ,
'l  
)

Definition at line 723 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONVERTER() [2/6]

CPPYY_IMPL_BASIC_CONVERTER ( Float  ,
float  ,
double  ,
c_float  ,
PyFloat_FromDouble  ,
PyFloat_AsDouble  ,
'f  
)

◆ CPPYY_IMPL_BASIC_CONVERTER() [3/6]

l unsigned l CPPYY_IMPL_BASIC_CONVERTER ( Int  ,
int  ,
long  ,
c_uint  ,
PyInt_FromLong  ,
CPyCppyy_PyLong_AsStrictInt  ,
'l  
)

Definition at line 863 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONVERTER() [4/6]

CPPYY_IMPL_BASIC_CONVERTER ( Int8  ,
int8_t  ,
long  ,
c_int8  ,
PyInt_FromLong  ,
CPyCppyy_PyLong_AsInt8  ,
'l  
)

◆ CPPYY_IMPL_BASIC_CONVERTER() [5/6]

d CPPYY_IMPL_BASIC_CONVERTER ( LDouble  ,
LongDouble_t  ,
LongDouble_t  ,
c_longdouble  ,
PyFloat_FromDouble  ,
PyFloat_AsDouble  ,
'g  
)

Definition at line 923 of file Converters.cxx.

◆ CPPYY_IMPL_BASIC_CONVERTER() [6/6]

l CPPYY_IMPL_BASIC_CONVERTER ( Short  ,
short  ,
long  ,
c_short  ,
PyInt_FromLong  ,
CPyCppyy_PyLong_AsShort  ,
'l  
)

◆ CPPYY_IMPL_REFCONVERTER() [1/17]

CPPYY_IMPL_REFCONVERTER ( Bool  ,
c_bool  ,
bool  ,
'?'   
)

◆ CPPYY_IMPL_REFCONVERTER() [2/17]

CPPYY_IMPL_REFCONVERTER ( Char  ,
c_char  ,
char  ,
'b  
)

◆ CPPYY_IMPL_REFCONVERTER() [3/17]

CPPYY_IMPL_REFCONVERTER ( Char16  ,
c_uint16  ,
char16_t  ,
'H  
)

◆ CPPYY_IMPL_REFCONVERTER() [4/17]

CPPYY_IMPL_REFCONVERTER ( Char32  ,
c_uint32  ,
char32_t  ,
'I  
)

◆ CPPYY_IMPL_REFCONVERTER() [5/17]

CPPYY_IMPL_REFCONVERTER ( Float  ,
c_float  ,
float  ,
'f  
)

◆ CPPYY_IMPL_REFCONVERTER() [6/17]

CPPYY_IMPL_REFCONVERTER ( Int8  ,
c_int8  ,
int8_t  ,
'b  
)

◆ CPPYY_IMPL_REFCONVERTER() [7/17]

CPPYY_IMPL_REFCONVERTER ( LDouble  ,
c_longdouble  ,
LongDouble_t  ,
'D'   
)

◆ CPPYY_IMPL_REFCONVERTER() [8/17]

CPPYY_IMPL_REFCONVERTER ( LLong  ,
c_longlong  ,
long long  ,
'q  
)

◆ CPPYY_IMPL_REFCONVERTER() [9/17]

CPPYY_IMPL_REFCONVERTER ( SChar  ,
c_byte  ,
signed char  ,
'b  
)

◆ CPPYY_IMPL_REFCONVERTER() [10/17]

CPPYY_IMPL_REFCONVERTER ( Short  ,
c_short  ,
short  ,
'h  
)

◆ CPPYY_IMPL_REFCONVERTER() [11/17]

CPPYY_IMPL_REFCONVERTER ( UChar  ,
c_ubyte  ,
unsigned char  ,
'B'   
)

◆ CPPYY_IMPL_REFCONVERTER() [12/17]

CPPYY_IMPL_REFCONVERTER ( UInt  ,
c_uint  ,
unsigned int  ,
'I  
)

◆ CPPYY_IMPL_REFCONVERTER() [13/17]

CPPYY_IMPL_REFCONVERTER ( UInt8  ,
c_uint8  ,
uint8_t  ,
'B'   
)

◆ CPPYY_IMPL_REFCONVERTER() [14/17]

CPPYY_IMPL_REFCONVERTER ( ULLong  ,
c_ulonglong  ,
unsigned long long  ,
'Q'   
)

◆ CPPYY_IMPL_REFCONVERTER() [15/17]

CPPYY_IMPL_REFCONVERTER ( ULong  ,
c_ulong  ,
unsigned long  ,
'L'   
)

◆ CPPYY_IMPL_REFCONVERTER() [16/17]

CPPYY_IMPL_REFCONVERTER ( UShort  ,
c_ushort  ,
unsigned short  ,
'H  
)

◆ CPPYY_IMPL_REFCONVERTER() [17/17]

CPPYY_IMPL_REFCONVERTER ( WChar  ,
c_wchar  ,
wchar_t  ,
'u'   
)

◆ CPPYY_IMPL_REFCONVERTER_FROM_MEMORY() [1/3]

CPPYY_IMPL_REFCONVERTER_FROM_MEMORY ( Double  ,
c_double   
)

◆ CPPYY_IMPL_REFCONVERTER_FROM_MEMORY() [2/3]

CPPYY_IMPL_REFCONVERTER_FROM_MEMORY ( Int  ,
c_int   
)

◆ CPPYY_IMPL_REFCONVERTER_FROM_MEMORY() [3/3]

CPPYY_IMPL_REFCONVERTER_FROM_MEMORY ( Long  ,
c_long   
)

◆ CPyCppyy_PyLong_AsBool()

static bool CPyCppyy_PyLong_AsBool ( PyObject pyobject)
inlinestatic

Definition at line 212 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsInt8()

static int8_t CPyCppyy_PyLong_AsInt8 ( PyObject pyobject)
inlinestatic

Definition at line 246 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsShort()

static short CPyCppyy_PyLong_AsShort ( PyObject pyobject)
inlinestatic

Definition at line 281 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsStrictInt()

static int CPyCppyy_PyLong_AsStrictInt ( PyObject pyobject)
inlinestatic

Definition at line 298 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsStrictLong()

static long CPyCppyy_PyLong_AsStrictLong ( PyObject pyobject)
inlinestatic

Definition at line 318 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsUInt8()

static uint8_t CPyCppyy_PyLong_AsUInt8 ( PyObject pyobject)
inlinestatic

Definition at line 229 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsUShort()

static unsigned short CPyCppyy_PyLong_AsUShort ( PyObject pyobject)
inlinestatic

Definition at line 263 of file Converters.cxx.

◆ CPyCppyy_PyText_AsChar()

static char CPyCppyy_PyText_AsChar ( PyObject pyobject)
inlinestatic

Definition at line 224 of file Converters.cxx.

◆ ExtractChar()

static int ExtractChar ( PyObject pyobject,
const char *  tname,
int  low,
int  high 
)
inlinestatic

Definition at line 479 of file Converters.cxx.

◆ GetCppInstance()

static CPyCppyy::CPPInstance* GetCppInstance ( PyObject pyobject)
inlinestatic

Definition at line 200 of file Converters.cxx.

◆ GetCTypesPtrType()

static PyTypeObject* GetCTypesPtrType ( int  nidx)
static

Definition at line 134 of file Converters.cxx.

◆ GetCTypesType()

static PyTypeObject* GetCTypesType ( int  nidx)
static

Definition at line 115 of file Converters.cxx.

◆ IsCTypesArrayOrPointer()

static bool IsCTypesArrayOrPointer ( PyObject pyobject)
static

Definition at line 181 of file Converters.cxx.

◆ IsPyCArgObject()

static bool IsPyCArgObject ( PyObject pyobject)
static

Definition at line 161 of file Converters.cxx.

◆ PyFunction_AsCPointer()

static void* PyFunction_AsCPointer ( PyObject pyobject,
const std::string &  rettype,
const std::string &  signature 
)
static

Definition at line 2180 of file Converters.cxx.

◆ selectInstanceCnv()

static CPyCppyy::Converter* selectInstanceCnv ( Cppyy::TCppScope_t  klass,
const std::string &  cpd,
long  size,
dims_t  dims,
bool  isConst,
bool  control 
)
inlinestatic

Definition at line 2625 of file Converters.cxx.

◆ WrapperCacheEraser()

static PyObject* WrapperCacheEraser ( PyObject ,
PyObject pyref 
)
static

Definition at line 2162 of file Converters.cxx.

Variable Documentation

◆ c_double

c_double

Definition at line 921 of file Converters.cxx.

◆ c_uint8

c_uint8

Definition at line 858 of file Converters.cxx.

◆ c_ushort

l unsigned c_ushort

Definition at line 862 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsUInt8

CPyCppyy_PyLong_AsUInt8

Definition at line 858 of file Converters.cxx.

◆ CPyCppyy_PyLong_AsUShort

l unsigned CPyCppyy_PyLong_AsUShort

Definition at line 862 of file Converters.cxx.

◆ double

double

Definition at line 921 of file Converters.cxx.

◆ FPCFM_ERRMSG

const char* FPCFM_ERRMSG = "conversion to std::function failed"
static

Definition at line 2338 of file Converters.cxx.

◆ gCTypesNames

std::array<const char*, NTYPES> gCTypesNames
static
Initial value:
= {
"c_bool", "c_char", "c_wchar", "c_byte", "c_ubyte", "c_short", "c_ushort", "c_uint16",
"c_int", "c_uint", "c_uint32", "c_long", "c_ulong", "c_longlong", "c_ulonglong",
"c_float", "c_double", "c_longdouble",
"c_char_p", "c_wchar_p", "c_void_p", "c_complex" }

Definition at line 103 of file Converters.cxx.

◆ gCTypesPtrTypes

std::array<PyTypeObject*, NTYPES> gCTypesPtrTypes
static

Definition at line 109 of file Converters.cxx.

◆ gCTypesTypes

std::array<PyTypeObject*, NTYPES> gCTypesTypes
static

Definition at line 108 of file Converters.cxx.

◆ gWrapperCacheEraserMethodDef

PyMethodDef gWrapperCacheEraserMethodDef
static
Initial value:
= {
const_cast<char*>("interal_WrapperCacheEraser"),
(PyCFunction)WrapperCacheEraser,
METH_O, nullptr
}

Definition at line 2174 of file Converters.cxx.

◆ long

l unsigned long

Definition at line 858 of file Converters.cxx.

◆ MOVE_REFCOUNT_CUTOFF

const size_t MOVE_REFCOUNT_CUTOFF = 1

Definition at line 45 of file Converters.cxx.

◆ PyFloat_AsDouble

PyFloat_AsDouble

Definition at line 921 of file Converters.cxx.

◆ PyFloat_FromDouble

PyFloat_FromDouble

Definition at line 921 of file Converters.cxx.

◆ PyInt_FromLong

l unsigned PyInt_FromLong

Definition at line 858 of file Converters.cxx.

◆ sFuncWrapperLookup

std::map<void*, std::string> sFuncWrapperLookup
static

Definition at line 2337 of file Converters.cxx.

◆ short

l unsigned short

Definition at line 862 of file Converters.cxx.

◆ sWrapperCounter

unsigned int sWrapperCounter = 0
static

Definition at line 2154 of file Converters.cxx.

◆ sWrapperFree

std::map<RetSigKey_t, std::vector<void*> > sWrapperFree
static

Definition at line 2157 of file Converters.cxx.

◆ sWrapperLookup

std::map<RetSigKey_t, std::map<PyObject*, void*> > sWrapperLookup
static

Definition at line 2158 of file Converters.cxx.

◆ sWrapperReference

std::map<void*, PyObject**> sWrapperReference
static

Definition at line 2160 of file Converters.cxx.

◆ sWrapperWeakRefs

std::map<PyObject*, std::pair<void*, RetSigKey_t> > sWrapperWeakRefs
static

Definition at line 2159 of file Converters.cxx.

◆ uint8_t

uint8_t

Definition at line 858 of file Converters.cxx.

CPyCppyy::CallContext
Definition: CallContext.h:45
PyObject
_object PyObject
Definition: PyMethodBase.h:42
WrapperCacheEraser
static PyObject * WrapperCacheEraser(PyObject *, PyObject *pyref)
Definition: Converters.cxx:2162
name
char name[80]
Definition: TGX11.cxx:110
type
int type
Definition: TGX11.cxx:121
F1
#define F1(x, y, z)
Definition: TMD5.cxx:267
Py_TYPE
#define Py_TYPE(ob)
Definition: CPyCppyy.h:209
CPyCppyy::Parameter
Definition: callcontext.h:13
GetCTypesType
static PyTypeObject * GetCTypesType(int nidx)
Definition: Converters.cxx:115
ExtractChar
static int ExtractChar(PyObject *pyobject, const char *tname, int low, int high)
Definition: Converters.cxx:479
CArraySetArg
static bool CArraySetArg(PyObject *pyobject, CPyCppyy::Parameter &para, char tc, int size)
Definition: Converters.cxx:332