|
Mantid
|
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the template type. More...
#include <PySequenceToVector.h>
Public Types | |
| using | TypedVector = std::vector< DestElementType > |
Public Member Functions | |
| void | copyTo (TypedVector &dest) |
| Fill the container with data from the array. | |
| TypedVector | operator() () |
| Converts the Python object to a C++ vector. | |
| PySequenceToVector (const boost::python::object &value) | |
Private Member Functions | |
| PyObject * | ptr () const |
| std::size_t | srcSize () const |
| void | throwIfSizeMismatched (const TypedVector &dest) const |
Private Attributes | |
| boost::python::object | m_obj |
| Python object to convert. | |
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the template type.
Definition at line 50 of file PySequenceToVector.h.
| using Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::TypedVector = std::vector<DestElementType> |
Definition at line 52 of file PySequenceToVector.h.
|
inline |
Definition at line 54 of file PySequenceToVector.h.
|
inline |
Fill the container with data from the array.
| dest | A vector<DestElementType> that receives the data |
Definition at line 71 of file PySequenceToVector.h.
References Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::ptr(), Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::srcSize(), and Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::throwIfSizeMismatched().
Referenced by Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::operator()(), and reorder().
|
inline |
Converts the Python object to a C++ vector.
Definition at line 61 of file PySequenceToVector.h.
References Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::copyTo(), and Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::srcSize().
|
inlineprivate |
Definition at line 81 of file PySequenceToVector.h.
References Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::m_obj.
Referenced by Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::copyTo(), and Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::srcSize().
|
inlineprivate |
Definition at line 83 of file PySequenceToVector.h.
References Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::ptr().
Referenced by Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::copyTo(), Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::operator()(), and Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::throwIfSizeMismatched().
|
inlineprivate |
Definition at line 85 of file PySequenceToVector.h.
References Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::srcSize(), and std::to_string().
Referenced by Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::copyTo().
|
private |
Python object to convert.
Definition at line 93 of file PySequenceToVector.h.
Referenced by Mantid::PythonInterface::Converters::PySequenceToVector< DestElementType >::ptr().