// -*- mode:c++ -*- // // Module testnonlinear.cpp // // Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy // at http://www.boost.org/LICENSE_1_0.txt) // // History // ======= // 2003/ 9/29 rmg File creation from testlinear.cpp // // $Id$ // #include "IntWrapper.hpp" #include #include #include #include #include #include #include #include #include bool IntWrapper::gIntWrapperTrace = true; unsigned IntWrapper::ourObjectCounter = 0; std::string repr (IntWrapper const &i) { std::stringstream temp; temp << i; return temp.str(); } BOOST_PYTHON_MODULE(testnonlinear) { boost::python::implicitly_convertible (); boost::python::def ("setTrace", &IntWrapper::setTrace); boost::python::class_ ("IntWrapper", boost::python::init()) .def ("increment", &IntWrapper::increment) .def ("__repr__", repr) .def ("__cmp__", compare) ; typedef std::map Container1; boost::python::class_("Map") .def (boost::python::indexing::container_suite()); typedef std::set Container2; boost::python::class_("Set") .def (boost::python::indexing::container_suite()); }