forpy
2
|
#include <storage.h>
Public Types | |
using | Base = mu::variant< Ts... > |
Design concepts behind this storage.
Aims are:
Since it should be possible to use this library with large datasets that shouldn't have to be copied when library functions are called, this implies some additional constraints.
The standard says that std::variant can't hold pointer types, which is necessary for this to work. The currently provided mu::variant can do this.
To not influence library user experience and not create problems when feeding the library with data, all external methods accept either std::shared_ptr<Eigen::Mat>s if ownership of the data must be set. That's why the store
suffixed variants contain shared_ptr's (otherwise the data would have to be copied).
In all other cases, the variants contain the data or MatRefs to it directly for internal library use.
The ptr_variant is a subclass of the variant for which an automatic return type conversion to Python is applied. Empty
is similar to std::monostate
. The VReset visitor can be used to clear ptr_variant
s.
using forpy::ptr_variant< Ts >::Base = mu::variant<Ts...> |