Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
PyzCppHelpers.hxx File Reference
#include "CPyCppyy.h"
#include "CPPInstance.h"
#include "TClass.h"
#include "ROOT/RConfig.hxx"
#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.
 
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.
 
PyObjectGetArrayInterface (PyObject *obj)
 Get Numpy array interface and perform error handling.
 
std::string GetCppTypeFromNumpyType (const std::string &dtype)
 Convert Numpy data-type string to the according C++ data-type string.
 
unsigned long long GetDataPointerFromArrayInterface (PyObject *obj)
 Get data pointer from Numpy array interface and perform error handling.
 
unsigned int GetDatatypeSizeFromTypestr (const std::string &typestr)
 Get size of data type in bytes from Numpy type string.
 
TClassGetTClass (const CPyCppyy::CPPInstance *pyobj)
 
std::string GetTypestrFromArrayInterface (PyObject *obj)
 Get type string from Numpy array interface and perform error handling.
 

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.