eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
Loading...
Searching...
No Matches
eigenpy::VariantConverter< Variant > Struct Template Reference

#include <eigenpy/variant.hpp>

Public Types

typedef Variant variant_type
typedef ReturnInternalVariant< variant_type > return_internal_reference

Static Public Member Functions

static void registration ()

Detailed Description

template<typename Variant>
struct eigenpy::VariantConverter< Variant >

Define a defaults converter to convert a {boost,std}::variant alternative to a Python object by copy and to convert implicitly an alternative to a {boost,std}::variant.

Example:

typedef boost::variant<Struct1, Struct2> MyVariant; struct VariantHolder { MyVariant variant; }; ... void expose() { bp::class_<Struct1>("Struct1", bp::init<>()); bp::class_<Struct2>("Struct1", bp::init<>()) typedef eigenpy::VariantConverter<MyVariant> Converter; Converter::registration();

bp::class_<VariantHolder>("VariantHolder", bp::init<>()) .add_property("variant", bp::make_getter(&VariantHolder::variant, Converter::return_internal_reference()), bp::make_setter(&VariantHolder::variant)); }

Definition at line 337 of file variant.hpp.

Member Typedef Documentation

◆ return_internal_reference

template<typename Variant>
typedef ReturnInternalVariant<variant_type> eigenpy::VariantConverter< Variant >::return_internal_reference

Definition at line 339 of file variant.hpp.

◆ variant_type

template<typename Variant>
typedef Variant eigenpy::VariantConverter< Variant >::variant_type

Definition at line 338 of file variant.hpp.

Member Function Documentation

◆ registration()

template<typename Variant>
void eigenpy::VariantConverter< Variant >::registration()
inlinestatic

Definition at line 341 of file variant.hpp.


The documentation for this struct was generated from the following file: