ROOT  6.06/09
Reference Guide
Namespaces | Macros | Typedefs | Functions | Variables
Converters.cxx File Reference
#include "PyROOT.h"
#include "PyStrings.h"
#include "Converters.h"
#include "TCallContext.h"
#include "ObjectProxy.h"
#include "TPyBufferFactory.h"
#include "TCustomPyTypes.h"
#include "TTupleOfInstances.h"
#include "Utility.h"
#include "RootWrapper.h"
#include "TClass.h"
#include "TClassEdit.h"
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include <utility>
#include <sstream>
+ Include dependency graph for Converters.cxx:

Go to the source code of this file.

Namespaces

 PyROOT
 

Macros

#define PYROOT_IMPLEMENT_BASIC_CONVERTER(name, type, stype, F1, F2)
 
#define PYROOT_IMPLEMENT_BASIC_CONST_REF_CONVERTER(name, type, F1, verifier)
 
#define PYROOT_IMPLEMENT_BASIC_CONST_CHAR_REF_CONVERTER(name, type, low, high)
 
#define PYROOT_IMPLEMENT_BASIC_CHAR_CONVERTER(name, type, low, high)
 
#define PYROOT_IMPLEMENT_ARRAY_CONVERTER(name, type, code)
 
#define PYROOT_IMPLEMENT_STRING_AS_PRIMITIVE_CONVERTER(name, type, F1, F2)
 
#define PYROOT_BASIC_CONVERTER_FACTORY(name)
 
#define PYROOT_ARRAY_CONVERTER_FACTORY(name)
 

Typedefs

typedef TConverter *(* PyROOT::ConverterFactory_t) (Long_t size)
 
typedef std::map< std::string, ConverterFactory_t > PyROOT::ConvFactories_t
 

Functions

static Bool_t VerifyPyBool (PyObject *pyobject)
 
static char PyROOT_PyUnicode_AsChar (PyObject *pyobject)
 
static Bool_t VerifyPyLong (PyObject *pyobject)
 
static Bool_t VerifyPyFloat (PyObject *)
 
static Int_t ExtractChar (PyObject *pyobject, const char *tname, Int_t low, Int_t high)
 
 PYROOT_IMPLEMENT_ARRAY_CONVERTER (Bool, Bool_t, 'b') Bool_t PyROOT
 convert <pyobject> to C++ long long*, set arg for call More...
 

Variables

ConvFactories_t PyROOT::gConvFactories
 
R__EXTERN PyObjectPyROOT::gNullPtrObject = 0
 

Macro Definition Documentation

#define PYROOT_ARRAY_CONVERTER_FACTORY (   name)
Value:
TConverter* Create##name##Converter( Long_t size ) \
{ \
return new T##name##Converter( size ); \
}
double T(double x)
Definition: ChebyshevPol.h:34
return
Definition: TBase64.cxx:62
long Long_t
Definition: RtypesCore.h:50
#define name(a, b)
Definition: linkTestLib0.cpp:5

Definition at line 1440 of file Converters.cxx.

#define PYROOT_BASIC_CONVERTER_FACTORY (   name)
Value:
TConverter* Create##name##Converter( Long_t ) \
{ \
return new T##name##Converter(); \
}
double T(double x)
Definition: ChebyshevPol.h:34
return
Definition: TBase64.cxx:62
long Long_t
Definition: RtypesCore.h:50
#define name(a, b)
Definition: linkTestLib0.cpp:5

Definition at line 1434 of file Converters.cxx.

#define PYROOT_IMPLEMENT_ARRAY_CONVERTER (   name,
  type,
  code 
)

Definition at line 752 of file Converters.cxx.

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

Definition at line 161 of file Converters.cxx.

#define PYROOT_IMPLEMENT_BASIC_CONST_CHAR_REF_CONVERTER (   name,
  type,
  low,
  high 
)
Value:
Bool_t PyROOT::TConst##name##RefConverter::SetArg( \
PyObject* pyobject, TParameter& para, TCallContext* /* 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() ) \
para.fValue.fLong = val; \
para.fTypeCode = 'l'; \
}
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
if(pyself &&pyself!=Py_None)
return
Definition: TBase64.cxx:62
int type
Definition: TGX11.cxx:120
static Int_t ExtractChar(PyObject *pyobject, const char *tname, Int_t low, Int_t high)
Definition: Converters.cxx:106
#define name(a, b)
Definition: linkTestLib0.cpp:5
const Bool_t kTRUE
Definition: Rtypes.h:91
_object PyObject
Definition: TPyArg.h:22

Definition at line 145 of file Converters.cxx.

#define PYROOT_IMPLEMENT_BASIC_CONST_REF_CONVERTER (   name,
  type,
  F1,
  verifier 
)
Value:
Bool_t PyROOT::TConst##name##RefConverter::SetArg( \
PyObject* pyobject, TParameter& para, TCallContext* /* ctxt */ ) \
{ \
if ( ! verifier( pyobject ) ) return kFALSE; \
type val = (type)F1( pyobject ); \
if ( val == (type)-1 && PyErr_Occurred() ) \
return kFALSE; \
para.fValue.f##name = val; \
para.fRef = &para.fValue.f##name; \
para.fTypeCode = 'r'; \
return kTRUE; \
}
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
if(pyself &&pyself!=Py_None)
#define F1(x, y, z)
Definition: TMD5.cxx:265
return
Definition: TBase64.cxx:62
PyObject * fValue
double f(double x)
int type
Definition: TGX11.cxx:120
#define name(a, b)
Definition: linkTestLib0.cpp:5
_object PyObject
Definition: TPyArg.h:22

Definition at line 131 of file Converters.cxx.

#define PYROOT_IMPLEMENT_BASIC_CONVERTER (   name,
  type,
  stype,
  F1,
  F2 
)
Value:
PyObject* PyROOT::T##name##Converter::FromMemory( void* address ) \
{ \
return F1( (stype)*((type*)address) ); \
} \
\
Bool_t PyROOT::T##name##Converter::ToMemory( PyObject* value, void* address ) \
{ \
type s = (type)F2( value ); \
if ( s == (type)-1 && PyErr_Occurred() ) \
*((type*)address) = (type)s; \
}
double T(double x)
Definition: ChebyshevPol.h:34
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
const char Int_t const char TProof Int_t stype
Definition: TXSlave.cxx:46
if(pyself &&pyself!=Py_None)
#define F1(x, y, z)
Definition: TMD5.cxx:265
return
Definition: TBase64.cxx:62
#define F2(x, y, z)
Definition: TMD5.cxx:266
int type
Definition: TGX11.cxx:120
#define name(a, b)
Definition: linkTestLib0.cpp:5
const Bool_t kTRUE
Definition: Rtypes.h:91
float value
Definition: math.cpp:443
_object PyObject
Definition: TPyArg.h:22

Definition at line 59 of file Converters.cxx.

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

Definition at line 818 of file Converters.cxx.

Function Documentation

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

Definition at line 106 of file Converters.cxx.

PYROOT_IMPLEMENT_ARRAY_CONVERTER ( Bool  ,
Bool_t  ,
'b'   
)

convert <pyobject> to C++ long long*, set arg for call

Definition at line 791 of file Converters.cxx.

static char PyROOT_PyUnicode_AsChar ( PyObject pyobject)
inlinestatic

Definition at line 86 of file Converters.cxx.

Referenced by ExtractChar().

static Bool_t VerifyPyBool ( PyObject pyobject)
inlinestatic

Definition at line 75 of file Converters.cxx.

static Bool_t VerifyPyFloat ( PyObject )
inlinestatic

Definition at line 101 of file Converters.cxx.

static Bool_t VerifyPyLong ( PyObject pyobject)
inlinestatic

Definition at line 91 of file Converters.cxx.