diff --git a/ewol/parameter/Interface.cpp b/ewol/parameter/Interface.cpp index 831a7b92..e0774f1d 100644 --- a/ewol/parameter/Interface.cpp +++ b/ewol/parameter/Interface.cpp @@ -87,3 +87,17 @@ std::map ewol::parameter::Interface::parameterGetAll(b } return out; } + + +size_t ewol::parameter::Interface::getParameterCount() const { + return m_list.size(); +} + +ewol::parameter::Parameter* ewol::parameter::Interface::getParameterRaw(const size_t& _id) const { + if (_id >= m_list.size()) { + EWOL_ERROR("Wrong ID for parameter list. " << _id << " >= " << m_list.size()); + return nullptr; + } + return m_list[_id]; +} + diff --git a/ewol/parameter/Interface.h b/ewol/parameter/Interface.h index 38e7b975..2f3570df 100644 --- a/ewol/parameter/Interface.h +++ b/ewol/parameter/Interface.h @@ -70,6 +70,21 @@ namespace ewol { * @return map on the parameters */ std::map parameterGetAll(bool _notIfDefault=true) const; + public: + /** + * @brief Get count of parameters. + * @return The number of the parameter. + */ + size_t getParameterCount() const; + /** + * @brief Get name of a parameters. + * @return _id Id of the parameter. + * @return pointer on the parameter. + */ + ewol::parameter::Parameter* getParameterRaw(const size_t& _id) const; + + + }; }; }; diff --git a/ewol/parameter/List.h b/ewol/parameter/List.h index 2516e310..784d3672 100644 --- a/ewol/parameter/List.h +++ b/ewol/parameter/List.h @@ -52,6 +52,10 @@ namespace ewol { m_list.insert(std::make_pair(_name, _value)); } // herited methode + virtual std::string getParameterType() const { + return "ewol::parameter::List"; + } + // herited methode virtual std::string getType() const { return typeid(MY_TYPE).name(); } diff --git a/ewol/parameter/Parameter.h b/ewol/parameter/Parameter.h index bed366fe..e17ec009 100644 --- a/ewol/parameter/Parameter.h +++ b/ewol/parameter/Parameter.h @@ -35,6 +35,11 @@ namespace ewol { virtual std::string getName() const { return m_name; }; + /** + * @brief Get the parameter type of the class in string mode. + * @return The string type of the parameter. + */ + virtual std::string getParameterType() const = 0; /** * @brief Get the type of the parameter in string mode. * @return The string type of the parameter. diff --git a/ewol/parameter/Range.h b/ewol/parameter/Range.h index 61ecc95e..7dcd9f56 100644 --- a/ewol/parameter/Range.h +++ b/ewol/parameter/Range.h @@ -50,6 +50,10 @@ namespace ewol { */ virtual ~Range() { }; // herited methode + virtual std::string getParameterType() const { + return "ewol::parameter::Range"; + } + // herited methode virtual std::string getType() const { return typeid(MY_TYPE).name(); } diff --git a/ewol/parameter/Value.h b/ewol/parameter/Value.h index 263a72a1..f596c85b 100644 --- a/ewol/parameter/Value.h +++ b/ewol/parameter/Value.h @@ -52,6 +52,10 @@ namespace ewol { */ virtual ~Value() { }; // herited methode + virtual std::string getParameterType() const { + return "ewol::parameter::Value"; + } + // herited methode virtual std::string getType() const { return typeid(MY_TYPE).name(); }