19#ifndef SCRIPT_INTERFACE_AUTO_PARAMETERS_AUTO_PARAMETER_HPP
20#define SCRIPT_INTERFACE_AUTO_PARAMETERS_AUTO_PARAMETER_HPP
51 template <
typename T,
class O>
62 template <
typename T,
class O>
76 template <
typename T,
class O>
85 template <
typename T,
class O>
94 template <
typename T,
class O>
102 template <
typename T,
class O>
117 template <
typename T>
126 template <
typename T>
141 template <
typename Setter,
typename Getter>
149 template <
typename Getter>
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
boost::make_recursive_variant< None, bool, int, std::size_t, double, std::string, ObjectRef, Utils::Vector3b, Utils::Vector3i, Utils::Vector2d, Utils::Vector3d, Utils::Vector4d, std::vector< int >, std::vector< double >, std::vector< boost::recursive_variant_ >, std::unordered_map< int, boost::recursive_variant_ >, std::unordered_map< std::string, boost::recursive_variant_ > >::type Variant
Possible types for parameters.
Description and getter/setter for a parameter.
const std::string name
The interface name.
AutoParameter(const char *name, ReadOnly, Getter const &get)
Read-only parameter with a user-provided getter.
AutoParameter(const char *name, std::shared_ptr< O > &obj, T const &(O::*getter)())
Read-only parameter that is bound to an object.
AutoParameter(const char *name, std::shared_ptr< O > &obj, T(O::*getter)() const)
Read-only parameter that is bound to an object.
AutoParameter(const char *name, std::shared_ptr< O > &obj, T O::*getter)
Read-only parameter that is bound to an object.
const std::function< void(Variant const &)> setter_
Set the parameter.
void set(Variant const &v) const
AutoParameter(const char *name, T &binding)
Read-write parameter that is bound to an object.
AutoParameter(const char *name, std::shared_ptr< O > &obj, void(O::*setter)(T const &), T const &(O::*getter)() const)
Read-write parameter that is bound to an object.
AutoParameter(const char *name, std::shared_ptr< O > &obj, T &(O::*getter_setter)())
Read-write parameter that is bound to an object.
AutoParameter(const char *name, Setter const &set, Getter const &get)
Read-write parameter with a user-provided getter and setter.
const std::function< Variant()> getter_
Get the parameter.
static constexpr const ReadOnly read_only
AutoParameter(const char *name, std::shared_ptr< O > &obj, void(O::*setter)(T const &), T(O::*getter)() const)
Read-write parameter that is bound to an object.
AutoParameter(const char *name, T const &binding)
Read-only parameter that is bound to an object.