gnomemm r2022 - in libgdamm/trunk: . libgda/src
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r2022 - in libgdamm/trunk: . libgda/src
- Date: Tue, 27 Jan 2009 16:26:37 +0000 (UTC)
Author: murrayc
Date: Tue Jan 27 16:26:37 2009
New Revision: 2022
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2022&view=rev
Log:
2009-01-27 Murray Cumming <murrayc murrayc com>
* libgda/src/set.[hg|ccg]: Rename add_holder(string, value) to
add_holder_as_value(). Added a templated add_holder(string, T), to
make application code less annoying.
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 Tue Jan 27 16:26:37 2009
@@ -63,7 +63,7 @@
_WRAP_METHOD(bool set_value_as_value(const Value& value), gda_holder_set_value, errthrow)
//TODO: Documentation:
- template<class ValueType>
+ template <class ValueType>
bool set_value(const ValueType& value);
Modified: libgdamm/trunk/libgda/src/set.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/set.ccg (original)
+++ libgdamm/trunk/libgda/src/set.ccg Tue Jan 27 16:26:37 2009
@@ -35,7 +35,7 @@
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_as_value(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 Tue Jan 27 16:26:37 2009
@@ -76,7 +76,16 @@
* @param id Name of the holder
* @param value Value of the holder
*/
- void add_holder (const Glib::ustring& id, const Gda::Value& value);
+ void add_holder_as_value(const Glib::ustring& id, const Gda::Value& value);
+
+ /** Add a holder
+ *
+ * Convenience method to add a holder with value
+ * @param id Name of the holder
+ * @param value Value of the holder
+ */
+ template <class ValueType>
+ void add_holder(const Glib::ustring& id, const ValueType& value);
_WRAP_METHOD(void remove_holder(const Glib::RefPtr<Holder>& holder), gda_set_remove_holder)
@@ -107,6 +116,17 @@
_WRAP_PROPERTY("name", Glib::ustring)
};
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+template <class ValueType> inline
+void Set::add_holder(const Glib::ustring& id, const ValueType& value)
+{
+ Gnome::Gda::Value gdavalue(value);
+ Glib::RefPtr<Holder> holder = Holder::create(gdavalue.get_value_type(), id);
+ holder->set_value(value);
+ this->add_holder(holder);
+}
+#endif //DOXYGEN_SHOULD_SKIP_THIS
+
} // namespace Gda
} // namespace Gnome
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]