-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpythonExample.cc
More file actions
34 lines (26 loc) · 793 Bytes
/
Copy pathpythonExample.cc
File metadata and controls
34 lines (26 loc) · 793 Bytes
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
#include "pythonExample.h"
#include "classdesc_epilogue.h"
#include <Python.h>
Root root;
const int Foo::csi;
int Foo::si=25;
Bar Root::sbar;
void registerRoot()
{
addPythonObject("root1",root);
addPythonObject("root1",root);
addPythonObject("example.root1",root);
}
//BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Bar_overloadExample0,overloadExample,0,0);
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Bar_overloadExample1,overloadExample,1,2);
BOOST_PYTHON_MODULE(example)
{
python_t p;
p.defineClass<Root>();
p.addFunctional("registerRoot1",registerRoot);
p.addObject("static.root",root);
p.addObject("root",root);
addPythonObject("root",root);
int (Bar::*o2)(int,int) const=&Bar::overloadExample;
p.getClass<Bar>().overload("overloadExample",o2,Bar_overloadExample1());
}