52 bool isValid()
const {
return object_ && property_;}
55 if(!property_)
return EValueType::eInvalid;
56 return property_->getValueType();
59 errc_t getValueDouble(
double& value)
const
61 auto object = getObject();
62 if(!property_ || !
object)
return eErrorInvalidParam;
63 return property_->getValueDouble(
object, value);
65 errc_t setValueDouble(
double value)
67 auto object = getObject();
68 if(!property_ || !
object)
return eErrorInvalidParam;
69 return property_->setValueDouble(
object, value);
71 errc_t getValueInt(
int& value)
const
73 auto object = getObject();
74 if(!property_ || !
object)
return eErrorInvalidParam;
75 return property_->getValueInt(
object, value);
77 errc_t setValueInt(
int value)
79 auto object = getObject();
80 if(!property_ || !
object)
return eErrorInvalidParam;
81 return property_->setValueInt(
object, value);
83 errc_t getValueBool(
bool& value)
const
85 auto object = getObject();
86 if(!property_ || !
object)
return eErrorInvalidParam;
87 return property_->getValueBool(
object, value);
89 errc_t setValueBool(
bool value)
91 auto object = getObject();
92 if(!property_ || !
object)
return eErrorInvalidParam;
93 return property_->setValueBool(
object, value);
95 errc_t getValueString(std::string& value)
const
97 auto object = getObject();
98 if(!property_ || !
object)
return eErrorInvalidParam;
99 return property_->getValueString(
object, value);
103 auto object = getObject();
104 if(!property_ || !
object)
return eErrorInvalidParam;
105 return property_->setValueString(
object, value);
107 errc_t getValueObject(
Object*& value)
const
109 auto object = getObject();
110 if(!property_ || !
object)
return eErrorInvalidParam;
111 return property_->getValueObject(
object, value);
113 errc_t setValueObject(
Object* value)
115 auto object = getObject();
116 if(!property_ || !
object)
return eErrorInvalidParam;
117 return property_->setValueObject(
object, value);
120 double getValueDouble()
const
123 getValueDouble(value);
126 int getValueInt()
const
132 bool getValueBool()
const
138 std::string getValueString()
const
141 getValueString(value);
144 Object* getValueObject()
const
147 getValueObject(value);
151 operator double()
const
153 return getValueDouble();
157 return getValueInt();
159 operator bool()
const
161 return getValueBool();
163 operator std::string()
const
165 return getValueString();
170 setValueDouble(value);
179 template<typename T, typename = typename std::enable_if<std::is_same<T, bool>::value>::type>
187 setValueString(value);
191 void* getObject()
const;
193 ObjectPtrType object_{};
194 PropertyType* property_{
nullptr};