From 6f1a5a4f19fed4f0e0b571e160928a2e22211424 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 8 Jun 2005 16:07:56 +0000 Subject: 2005-06-08 Murray Cumming ::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 --- ChangeLog | 8 ++++++++ glib/glibmm/propertyproxy.h | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index f28e5e15..bd7925e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-06-08 Murray Cumming ::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 * glib/glibmm/interface.cc: Interface_Class:add_interface(), used by diff --git a/glib/glibmm/propertyproxy.h b/glib/glibmm/propertyproxy.h index bfba5516..e21c4b25 100644 --- a/glib/glibmm/propertyproxy.h +++ b/glib/glibmm/propertyproxy.h @@ -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 is safe, and avoids code duplication. - static_cast&>(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 is safe, and avoids code duplication. - return static_cast&>(base).get_value(); - } + PropertyType get_value() const; operator PropertyType() const { return this->get_value(); } @@ -154,6 +144,32 @@ T PropertyProxy::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 +void PropertyProxy_WriteOnly::set_value(const T& data) +{ + Glib::Value value; + value.init(Glib::Value::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 +T PropertyProxy_ReadOnly::get_value() const +{ + Glib::Value value; + value.init(Glib::Value::value_type()); + + get_property_(value); + return value.get(); +} + #endif /* DOXYGEN_SHOULD_SKIP_THIS */ } // namespace Glib -- cgit v1.2.1