SourceXtractorPlusPlus  0.10
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PyAperture.cpp
Go to the documentation of this file.
1 
19 #include <boost/python/extract.hpp>
20 
21 
22 namespace SourceXtractor {
23 
24 namespace bp = boost::python;
25 
26 PyAperture::PyAperture(const boost::python::list &py_apertures) {
27  for (int i = 0; i < bp::len(py_apertures); ++i) {
28  apertures.push_back(bp::extract<float>(py_apertures[i]));
29  }
30 }
31 
34  str << "(ID:" << id << ", apertures:[";
35  for (unsigned int i = 0; i < apertures.size(); ++i) {
36  str << apertures[i];
37  if (i < apertures.size() - 1) {
38  str << ",";
39  }
40  }
41  str << "])";
42  return str.str();
43 }
44 
45 } // end SourceXtractor
PyAperture(const boost::python::list &py_apertures)
Definition: PyAperture.cpp:26
STL class.
T push_back(T...args)
std::vector< float > apertures
Definition: PyAperture.h:36
T str(T...args)
T size(T...args)
std::string toString() const
Definition: PyAperture.cpp:32