SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEImplementation
src
lib
PythonConfig
PyAperture.cpp
Go to the documentation of this file.
1
18
#include "
SEImplementation/PythonConfig/PyAperture.h
"
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
32
std::string
PyAperture::toString
()
const
{
33
std::stringstream
str;
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.h
std::string
std::stringstream
SourceXtractor::PyAperture::apertures
std::vector< float > apertures
Definition:
PyAperture.h:36
SourceXtractor::PyAperture::toString
std::string toString() const
Definition:
PyAperture.cpp:32
SourceXtractor::PyAperture::PyAperture
PyAperture(const boost::python::list &py_apertures)
Definition:
PyAperture.cpp:26
SourceXtractor
Definition:
Aperture.h:30
std::vector::push_back
T push_back(T... args)
std::vector::size
T size(T... args)
std::stringstream::str
T str(T... args)
Generated by
1.9.1