Public Types | Static Public Member Functions | List of all members
eigenpy::VariantConverter< Variant > Struct Template Reference

#include <variant.hpp>

Public Types

typedef ReturnInternalVariant< variant_typereturn_internal_reference
 
typedef Variant variant_type
 

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

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 >
static 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:


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45