Template Struct VariantConverter

Struct Documentation

template<typename Variant>
struct VariantConverter

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)); }

Public Types

typedef Variant variant_type
typedef ReturnInternalVariant<variant_type> return_internal_reference

Public Static Functions

static inline void registration()