Commit 6f1a5a4f authored by Murray Cumming's avatar Murray Cumming
Browse files

2005-06-08 Murray Cumming <murrayc@murrayc.com

        * glib/glibmm/propertyproxy.h:
        PropertyProxy_ReadOnly<>::get_value(),
        PropertyProxy_WriteOnly<>::set_value(): Add implementations
        instead of casting to unrelated PropertyProxy() and calling it
        there. The AIX compiler did not like this hack. Bug #301610
parent 2f1e54c8
2005-06-08 Murray Cumming <murrayc@murrayc.com
* glib/glibmm/propertyproxy.h:
PropertyProxy_ReadOnly<>::get_value(),
PropertyProxy_WriteOnly<>::set_value(): Add implementations
instead of casting to unrelated PropertyProxy() and calling it
there. The AIX compiler did not like this hack. Bug #301610
2005-02-18 Murray Cumming <murrayc@murrayc.com>
* glib/glibmm/interface.cc: Interface_Class:add_interface(), used by
......
......@@ -86,12 +86,7 @@ public:
/** Set the value of this property.
* @param data The new value for the property.
*/
void set_value(const PropertyType& data)
{
PropertyProxy_Base& base = *this;
// The downcast to PropertyProxy<T> is safe, and avoids code duplication.
static_cast<PropertyProxy<T>&>(base).set_value(data);
}
void set_value(const PropertyType& data);
/** Set the value of this property back to its default value
*/
......@@ -118,12 +113,7 @@ public:
/** Get the value of this property.
* @result The current value of the property.
*/
PropertyType get_value() const
{
const PropertyProxy_Base& base = *this;
// The downcast to PropertyProxy<T> is safe, and avoids code duplication.
return static_cast<const PropertyProxy<T>&>(base).get_value();
}
PropertyType get_value() const;
operator PropertyType() const
{ return this->get_value(); }
......@@ -154,6 +144,32 @@ T PropertyProxy<T>::get_value() const
return value.get();
}
//We previously just static_cast<> PropertyProxy_WriteOnly<> to PropertyProxy<> to call its set_value(),
//to avoid code duplication.
//But the AIX compiler does not like that hack.
template <class T>
void PropertyProxy_WriteOnly<T>::set_value(const T& data)
{
Glib::Value<T> value;
value.init(Glib::Value<T>::value_type());
value.set(data);
set_property_(value);
}
//We previously just static_cast<> PropertyProxy_WriteOnly<> to PropertyProxy<> to call its set_value(),
//to avoid code duplication.
//But the AIX compiler does not like that hack.
template <class T>
T PropertyProxy_ReadOnly<T>::get_value() const
{
Glib::Value<T> value;
value.init(Glib::Value<T>::value_type());
get_property_(value);
return value.get();
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
} // namespace Glib
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment