4 #include "AttributeModifier.h"
15 template<
int notificationLevel>
23 #define IMPLEMENT_GET_VALUE_BOOL(type)\
24 virtual bool getValue(type value) const override \
26 bool tmpValue = mValue;\
27 CALL_GETMODIFIER(notificationLevel, tmpValue);\
28 value = (type)tmpValue;\
31 EXPAND_MACRO_FOR_BASE_TYPES(NOQUALIFIER, &, IMPLEMENT_GET_VALUE_BOOL);
33 virtual bool getValue(kstl::string& value)
const override
35 bool tmpValue = mValue;
36 CALL_GETMODIFIER(notificationLevel, tmpValue);
37 value = tmpValue ?
"true" :
"false";
43 #define IMPLEMENT_SET_VALUE_BOOL(type)\
44 virtual bool setValue(type value) override\
46 if (isReadOnly()) { return false; }\
47 bool tmpValue = (value != (type)0);\
48 CALL_SETMODIFIER(notificationLevel, tmpValue); \
50 DO_NOTIFICATION(notificationLevel);\
54 EXPAND_MACRO_FOR_BASE_TYPES(NOQUALIFIER, NOQUALIFIER, IMPLEMENT_SET_VALUE_BOOL);
57 virtual bool setValue(
const kstl::string& value)
override
60 bool tmpValue = (value ==
"true" || value ==
"TRUE");
61 CALL_SETMODIFIER(notificationLevel, tmpValue);
63 DO_NOTIFICATION(notificationLevel);
66 virtual bool setValue(
const char* value)
override {
if (this->
isReadOnly()) {
return false; }
if (value) { kstl::string localstr(value);
return setValue(localstr); }
return setValue(
false);}
77 #undef IMPLEMENT_SET_VALUE_BOOL
78 #undef IMPLEMENT_GET_VALUE_BOOL