LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
test05.cc File Reference
#include <boost/python.hpp>
#include "XFunc.hh"
#include "AClass.hh"

Go to the source code of this file.

Functions

 BOOST_PYTHON_FUNCTION_OVERLOADS (f_func2, func2, 1, 2)
 
 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (f_AMethod, AMethod, 0, 2)
 
 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS (f_CMethod, CMethod, 1, 3)
 
 BOOST_PYTHON_MODULE (test05)
 

Variables

int(* func3_1 )(int) = func3
 
int(* func3_2 )(double) = func3
 
int(AClass::* f1_BMethod )() = &AClass::BMethod
 
double(AClass::* f2_BMethod )(double) = &AClass::BMethod
 

Function Documentation

BOOST_PYTHON_FUNCTION_OVERLOADS ( f_func2  ,
func2  ,
,
 
)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS ( f_AMethod  ,
AMethod  ,
,
 
)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS ( f_CMethod  ,
CMethod  ,
,
 
)
BOOST_PYTHON_MODULE ( test05  )

Definition at line 58 of file test05.cc.

References AClass::CMethod(), f1_BMethod, f2_BMethod, func3_1, func3_2, AClass::GetIVal(), and AClass::SetIVal().

58  {
59  // this is a temporal solution
60  def("func2", (int(*)(int,int))0, f_func2());
61  //def("func2", func2_1);
62  //def("func2", func2_2);
63 
64  def("func3", func3_2);
65  def("func3", func3_1);
66 
67  class_<AClass>( "AClass", "a class")
68  .def(init<>())
69  .def(init<int, optional<double> >())
70  .add_property("i", &AClass::GetIVal, &AClass::SetIVal)
71  .def("AMethod", (int(AClass::*)(int,double))0,
72  f_AMethod(args("i","d"), "amethod"))
73  .def("BMethod", f1_BMethod)
74  .def("BMethod", f2_BMethod, args("i","d"), "bmethod2")
75  .def("CMethod", &AClass::CMethod,
76  f_CMethod((arg("i"), arg("d1")=1., arg("d2")=2.),
77  "cmethod: return i*d1*d2")
78  )
79  ;
80 }
double CMethod(int i, double d1=1., double d2=2.)
Definition: AClass.cc:102
int GetIVal() const
Definition: AClass.hh:66
int(* func3_2)(double)
Definition: test05.cc:49
void SetIVal(int i)
Definition: AClass.hh:65
double(AClass::* f2_BMethod)(double)
Definition: test05.cc:55
Definition: AClass.hh:40
int(AClass::* f1_BMethod)()
Definition: test05.cc:54
int(* func3_1)(int)
Definition: test05.cc:48

Variable Documentation

int(AClass::* f1_BMethod) () = &AClass::BMethod

Definition at line 54 of file test05.cc.

Referenced by BOOST_PYTHON_MODULE().

double(AClass::* f2_BMethod) (double) = &AClass::BMethod

Definition at line 55 of file test05.cc.

Referenced by BOOST_PYTHON_MODULE().

int(* func3_1) (int) = func3

Definition at line 48 of file test05.cc.

Referenced by BOOST_PYTHON_MODULE().

int(* func3_2) (double) = func3

Definition at line 49 of file test05.cc.

Referenced by BOOST_PYTHON_MODULE().