24#include <boost/utility/string_ref.hpp>
49 std::shared_ptr<Context> m_context = {};
52 boost::string_ref
name()
const;
81 for (
auto const &p :
params) {
111 return std::vector<std::string>(
names.begin(),
names.end());
121 static_cast<void>(
name);
165 virtual std::vector<std::pair<std::string, Variant>>
Context of an object handle.
Base class for interface handles.
VariantMap get_parameters() const
Get current parameters.
boost::string_ref name() const
ObjectHandle(ObjectHandle const &)=delete
ObjectHandle & operator=(ObjectHandle const &)=delete
std::string serialize() const
virtual std::span< const boost::string_ref > valid_parameters() const
Get required and optional parameters for class.
auto get_valid_parameters() const
Variant call_method(const std::string &name, const VariantMap ¶ms)
Call a method on the object.
virtual void set_internal_state(std::string const &)
virtual void do_set_parameter(const std::string &, const Variant &)
Local implementation of set_parameter.
virtual void do_construct(VariantMap const ¶ms)
virtual Variant do_call_method(const std::string &, const VariantMap &)
Local implementation of call_method.
virtual std::vector< std::pair< std::string, Variant > > serialize_parameters() const
Serialize parameters.
Context * context() const
Responsible context.
virtual Variant get_parameter(std::string const &name) const
Get single parameter.
virtual std::string get_internal_state() const
void construct(VariantMap const ¶ms)
Construct the handled object.
void set_parameter(const std::string &name, const Variant &value)
Set single parameter.
static ObjectRef deserialize(const std::string &state, Context &ctx)
Make object from serialized state.
virtual ~ObjectHandle()=default
std::shared_ptr< ObjectHandle > ObjectRef
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
std::unordered_map< std::string, Variant > VariantMap
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.
constexpr const None none
None-"literal".
static SteepestDescentParameters params
Currently active steepest descent instance.