#include using namespace boost::python; #include "io/dtr/Techno.h" #include "io/dtr/Rules.h" namespace DTR { BOOST_PYTHON_MODULE(pyDTR) { // class DTR::Name class_("Name", init()) .def("getString", &Name::getString, return_value_policy()) // return_value_policy because this method return a refenrce on string ; // class DTR::Rule class_("Rule", init()) // accessors .def("getName" , &Rule::getName ) .def("getType" , &Rule::getType ) .def("getValue" , &Rule::getValue ) .def("getRef" , &Rule::getRef ) .def("getLayer1", &Rule::getLayer1) .def("getLayer2", &Rule::getLayer2) // modifiers .def("setType" , &Rule::setType ) ; // class DTR::ARule derived from DTR::Rule class_ >("ARule", init()) ; // class DTR::Techno class_("Techno", init()) .def("readFromFile", &Techno::readFromFile, return_value_policy()) .staticmethod("readFromFile") .def("getName" , &Techno::getName ) .def("getUnit" , &Techno::getUnit ) .def("getValue" , static_cast(&Techno::getValue)) .def("getValue" , static_cast(&Techno::getValue)) .def("getValue" , static_cast(&Techno::getValue)) ; } }