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

Go to the source code of this file.

Functions

 BOOST_PYTHON_MODULE (test04)
 

Function Documentation

BOOST_PYTHON_MODULE ( test04  )

Definition at line 40 of file test04.cc.

References Track::GetStep1(), Track::GetStep2(), Track::GetStep3(), Step::GetX(), and Step::SetX().

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