1 // (C) Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com>
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // Authors: Douglas Gregor
11 * This file reflects the Boost.MPI @c timer class into
14 #include <boost/python.hpp>
15 #include <boost/mpi/timer.hpp>
17 using namespace boost::python
;
18 using namespace boost::mpi
;
20 namespace boost
{ namespace mpi
{ namespace python
{
22 extern const char* timer_docstring
;
23 extern const char* timer_default_constructor_docstring
;
24 extern const char* timer_restart_docstring
;
25 extern const char* timer_elapsed_docstring
;
26 extern const char* timer_elapsed_min_docstring
;
27 extern const char* timer_elapsed_max_docstring
;
28 extern const char* timer_time_is_global_docstring
;
32 using boost::python::arg
;
33 using boost::python::object
;
35 class_
<timer
>("Timer", timer_docstring
)
37 .def("restart", &timer::restart
, timer_restart_docstring
)
38 .add_property("elapsed", &timer::elapsed
, timer_elapsed_docstring
)
39 .add_property("elapsed_min", &timer::elapsed_min
,
40 timer_elapsed_min_docstring
)
41 .add_property("elapsed_max", &timer::elapsed_max
,
42 timer_elapsed_max_docstring
)
43 .add_property("time_is_global", &timer::time_is_global
,
44 timer_time_is_global_docstring
)
48 } } } // end namespace boost::mpi::python