gnomemm r2017 - in libgdamm/trunk: . libgda/src
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r2017 - in libgdamm/trunk: . libgda/src
- Date: Mon, 26 Jan 2009 17:24:16 +0000 (UTC)
Author: murrayc
Date: Mon Jan 26 17:24:16 2009
New Revision: 2017
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2017&view=rev
Log:
2009-01-26 Murray Cumming <murrayc murrayc com>
* libgda/src/holder.hg: set_value(): Renamed to set_value_as_value().
Added a templated set_value() method, to simplify application code.
Modified:
libgdamm/trunk/ChangeLog
libgdamm/trunk/libgda/src/holder.hg
libgdamm/trunk/libgda/src/set.ccg
libgdamm/trunk/libgda/src/set.hg
Modified: libgdamm/trunk/libgda/src/holder.hg
==============================================================================
--- libgdamm/trunk/libgda/src/holder.hg (original)
+++ libgdamm/trunk/libgda/src/holder.hg Mon Jan 26 17:24:16 2009
@@ -54,9 +54,19 @@
_WRAP_METHOD(GType get_g_type() const, gda_holder_get_g_type)
_WRAP_METHOD(Glib::ustring get_id() const, gda_holder_get_id)
+
_WRAP_METHOD(Value get_value() const, gda_holder_get_value)
- _WRAP_METHOD(Glib::ustring get_value_str(const Glib::RefPtr<DataHandler>& dh), gda_holder_get_value_str)
- _WRAP_METHOD(bool set_value(const Value& value), gda_holder_set_value, errthrow)
+
+
+ _WRAP_METHOD(Glib::ustring get_value_str(const Glib::RefPtr<DataHandler>& dh) const, gda_holder_get_value_str)
+
+ _WRAP_METHOD(bool set_value_as_value(const Value& value), gda_holder_set_value, errthrow)
+
+ //TODO: Documentation:
+ template<class ValueType>
+ bool set_value(const ValueType& value);
+
+
_WRAP_METHOD(bool set_value_str(const Glib::RefPtr<DataHandler>& dh, const Glib::ustring& value), gda_holder_set_value_str, errthrow)
_WRAP_METHOD(bool take_value(const Value& value), gda_holder_take_value, errthrow)
_WRAP_METHOD(Value take_static_value (const Value& value, bool& value_changed), gda_holder_take_static_value, errthrow)
@@ -101,8 +111,16 @@
_WRAP_SIGNAL(Error validate_change(Value value), "validate-change", no_default_handler)
_WRAP_SIGNAL(void attribute_changed (Glib::ustring attr_name, Value value), "attribute-changed", no_default_handler)
-
};
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+template <class ValueType> inline
+bool Holder::set_value(const ValueType& value)
+{
+ Gnome::Gda::Value gdavalue(value);
+ return this->set_value(value);
+}
+#endif //DOXYGEN_SHOULD_SKIP_THIS
+
} // namespace Gda
} // namespace Gnome
Modified: libgdamm/trunk/libgda/src/set.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/set.ccg (original)
+++ libgdamm/trunk/libgda/src/set.ccg Mon Jan 26 17:24:16 2009
@@ -29,12 +29,13 @@
namespace Gda
{
-template<class T> bool Set::set_holder_value(const Glib::ustring& id, T value)
+template<class T>
+bool Set::set_holder_value(const Glib::ustring& id, T value)
{
return gda_set_set_holder_value (gobj(), id.c_str(), value);
}
-void Set::add_holder (const Glib::ustring& id, const Gda::Value& value)
+void Set::add_holder(const Glib::ustring& id, const Gda::Value& value)
{
Glib::RefPtr<Holder> holder = Holder::create(value.get_value_type(), id);
holder->set_value(value);
Modified: libgdamm/trunk/libgda/src/set.hg
==============================================================================
--- libgdamm/trunk/libgda/src/set.hg (original)
+++ libgdamm/trunk/libgda/src/set.hg Mon Jan 26 17:24:16 2009
@@ -62,7 +62,8 @@
_WRAP_METHOD(Value get_holder_value(const Glib::ustring& holder_id) const, gda_set_get_holder_value)
_WRAP_METHOD_DOCS_ONLY(gda_set_set_holder_value)
- template<class T> bool set_holder_value(const Glib::ustring& holder_id, T value);
+ template<class T>
+ bool set_holder_value(const Glib::ustring& holder_id, T value);
_WRAP_METHOD(Glib::RefPtr<Holder> get_holder(const Glib::ustring& holder_id), gda_set_get_holder, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Holder> get_holder(const Glib::ustring& holder_id) const, gda_set_get_holder, refreturn)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]