forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TPyArg.h
56 lines (42 loc) · 1.54 KB
/
TPyArg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// @(#)root/pyroot:$Id$
// Author: Wim Lavrijsen Aug 2013
#ifndef ROOT_TPyArg
#define ROOT_TPyArg
//////////////////////////////////////////////////////////////////////////////
// //
// TPyArg //
// //
// Morphing argument type from evaluating python expressions. //
// //
//////////////////////////////////////////////////////////////////////////////
// ROOT
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
// Python
struct _object;
typedef _object PyObject;
// Standard
#include <vector>
class TPyArg {
public:
// converting constructors
TPyArg( PyObject* );
TPyArg( Int_t );
TPyArg( Long_t );
TPyArg( Double_t );
TPyArg( const char* );
TPyArg( const TPyArg& );
TPyArg& operator=( const TPyArg& );
virtual ~TPyArg();
// "extractor"
operator PyObject*() const;
// constructor and generic dispatch
static void CallConstructor( PyObject*& pyself, PyObject* pyclass, const std::vector<TPyArg>& args );
static void CallConstructor( PyObject*& pyself, PyObject* pyclass ); // default ctor
static PyObject* CallMethod( PyObject* pymeth, const std::vector<TPyArg>& args );
ClassDef(TPyArg,1) //Python morphing argument type
private:
mutable PyObject* fPyObject; //! converted C++ value as python object
};
#endif