![]() |
Belle II Software
release-08-02-04
|
Wrapper class for a list of strings to either be held in a std::vector or in a python list. More...
#include <Configuration.h>
Public Member Functions | |
| boost::python::list & | ensurePy () |
| Return the python list version. More... | |
| std::vector< std::string > & | ensureCpp () |
| Return the C++ vector version. More... | |
| void | append (const std::string &element) |
| Append an element to whatever representation we currently have. | |
| void | prepend (const std::string &element) |
| Prepend an element to whatever representation we currently have. | |
| void | shallowCopy (const boost::python::object &source) |
| shallow copy all elements of the source object into the python representation. More... | |
Private Attributes | |
| std::variant< std::vector< std::string >, boost::python::list > | m_value |
| Store either a std::vector or a python list of strings. | |
Wrapper class for a list of strings to either be held in a std::vector or in a python list.
It's basically a std::variant with some convenince members to convert between the two representations.
This is necessary as python lists can only exist after Py_Initialize() and before Py_Finalize() and since we want this configuration class to work also in command line tools we need to be able to use std::vector unless python functions are called.
Definition at line 30 of file Configuration.h.
| std::vector<std::string>& ensureCpp | ( | ) |
Return the C++ vector version.
Convert if necessary
| boost::python::list& ensurePy | ( | ) |
Return the python list version.
Convert if necessary
| void shallowCopy | ( | const boost::python::object & | source | ) |
shallow copy all elements of the source object into the python representation.
Also converts to python representation