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

Go to the source code of this file.

Functions

 BOOST_PYTHON_MODULE (test04)
 

Function Documentation

BOOST_PYTHON_MODULE ( test04  )

Definition at line 41 of file test04.cc.

41  {
42  class_<Step>( "Step", "step class")
43  .def(init<>())
44  .add_property("x", &Step::GetX, &Step::SetX)
45  ;
46 
47  class_<Track>( "Track", "track class")
48  .def(init<>())
49  .def("GetStep1", &Track::GetStep1,
50  return_internal_reference<>())
51  .def("GetStep2", &Track::GetStep2,
52  return_value_policy<reference_existing_object>())
53  // this is invalid, just for test
54  .def("GetStep3", &Track::GetStep3,
55  return_value_policy<manage_new_object>())
56  ;
57 }
const Step * GetStep2() const
Definition: Track.cc:77
const Step * GetStep3() const
Definition: Track.cc:84
const Step * GetStep1() const
Definition: Track.cc:70
double GetX() const
Definition: Step.hh:58
void SetX(double x0)
Definition: Step.hh:57

Here is the call graph for this function: