Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test05.cc File Reference
#include <boost/python.hpp>
#include "XFunc.hh"
#include "AClass.hh"
Include dependency graph for test05.cc:

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 59 of file test05.cc.

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

Here is the call graph for this function:

Variable Documentation

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

Definition at line 55 of file test05.cc.

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

Definition at line 56 of file test05.cc.

int(* func3_1)(int) = func3

Definition at line 49 of file test05.cc.

int(* func3_2)(double) = func3

Definition at line 50 of file test05.cc.