Logo ROOT  
Reference Guide
TPyArg.h
Go to the documentation of this file.
1#ifndef CPYCPPYY_TPYARG_H
2#define CPYCPPYY_TPYARG_H
3
4//////////////////////////////////////////////////////////////////////////////
5// //
6// TPyArg //
7// //
8// Morphing argument type from evaluating python expressions. //
9// //
10//////////////////////////////////////////////////////////////////////////////
11
12// Python
13struct _object;
14typedef _object PyObject;
15
16// Standard
17#include <vector>
18
19// Bindings
20#include "CPyCppyy/CommonDefs.h"
21
22
24public:
25// converting constructors
27 TPyArg(int);
28 TPyArg(long);
29 TPyArg(double);
30 TPyArg(const char*);
31
32 TPyArg(const TPyArg&);
34 virtual ~TPyArg();
35
36// "extractor"
37 operator PyObject*() const;
38
39// constructor and generic dispatch
40 static void CallConstructor(
41 PyObject*& pyself, PyObject* pyclass, const std::vector<TPyArg>& args);
42 static void CallConstructor(PyObject*& pyself, PyObject* pyclass); // default ctor
43 static PyObject* CallMethod(PyObject* pymeth, const std::vector<TPyArg>& args);
44 static void CallDestructor(
45 PyObject*& pyself, PyObject* pymeth, const std::vector<TPyArg>& args);
46 static void CallDestructor(PyObject*& pyself);
47
48private:
49 mutable PyObject* fPyObject; //! converted C++ value as python object
50};
51
52#endif // !CPYCPPYY_TPYARG_H
_object PyObject
Definition: PyMethodBase.h:43
#define CPYCPPYY_CLASS_EXTERN
Definition: CommonDefs.h:29
Definition: TPyArg.h:33
TPyArg(int)
TPyArg(long)
static void CallConstructor(PyObject *&pyself, PyObject *pyclass, const std::vector< TPyArg > &args)
virtual ~TPyArg()
TPyArg(double)
TPyArg(const char *)
TPyArg(PyObject *)
static void CallConstructor(PyObject *&pyself, PyObject *pyclass)
TPyArg & operator=(const TPyArg &)
static void CallDestructor(PyObject *&pyself, PyObject *pymeth, const std::vector< TPyArg > &args)
static PyObject * CallMethod(PyObject *pymeth, const std::vector< TPyArg > &args)
static void CallDestructor(PyObject *&pyself)
TPyArg(const TPyArg &)
_object PyObject
Definition: TPyArg.h:28