9 #include <boost/ref.hpp>
10 #include <boost/bind.hpp>
11 #include <boost/function.hpp>
29 struct DescrQuantity {
30 std::vector<std::string>
me;
39 static DescrQuantity d;
44 std::vector<int>
const &
which()
const {
return m_which;}
48 std::vector<int>
const &
quantity()
const {
return m_quantity;}
60 typedef boost::function<float(Pedestals::Item const &)>
Value;
62 static std::vector<Value>
v(2);
71 : m_which(what.which()), m_what(what.quantity().
size())
74 std::vector<Value>
const &
v = allValues();
75 for (
size_t i=0;
i< m_what.size();
i++) m_what[
i] = v[what.quantity()[
i]];
78 for (
size_t i=0;
i<m_which.size(); ++
i) {
93 std::for_each(
object().m_pedestals.begin(),
94 object().m_pedestals.end(),boost::bind(&Printer::doit,boost::ref(p),_1));
110 namespace condPython {
113 using namespace boost::python;
115 class_<What>(
"What",init<>())
116 .def(
"set_which",&What::set_which)
117 .def(
"which",&What::which, return_value_policy<copy_const_reference>())
118 .def(
"set_quantity",&What::set_quantity)
119 .def(
"quantity",&What::quantity, return_value_policy<copy_const_reference>())
120 .def(
"descr_quantity",&What::descr_quantity, return_value_policy<copy_const_reference>())
#define PYTHON_WRAPPER(_class, _name)
std::vector< Item > m_pedestals
void defineWhat< Pedestals >()
tuple size
Write out results.