Go to the documentation of this file.
30 #ifndef EXOTICA_CORE_PROPERTY_H_
31 #define EXOTICA_CORE_PROPERTY_H_
37 #include <boost/any.hpp>
38 #include <initializer_list>
47 boost::any
Get()
const;
53 Property(
const std::string& prop_name);
54 Property(
const std::string& prop_name,
bool is_required);
55 Property(
const std::string& prop_name,
bool is_required, boost::any val);
56 Property(std::initializer_list<boost::any> val);
61 const std::string&
GetName()
const;
75 Initializer(
const std::string& name,
const std::map<std::string, boost::any>& properties);
76 const std::string&
GetName()
const;
77 void SetName(
const std::string& name);
79 boost::any
GetProperty(
const std::string& name)
const;
80 void SetProperty(
const std::string& name, boost::any);
109 template <class C, typename = typename std::enable_if<std::is_base_of<InitializerBase, C>::value, C>::type>
123 return C().GetTemplate();
128 return C().GetAllTemplates();
143 #endif // EXOTICA_CORE_PROPERTY_H_
void SetName(const std::string &name)
C parameters_
Definition: property.h:139
virtual void InstantiateBase(const Initializer &init)
Definition: property.h:105
virtual void InstantiateInternal(const Initializer &init)=0
boost::any GetProperty(const std::string &name) const
std::vector< std::string > GetPropertyNames() const
InitializerBase()=default
bool IsInitializerVectorType() const
Property(const std::string &prop_name)
virtual void Instantiate(const C &init)
Definition: property.h:131
const C & GetParameters() const
Definition: property.h:136
std::vector< Initializer > GetAllTemplates() const override
Definition: property.h:126
Definition: property.h:98
virtual ~InstantiableBase()=default
Definition: property.h:110
Definition: cartpole_dynamics_solver.h:38
virtual std::vector< Initializer > GetAllTemplates() const =0
boost::any value_
Definition: property.h:65
virtual Initializer GetInitializerTemplate()=0
Definition: property.h:88
std::map< std::string, Property > properties_
Definition: property.h:84
void InstantiateInternal(const Initializer &init) override
Definition: property.h:113
bool HasProperty(const std::string &name) const
std::string name_
Definition: property.h:67
void AddProperty(const Property &prop)
const std::string & GetName() const
void SetProperty(const std::string &name, boost::any)
virtual std::vector< Initializer > GetAllTemplates() const =0
Definition: property.h:70
std::string name_
Definition: property.h:85
Initializer GetInitializerTemplate() override
Definition: property.h:121
InstantiableBase()=default
virtual void Check(const Initializer &other) const =0
bool required_
Definition: property.h:66
Definition: property.h:44
const std::string & GetName() const
void Set(const C val)
Definition: property.h:49
virtual ~InitializerBase()=default
virtual Initializer GetTemplate() const =0
std::string GetType() const
bool IsStringType() const