Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
PyzCppHelpers.hxx
Go to the documentation of this file.
1// Author: Danilo Piparo CERN 08/2018
2
3/*************************************************************************
4 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef PYROOT_PYZCPPHELPERS
12#define PYROOT_PYZCPPHELPERS
13
14#include "CPyCppyy.h"
15#include "CPPInstance.h"
16#include "TClass.h"
17#include "RConfig.h"
18
19#include <string>
20
21PyObject *CallPyObjMethod(PyObject *obj, const char *meth);
22PyObject *CallPyObjMethod(PyObject *obj, const char *meth, PyObject *arg1);
25std::string GetCppTypeFromNumpyType(const std::string& dtype);
27unsigned long long GetDataPointerFromArrayInterface(PyObject *obj);
29unsigned int GetDatatypeSizeFromTypestr(const std::string& typestr);
30bool CheckEndianessFromTypestr(const std::string& typestr);
31
32#endif // PYROOT_PYZCPPHELPERS
_object PyObject
PyObject * BoolNot(PyObject *value)
TClass * GetTClass(const CPyCppyy::CPPInstance *pyobj)
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.
std::string GetCppTypeFromNumpyType(const std::string &dtype)
Convert Numpy data-type string to the according C++ data-type string.
std::string GetTypestrFromArrayInterface(PyObject *obj)
Get type string from Numpy array interface and perform error handling.
bool CheckEndianessFromTypestr(const std::string &typestr)
Check whether endianess in type string matches the endianess of ROOT.
PyObject * CallPyObjMethod(PyObject *obj, const char *meth)
Set of helper functions that are invoked from the C++ implementation of pythonizations.
PyObject * GetArrayInterface(PyObject *obj)
Get Numpy array interface and perform error handling.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80