Value.hpp
Go to the documentation of this file.
1 
8 #pragma once
9 
11 #include <etk/types.hpp>
12 #include <etk/math/Vector2D.hpp>
13 #include <etk/math/Vector3D.hpp>
14 #include <etk/Color.hpp>
15 
16 namespace eproperty {
20  template<class TYPE> class Value : public PropertyType<TYPE> {
21  public:
30  template<class CLASS_TYPE>
31  Value(CLASS_TYPE* _owner,
32  const std::string& _name,
33  const TYPE& _defaultValue,
34  const std::string& _description = "",
35  void (CLASS_TYPE::*_setObs)()=nullptr) :
36  eproperty::PropertyType<TYPE>(_owner, _name, _defaultValue, _description, _setObs) {
37 
38  }
43  Value(const TYPE& _defaultValue);
44  public:
45  std::string getValueSpecific(const TYPE& _valueRequested) const override;
46  void setString(const std::string& _newVal) override;
47  };
49  template<typename TYPE> std::ostream& operator <<(std::ostream& _os, const eproperty::Value<TYPE>& _obj) {
50  _os << _obj.get();
51  return _os;
52  }
53 }
54 
std::string getValueSpecific(const TYPE &_valueRequested) const override
Get the string of the specify value.
Value(CLASS_TYPE *_owner, const std::string &_name, const TYPE &_defaultValue, const std::string &_description="", void(CLASS_TYPE::*_setObs)()=nullptr)
Create a parameter with a specific type.
Definition: Value.hpp:31
void setString(const std::string &_newVal) override
Set a new value of the Property (with string interface).
Template base of the property (have a generic set and get for string)
Definition: PropertyType.hpp:18
Simple Value of the property (need to implement fuction etk::from_string<TYPE> to use it) ...
Definition: Value.hpp:20
eproperty global interface for all property implementation
Definition: Interface.hpp:14