Logo ROOT  
Reference Guide
PyzCppHelpers.hxx File Reference
#include "CPyCppyy.h"
#include "CPPInstance.h"
#include "TClass.h"
#include "RConfig.h"
#include <string>
Include dependency graph for PyzCppHelpers.hxx:
This graph shows which files directly or indirectly include this file:

Functions

PyObjectBoolNot (PyObject *value)
 
PyObjectCallPyObjMethod (PyObject *obj, const char *meth)
 Set of helper functions that are invoked from the C++ implementation of pythonizations. More...
 
PyObjectCallPyObjMethod (PyObject *obj, const char *meth, PyObject *arg1)
 
bool CheckEndianessFromTypestr (const std::string &typestr)
 Check whether endianess in type string matches the endianess of ROOT. More...
 
PyObjectGetArrayInterface (PyObject *obj)
 Get Numpy array interface and perform error handling. More...
 
std::string GetCppTypeFromNumpyType (const std::string &dtype)
 Convert Numpy data-type string to the according C++ data-type string. More...
 
unsigned long long GetDataPointerFromArrayInterface (PyObject *obj)
 Get data pointer from Numpy array interface and perform error handling. More...
 
unsigned int GetDatatypeSizeFromTypestr (const std::string &typestr)
 Get size of data type in bytes from Numpy type string. More...
 
TClassGetTClass (const CPyCppyy::CPPInstance *pyobj)
 
std::string GetTypestrFromArrayInterface (PyObject *obj)
 Get type string from Numpy array interface and perform error handling. More...
 

Function Documentation

◆ BoolNot()

PyObject* BoolNot ( PyObject value)

Definition at line 32 of file PyzCppHelpers.cxx.

◆ CallPyObjMethod() [1/2]

PyObject* CallPyObjMethod ( PyObject obj,
const char *  meth 
)

Set of helper functions that are invoked from the C++ implementation of pythonizations.

Definition at line 20 of file PyzCppHelpers.cxx.

◆ CallPyObjMethod() [2/2]

PyObject* CallPyObjMethod ( PyObject obj,
const char *  meth,
PyObject arg1 
)

Definition at line 26 of file PyzCppHelpers.cxx.

◆ CheckEndianessFromTypestr()

bool CheckEndianessFromTypestr ( const std::string &  typestr)

Check whether endianess in type string matches the endianess of ROOT.

Parameters
[in]typestrNumpy type string
Returns
Boolean indicating whether they match

Definition at line 142 of file PyzCppHelpers.cxx.

◆ GetArrayInterface()

PyObject* GetArrayInterface ( PyObject obj)

Get Numpy array interface and perform error handling.

Parameters
[in]objPyObject with array interface dictionary
Returns
Array interface dictionary

Definition at line 78 of file PyzCppHelpers.cxx.

◆ GetCppTypeFromNumpyType()

std::string GetCppTypeFromNumpyType ( const std::string &  dtype)

Convert Numpy data-type string to the according C++ data-type string.

Parameters
[in]dtypeNumpy data-type string
Returns
C++ data-type string

If the input data-tyep is not known, the function returns an empty string.

Definition at line 55 of file PyzCppHelpers.cxx.

◆ GetDataPointerFromArrayInterface()

unsigned long long GetDataPointerFromArrayInterface ( PyObject obj)

Get data pointer from Numpy array interface and perform error handling.

Parameters
[in]objArray interface dictionary
Returns
Data pointer

Definition at line 96 of file PyzCppHelpers.cxx.

◆ GetDatatypeSizeFromTypestr()

unsigned int GetDatatypeSizeFromTypestr ( const std::string &  typestr)

Get size of data type in bytes from Numpy type string.

Parameters
[in]typestrNumpy type string
Returns
Size in bytes

Definition at line 131 of file PyzCppHelpers.cxx.

◆ GetTClass()

TClass* GetTClass ( const CPyCppyy::CPPInstance pyobj)

Definition at line 44 of file PyzCppHelpers.cxx.

◆ GetTypestrFromArrayInterface()

std::string GetTypestrFromArrayInterface ( PyObject obj)

Get type string from Numpy array interface and perform error handling.

Parameters
[in]objArray interface dictionary
Returns
Type string

Definition at line 110 of file PyzCppHelpers.cxx.