Logo ROOT  
Reference Guide
TupleOfInstances.h
Go to the documentation of this file.
1 #ifndef CPYCPPYY_TUPLEOFINSTANCES_H
2 #define CPYCPPYY_TUPLEOFINSTANCES_H
3 
4 namespace CPyCppyy {
5 
6 /** Representation of C-style array of instances
7  @author WLAV
8  @date 02/10/2014
9  @version 1.0
10  */
11 
12 //- custom tuple type that can pass through C-style arrays -------------------
13 extern PyTypeObject TupleOfInstances_Type;
14 extern PyTypeObject InstanceArrayIter_Type;
15 
16 template<typename T>
17 inline bool TupleOfInstances_Check(T* object)
18 {
19  return object && PyObject_TypeCheck(object, &TupleOfInstances_Type);
20 }
21 
22 template<typename T>
23 inline bool TupleOfInstances_CheckExact(T* object)
24 {
25  return object && Py_TYPE(object) == &TupleOfInstances_Type;
26 }
27 
29  Cppyy::TCppObject_t address, Cppyy::TCppType_t klass, dim_t ndims, dims_t dims);
30 
31 } // namespace CPyCppyy
32 
33 #endif // !CPYCPPYY_TUPLEOFINSTANCES_H
Py_ssize_t dim_t
Definition: CPyCppyy.h:64
PyTypeObject InstanceArrayIter_Type
TCppScope_t TCppType_t
Definition: cpp_cppyy.h:19
double T(double x)
Definition: ChebyshevPol.h:34
#define Py_TYPE(ob)
Definition: CPyCppyy.h:209
bool TupleOfInstances_CheckExact(T *object)
PyObject * TupleOfInstances_New(Cppyy::TCppObject_t address, Cppyy::TCppType_t klass, dim_t ndims, dims_t dims)
_object PyObject
Definition: PyMethodBase.h:41
void * TCppObject_t
Definition: cpp_cppyy.h:21
PyTypeObject TupleOfInstances_Type
Representation of C-style array of instances.
bool TupleOfInstances_Check(T *object)