[libgdamm] Use std::vector<> instead of *Handle<> or std::list<>.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdamm] Use std::vector<> instead of *Handle<> or std::list<>.
- Date: Sun, 30 Jan 2011 13:38:13 +0000 (UTC)
commit 499dd4fc67f50ea510d191fb6badfbbe178845a6
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Jan 30 14:38:05 2011 +0100
Use std::vector<> instead of *Handle<> or std::list<>.
* libgda/src/batch.[hg|ccg]:
* libgda/src/connection.[hg|ccg]:
* libgda/src/datacomparator.[hg|ccg]:
* libgda/src/datamodel.[hg|ccg]:
* libgda/src/datamodelimport.hg:
* libgda/src/dataproxy.[hg|ccg]:
* libgda/src/metastore.hg:
* libgda/src/serveroperation.hg:
* libgda/src/set.hg:
* libgda/src/sqlbuilder.[hg|ccg]:
* libgda/src/statement.[hg|ccg]:
* libgda/src/xatransaction.[hg|ccg]:
* tools/m4/convert_libgdamm.m4: Use the new convention that we have just
started using in gtkmm 3. libgdamm is API/ABI unstable, so we can still make
big changes like this.
ChangeLog | 20 ++++++++++++++++++++
libgda/src/batch.ccg | 2 +-
libgda/src/batch.hg | 6 +++---
libgda/src/connection.ccg | 10 +++++-----
libgda/src/connection.hg | 25 +++++++++++++------------
libgda/src/datacomparator.ccg | 7 +++++++
libgda/src/datacomparator.hg | 4 +++-
libgda/src/datamodel.ccg | 6 +++---
libgda/src/datamodel.hg | 19 +++++++++----------
libgda/src/datamodelimport.hg | 2 +-
libgda/src/dataproxy.ccg | 4 ++--
libgda/src/dataproxy.hg | 2 +-
libgda/src/metastore.hg | 8 +++++---
libgda/src/serveroperation.hg | 7 +++++--
libgda/src/set.hg | 8 ++++----
libgda/src/sqlbuilder.ccg | 4 ++--
libgda/src/sqlbuilder.hg | 4 ++--
libgda/src/statement.ccg | 4 ++--
libgda/src/statement.hg | 6 +++---
libgda/src/xatransaction.ccg | 26 ++++++++------------------
libgda/src/xatransaction.hg | 10 +++++-----
tools/m4/convert_libgdamm.m4 | 8 --------
22 files changed, 104 insertions(+), 88 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 628b5f3..925390f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2011-01-30 Murray Cumming <murrayc murrayc com>
+
+ Use std::vector<> instead of *Handle<> or std::list<>.
+
+ * libgda/src/batch.[hg|ccg]:
+ * libgda/src/connection.[hg|ccg]:
+ * libgda/src/datacomparator.[hg|ccg]:
+ * libgda/src/datamodel.[hg|ccg]:
+ * libgda/src/datamodelimport.hg:
+ * libgda/src/dataproxy.[hg|ccg]:
+ * libgda/src/metastore.hg:
+ * libgda/src/serveroperation.hg:
+ * libgda/src/set.hg:
+ * libgda/src/sqlbuilder.[hg|ccg]:
+ * libgda/src/statement.[hg|ccg]:
+ * libgda/src/xatransaction.[hg|ccg]:
+ * tools/m4/convert_libgdamm.m4: Use the new convention that we have just
+ started using in gtkmm 3. libgdamm is API/ABI unstable, so we can still make
+ big changes like this.
+
2010-12-09 Murray Cumming <murrayc murrayc com>
Adapt to gmmproc m4 changes in glibmm.
diff --git a/libgda/src/batch.ccg b/libgda/src/batch.ccg
index 6a8873f..c8a4e90 100644
--- a/libgda/src/batch.ccg
+++ b/libgda/src/batch.ccg
@@ -30,7 +30,7 @@ namespace Gda
{
//Fix compilation of our generated code:
-typedef Batch::StatementSList StatementSList;
+typedef Batch::StatementVector StatementVector;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
diff --git a/libgda/src/batch.hg b/libgda/src/batch.hg
index 00e5a43..8bd229e 100644
--- a/libgda/src/batch.hg
+++ b/libgda/src/batch.hg
@@ -52,11 +52,11 @@ public:
_WRAP_METHOD(void remove_statement(const Glib::RefPtr<Statement>& stmt), gda_batch_remove_statement)
_WRAP_METHOD(Glib::ustring serialize() const, gda_batch_serialize)
- typedef Glib::SListHandle<Glib::RefPtr<const Statement> > StatementSList;
+ typedef std::vector<Glib::RefPtr<const Statement> > StatementVector;
//There is no non-const override for this, because the C function returns const items.
- #m4 _CONVERSION(`const GSList*',`StatementSList',`$2((GSList*)$3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(StatementSList get_statements() const, gda_batch_get_statements)
+ #m4 _CONVERSION(`const GSList*',`StatementVector',`$2(Glib::SListHandler<Glib::RefPtr<const Statement> >::slist_to_vector((GSList*)$3, Glib::OWNERSHIP_NONE))')
+ _WRAP_METHOD(StatementVector get_statements() const, gda_batch_get_statements)
_WRAP_METHOD_DOCS_ONLY(gda_statement_get_parameters)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
diff --git a/libgda/src/connection.ccg b/libgda/src/connection.ccg
index abb71fd..e782ee1 100644
--- a/libgda/src/connection.ccg
+++ b/libgda/src/connection.ccg
@@ -273,9 +273,9 @@ int Connection::statement_execute_non_select_builder(const Glib::RefPtr<const Sq
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
-Glib::ustring Connection::statement_to_sql(const Glib::RefPtr<const Statement>& statement, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::list< Glib::RefPtr<Holder> >& params_used) const
+Glib::ustring Connection::statement_to_sql(const Glib::RefPtr<const Statement>& statement, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::vector< Glib::RefPtr<Holder> >& params_used) const
#else
-Glib::ustring Connection::statement_to_sql(const Glib::RefPtr<const Statement>& statement, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::list< Glib::RefPtr<Holder> >& params_used, std::auto_ptr<Glib::Error>& error) const
+Glib::ustring Connection::statement_to_sql(const Glib::RefPtr<const Statement>& statement, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::vector< Glib::RefPtr<Holder> >& params_used, std::auto_ptr<Glib::Error>& error) const
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
@@ -290,15 +290,15 @@ Glib::ustring Connection::statement_to_sql(const Glib::RefPtr<const Statement>&
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
- Glib::SListHandle< Glib::RefPtr<Holder> > params_usedcpp(params_usedc, Glib::OWNERSHIP_SHALLOW);
- for (Glib::SListHandle< Glib::RefPtr<Holder> >::const_iterator i = params_usedcpp.begin();
+ std::vector< Glib::RefPtr<Holder> > params_usedcpp
+ = Glib::SListHandler< Glib::RefPtr<Holder> >::slist_to_vector(params_usedc, Glib::OWNERSHIP_SHALLOW);
+ for(std::vector< Glib::RefPtr<Holder> >::const_iterator i = params_usedcpp.begin();
i != params_usedcpp.end(); i++)
{
params_used.push_back(*i);
}
return retvalue;
-
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
diff --git a/libgda/src/connection.hg b/libgda/src/connection.hg
index cc36b12..76b1469 100644
--- a/libgda/src/connection.hg
+++ b/libgda/src/connection.hg
@@ -139,8 +139,8 @@ public:
//_WRAP_METHOD(Glib::RefPtr<DataModel> statement_execute_select(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params), gda_connection_statement_execute_select, errthrow)
_IGNORE(gda_connection_statement_execute_select) //We instead create a version that can take an optional usage parameter too.
- #m4 _CONVERSION(`const Glib::ArrayHandle<GType>&', `GType*', `const_cast<GType*>(($3).data())')
- _WRAP_METHOD(Glib::RefPtr<DataModel> statement_execute_select(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params, StatementModelUsage model_usage, const Glib::ArrayHandle<GType>& col_types), gda_connection_statement_execute_select_full, errthrow)
+#m4 _CONVERSION(`const std::vector<GType>&', `GType*', `const_cast<GType*>(Glib::ArrayHandler<GType>::vector_to_array($3).data())')
+ _WRAP_METHOD(Glib::RefPtr<DataModel> statement_execute_select(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params, StatementModelUsage model_usage, const std::vector<GType>& col_types), gda_connection_statement_execute_select_full, errthrow)
_IGNORE(gda_connection_statement_execute_select_fullv)
//TODO: Documentation:
@@ -236,11 +236,11 @@ public:
//Use a special conversion here, because we should not own any part of the returned GList,
//according to the documentation for gda_connection_get_events(),
//and because we need to unconst the GList.:
- #m4 _CONVERSION(`const GList*',`Glib::ListHandle< Glib::RefPtr<ConnectionEvent> >',`$2((GList*)$3, Glib::OWNERSHIP_NONE)')
- #m4 _CONVERSION(`const GList*',`Glib::ListHandle< Glib::RefPtr<const ConnectionEvent> >',`$2((GList*)$3, Glib::OWNERSHIP_NONE)')
+ #m4 _CONVERSION(`const GList*',`std::vector< Glib::RefPtr<ConnectionEvent> >',`$2(Glib::ListHandler< Glib::RefPtr<ConnectionEvent> >::list_to_vector(const_cast<GList*>($3), Glib::OWNERSHIP_NONE))')
+ #m4 _CONVERSION(`const GList*',`std::vector< Glib::RefPtr<const ConnectionEvent> >',`$2(Glib::ListHandler< Glib::RefPtr<const ConnectionEvent> >::list_to_vector(const_cast<GList*>($3), Glib::OWNERSHIP_NONE))')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<ConnectionEvent> > get_events(), gda_connection_get_events)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const ConnectionEvent> > get_events() const, gda_connection_get_events)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<ConnectionEvent> > get_events(), gda_connection_get_events)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const ConnectionEvent> > get_events() const, gda_connection_get_events)
_WRAP_METHOD(Glib::ustring value_to_sql_string(const Value& from) const, gda_connection_value_to_sql_string)
@@ -330,8 +330,8 @@ public:
_WRAP_METHOD(bool statement_prepare(const Glib::RefPtr<const Statement>& stmt), gda_connection_statement_prepare, errthrow)
- #m4 _CONVERSION(`const Glib::ListHandle< Glib::RefPtr<Holder> >&',`GList*',`$3.data()')
- _WRAP_METHOD(Glib::RefPtr<DataModel> get_meta_store_data(ConnectionMetaType meta_type, const Glib::ListHandle< Glib::RefPtr<Holder> >& filters), gda_connection_get_meta_store_data_v, errthrow)
+ #m4 _CONVERSION(`const std::vector< Glib::RefPtr<Holder> >&',`GList*',`Glib::ListHandler< Glib::RefPtr<Holder> >::vector_to_list($3).data()')
+ _WRAP_METHOD(Glib::RefPtr<DataModel> get_meta_store_data(ConnectionMetaType meta_type, const std::vector< Glib::RefPtr<Holder> >& filters), gda_connection_get_meta_store_data_v, errthrow)
_IGNORE(gda_connection_get_meta_store_data)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -343,8 +343,9 @@ public:
_WRAP_METHOD(Glib::RefPtr<MetaStore> get_meta_store(), gda_connection_get_meta_store, refreturn)
_WRAP_METHOD(Glib::RefPtr<const MetaStore> get_meta_store() const, gda_connection_get_meta_store, constversion)
- #m4 _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<Glib::Object> >',`$2((GSList*)$3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<Glib::Object> > batch_execute(const Glib::RefPtr<Batch>& batch, const Glib::RefPtr<const Set>& params, StatementModelUsage model_usage), gda_connection_batch_execute, errthrow)
+ #m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Glib::Object> >',`$2(Glib::SListHandler< Glib::RefPtr<Glib::Object > >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW))')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Glib::Object> > batch_execute(const Glib::RefPtr<Batch>& batch, const Glib::RefPtr<const Set>& params, StatementModelUsage model_usage), gda_connection_batch_execute, errthrow)
+
_WRAP_METHOD(Glib::RefPtr<ServerOperation> create_operation(ServerOperationType type, const Glib::RefPtr<const Set>& options), gda_connection_create_operation, errthrow)
_WRAP_METHOD(bool perform_operation(const Glib::RefPtr<ServerOperation>& op), gda_connection_perform_operation, errthrow)
@@ -357,9 +358,9 @@ public:
//TODO: Add an overload without the params_used.
#ifdef GLIBMM_EXCEPTIONS_ENABLED
- Glib::ustring statement_to_sql(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::list< Glib::RefPtr<Holder> >& params_used) const;
+ Glib::ustring statement_to_sql(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::vector< Glib::RefPtr<Holder> >& params_used) const;
#else
- Glib::ustring statement_to_sql(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::list< Glib::RefPtr<Holder> >& params_used, std::auto_ptr<Glib::Error>& error) const;
+ Glib::ustring statement_to_sql(const Glib::RefPtr<const Statement>& stmt, const Glib::RefPtr<const Set>& params, StatementSqlFlag flags, std::vector< Glib::RefPtr<Holder> >& params_used, std::auto_ptr<Glib::Error>& error) const;
#endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gda_connection_internal_reset_transaction_status)
diff --git a/libgda/src/datacomparator.ccg b/libgda/src/datacomparator.ccg
index 723bdbe..a69a6a0 100644
--- a/libgda/src/datacomparator.ccg
+++ b/libgda/src/datacomparator.ccg
@@ -27,6 +27,13 @@ namespace Gnome
namespace Gda
{
+void DataComparator::set_key_for_columns(const std::vector<int>& col_numbers)
+{
+ gda_data_comparator_set_key_columns(gobj(),
+ Glib::ArrayHandler<int>::vector_to_array(col_numbers).data(),
+ col_numbers.size());
+}
+
} /* namespace Gda */
} /* namespace Gnome */
diff --git a/libgda/src/datacomparator.hg b/libgda/src/datacomparator.hg
index 79b1411..05bb049 100644
--- a/libgda/src/datacomparator.hg
+++ b/libgda/src/datacomparator.hg
@@ -67,7 +67,9 @@ public:
_WRAP_CREATE(const Glib::RefPtr<DataModel>& old_model, const Glib::RefPtr<DataModel>& new_model)
//TODO: The nb_cols parmetetr is unnecessary:
- _WRAP_METHOD(void set_key_for_columns(const Glib::ArrayHandle<int>& col_numbers, int nb_cols), gda_data_comparator_set_key_columns)
+ //TODO: Documentation
+ void set_key_for_columns(const std::vector<int>& col_numbers);
+ _IGNORE(gda_data_comparator_set_key_columns)
_WRAP_METHOD(bool compute_diff(), gda_data_comparator_compute_diff, errthrow)
_WRAP_METHOD(int get_n_diffs() const, gda_data_comparator_get_n_diffs)
diff --git a/libgda/src/datamodel.ccg b/libgda/src/datamodel.ccg
index 5d99568..9de8b0e 100644
--- a/libgda/src/datamodel.ccg
+++ b/libgda/src/datamodel.ccg
@@ -35,9 +35,9 @@ namespace Gda
{
#ifdef GLIBMM_EXCEPTIONS_ENABLED
-bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options)
+bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file, const std::vector<int>& cols, const std::vector<int>& rows, const Glib::RefPtr<Set>& options)
#else
-bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options, std::auto_ptr<Glib::Error>& error)
+bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file, const std::vector<int>& cols, const std::vector<int>& rows, const Glib::RefPtr<Set>& options, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
@@ -53,7 +53,7 @@ bool DataModel::export_to_file(DataModelIOFormat format, const std::string& file
return retvalue;
}
-Glib::ustring DataModel::export_to_string(DataModelIOFormat format, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options)
+Glib::ustring DataModel::export_to_string(DataModelIOFormat format, const std::vector<int>& cols, const std::vector<int>& rows, const Glib::RefPtr<Set>& options)
{
gchar* retvalue = gda_data_model_export_to_string(gobj(), static_cast<GdaDataModelIOFormat>(format), cols.data(), cols.size(), rows.data(), rows.size(), options->gobj());
Glib::ustring cppretvalue(retvalue);
diff --git a/libgda/src/datamodel.hg b/libgda/src/datamodel.hg
index a87785a..057180e 100644
--- a/libgda/src/datamodel.hg
+++ b/libgda/src/datamodel.hg
@@ -111,15 +111,14 @@ public:
_WRAP_METHOD(bool set_value_at(int col, int row, const Value& value), gda_data_model_set_value_at, errthrow)
- typedef Glib::ListHandle<Value, ValueTraits> ValueList;
- typedef Glib::SListHandle<Value, ValueTraits> ValueSList;
+ typedef std::vector<Value> ValueVector;
- #m4 _CONVERSION(`const ValueList&',`const GList*',`$3.data()')
- #m4 _CONVERSION(`const ValueList&',`GList*',`$3.data()')
+ #m4 _CONVERSION(`const ValueList&',`GList*',`Glib::ListHandler<Value, ValueTraits>::vector_to_list($3).data()')
_WRAP_METHOD(bool set_values(int row, const ValueList& values), gda_data_model_set_values, errthrow)
_WRAP_METHOD(DataModelAccessFlags get_access_flags() const, gda_data_model_get_access_flags)
+ #m4 _CONVERSION(`const ValueList&',`const GList*',`Glib::ListHandler<Value, ValueTraits>::vector_to_list($3).data()')
_WRAP_METHOD(int append_values(const ValueList& values), gda_data_model_append_values, errthrow)
_WRAP_METHOD(bool append_row(), gda_data_model_append_row, errthrow)
@@ -127,9 +126,9 @@ public:
//TODO: Maybe wrap the two input parameters (list of values, and list of their column indexes) as a map,
//but it's not urgent. murrayc.
- #m4 _CONVERSION(`const Glib::ArrayHandle<int>&', `gint*', `const_cast<gint*>(($3).data())')
- #m4 _CONVERSION(`const ValueSList&', `GSList*', `$3.data()')
- _WRAP_METHOD(int get_row_from_values(const ValueSList& values, const Glib::ArrayHandle<int>& cols_index), gda_data_model_get_row_from_values)
+ #m4 _CONVERSION(`const std::vector<int>&', `gint*', `const_cast<gint*>(Glib::ArrayHandler<int>::vector_to_array($3).data())')
+ #m4 _CONVERSION(`const ValueVector&', `GSList*', `Glib::SListHandler<Value, ValueTraits>::vector_to_slist($3).data()')
+ _WRAP_METHOD(int get_row_from_values(const ValueVector& values, const std::vector<int>& cols_index), gda_data_model_get_row_from_values)
_WRAP_METHOD(void send_hint(DataModelHint hint, const Value& hint_value), gda_data_model_send_hint)
@@ -147,7 +146,7 @@ public:
* @param options List of options for the export.
* @result The string.
*/
- Glib::ustring export_to_string(DataModelIOFormat format, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options);
+ Glib::ustring export_to_string(DataModelIOFormat format, const std::vector<int>& cols, const std::vector<int>& rows, const Glib::RefPtr<Set>& options);
_IGNORE(gda_data_model_export_to_string)
/** Exports data contained in @a model to the @a file; the format is specified using the @a format argument.
@@ -165,9 +164,9 @@ public:
* @result true if no error occurred.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
- bool export_to_file(DataModelIOFormat format, const std::string& file, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options);
+ bool export_to_file(DataModelIOFormat format, const std::string& file, const std::vector<int>& cols, const std::vector<int>& rows, const Glib::RefPtr<Set>& options);
#else
- bool export_to_file(DataModelIOFormat format, const std::string& file, const Glib::ArrayHandle<int>& cols, const Glib::ArrayHandle<int>& rows, const Glib::RefPtr<Set>& options, std::auto_ptr<Glib::Error>& error);
+ bool export_to_file(DataModelIOFormat format, const std::string& file, const std::vector<int>& cols, const std::vector<int>& rows, const Glib::RefPtr<Set>& options, std::auto_ptr<Glib::Error>& error);
#endif
_IGNORE(gda_data_model_export_to_file)
diff --git a/libgda/src/datamodelimport.hg b/libgda/src/datamodelimport.hg
index b6b3fef..7b6d549 100644
--- a/libgda/src/datamodelimport.hg
+++ b/libgda/src/datamodelimport.hg
@@ -78,7 +78,7 @@ public:
_WRAP_CREATE(xmlNodePtr node)
- //TODO: Use ListHandle or similar:
+ //TODO: Use std::vector:
_WRAP_METHOD(GSList* get_errors(), gda_data_model_import_get_errors)
_WRAP_METHOD(void clean_errors(), gda_data_model_import_clean_errors)
diff --git a/libgda/src/dataproxy.ccg b/libgda/src/dataproxy.ccg
index 45c0689..21ac3a2 100644
--- a/libgda/src/dataproxy.ccg
+++ b/libgda/src/dataproxy.ccg
@@ -28,10 +28,10 @@ namespace Gnome
namespace Gda
{
-ValueSList DataProxy::get_values(int proxy_row, const Glib::ArrayHandle<int>& cols_index) const
+DataProxy::ValueVector DataProxy::get_values(int proxy_row, const std::vector<int>& cols_index) const
{
GSList* values = gda_data_proxy_get_values(const_cast<GdaDataProxy*>(gobj()), proxy_row, const_cast<gint*>(cols_index.data()), cols_index.size());
- return ValueSList(values, Glib::OWNERSHIP_SHALLOW);
+ return Glib::SListHandler<Value, ValueTraits>::slist_to_vector(values, Glib::OWNERSHIP_SHALLOW);
}
} /* namespace Gda */
diff --git a/libgda/src/dataproxy.hg b/libgda/src/dataproxy.hg
index 22bd8cf..6adb117 100644
--- a/libgda/src/dataproxy.hg
+++ b/libgda/src/dataproxy.hg
@@ -69,7 +69,7 @@ public:
_WRAP_METHOD(bool is_read_only() const, gda_data_proxy_is_read_only)
_WRAP_METHOD_DOCS_ONLY(gda_data_proxy_get_values)
- ValueSList get_values(int proxy_row, const Glib::ArrayHandle<int>& cols_index) const;
+ ValueVector get_values(int proxy_row, const std::vector<int>& cols_index) const;
_WRAP_METHOD(ValueAttribute get_value_attributes(int proxy_row, int col) const, gda_data_proxy_get_value_attributes)
_WRAP_METHOD(void alter_value_attributes(int proxy_row, int col, ValueAttribute alter_flags), gda_data_proxy_alter_value_attributes)
diff --git a/libgda/src/metastore.hg b/libgda/src/metastore.hg
index fb7e32f..89c11ee 100644
--- a/libgda/src/metastore.hg
+++ b/libgda/src/metastore.hg
@@ -83,8 +83,10 @@ public:
_WRAP_METHOD(Glib::RefPtr<DataModel> create_modify_data_model(const Glib::ustring& table_name), gda_meta_store_create_modify_data_model)
_WRAP_METHOD(void set_identifiers_style(SqlIdentifierStyle style), gda_meta_store_set_identifiers_style)
_WRAP_METHOD(Glib::RefPtr<MetaStruct> schema_get_structure(), gda_meta_store_schema_get_structure, errthrow)
- _WRAP_METHOD(Glib::SListHandle<Glib::ustring> schema_get_all_tables(), gda_meta_store_schema_get_all_tables)
- _WRAP_METHOD(Glib::SListHandle<Glib::ustring> schema_get_depend_tables(const Glib::ustring& table_name), gda_meta_store_schema_get_depend_tables)
+
+#m4 _CONVERSION(`GSList*',`std::vector<Glib::ustring>', `Glib::SListHandler<Glib::ustring>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::ustring> schema_get_all_tables(), gda_meta_store_schema_get_all_tables)
+ _WRAP_METHOD(std::vector<Glib::ustring> schema_get_depend_tables(const Glib::ustring& table_name), gda_meta_store_schema_get_depend_tables)
_WRAP_METHOD_DOCS_ONLY(gda_meta_store_get_attribute_value)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -111,7 +113,7 @@ public:
//#m4 _CONVERSION(`gpointer',`MetaContext*',`(MetaContext*)($3)')
//_WRAP_SIGNAL(gpointer suggest_update(MetaContext* suggest), "suggest-update", no_default_handler)
// Listhandle...
- // _WRAP_SIGNAL(void meta_changed(Glib::SListHandle<>))
+ // _WRAP_SIGNAL(void meta_changed(std::vector<>))
};
} // namespace Gda
diff --git a/libgda/src/serveroperation.hg b/libgda/src/serveroperation.hg
index a5d04e8..8a635ec 100644
--- a/libgda/src/serveroperation.hg
+++ b/libgda/src/serveroperation.hg
@@ -108,7 +108,10 @@ public:
_WRAP_METHOD(guint get_sequence_size(const Glib::ustring& path) const, gda_server_operation_get_sequence_size)
_WRAP_METHOD(guint get_sequence_max_size(const Glib::ustring& path) const, gda_server_operation_get_sequence_max_size)
_WRAP_METHOD(guint get_sequence_min_size(const Glib::ustring& path) const, gda_server_operation_get_sequence_min_size)
- _WRAP_METHOD(Glib::StringArrayHandle get_sequence_item_names(const Glib::ustring& path) const, gda_server_operation_get_sequence_item_names)
+
+#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>', `Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_sequence_item_names(const Glib::ustring& path) const, gda_server_operation_get_sequence_item_names)
+
_WRAP_METHOD(Glib::ustring get_sequence_name(const std::string& path) const, gda_server_operation_get_sequence_name)
//TODO: Is this XML stuff really public API? murrayc.
@@ -123,7 +126,7 @@ public:
_WRAP_METHOD(bool del_item_from_sequence(const std::string& item_path), gda_server_operation_del_item_from_sequence)
_WRAP_METHOD(guint add_item_to_sequence(const std::string& item_path), gda_server_operation_add_item_to_sequence)
- _WRAP_METHOD(Glib::StringArrayHandle get_root_nodes() const, gda_server_operation_get_root_nodes)
+ _WRAP_METHOD(std::vector<Glib::ustring> get_root_nodes() const, gda_server_operation_get_root_nodes)
_WRAP_SIGNAL(void signal_sequence_item_added(Glib::ustring arg1, int arg2), "sequence-item-added", no_default_handler)
_WRAP_SIGNAL(void signal_sequence_item_remove(Glib::ustring arg1, int arg2), "sequence-item-remove", no_default_handler)
diff --git a/libgda/src/set.hg b/libgda/src/set.hg
index 9ac235a..923c968 100644
--- a/libgda/src/set.hg
+++ b/libgda/src/set.hg
@@ -47,13 +47,13 @@ class Set : public Glib::Object
{
_CLASS_GOBJECT(Set, GdaSet, GDA_SET, Glib::Object, GObject)
protected:
- typedef Glib::SListHandle< Glib::RefPtr<Holder> > HolderSList;
+ typedef std::vector< Glib::RefPtr<Holder> > HolderVector;
- #m4 _CONVERSION(`const HolderSList&', `GSList*', `$3.data()')
- _WRAP_CTOR(Set(const HolderSList& holders), gda_set_new)
+ #m4 _CONVERSION(`const HolderVector&', `GSList*', `Glib::SListHandler< Glib::RefPtr<Holder> >::vector_to_slist($3).data()')
+ _WRAP_CTOR(Set(const HolderVector& holders), gda_set_new)
public:
- _WRAP_CREATE(const HolderSList& holders = std::list< Glib::RefPtr<Holder> >())
+ _WRAP_CREATE(const HolderVector& holders = HolderVector())
_WRAP_METHOD(Glib::RefPtr<Set> copy(), gda_set_copy)
diff --git a/libgda/src/sqlbuilder.ccg b/libgda/src/sqlbuilder.ccg
index 3a6110c..02e26b2 100644
--- a/libgda/src/sqlbuilder.ccg
+++ b/libgda/src/sqlbuilder.ccg
@@ -74,12 +74,12 @@ SqlBuilder::Id SqlBuilder::add_cond(SqlOperatorType op, Id op1, Id op2, Id op3)
return gda_sql_builder_add_cond(gobj(), (GdaSqlOperatorType) op, op1, op2, op3);
}
-SqlBuilder::Id SqlBuilder::add_cond(SqlOperatorType op, const Glib::ArrayHandle<Id>& op_ids)
+SqlBuilder::Id SqlBuilder::add_cond(SqlOperatorType op, const std::vector<Id>& op_ids)
{
return gda_sql_builder_add_cond_v(gobj(), (GdaSqlOperatorType) op, op_ids.data(), op_ids.size());
}
-SqlBuilder::Id SqlBuilder::add_function(const Glib::ustring& function_name, const Glib::ArrayHandle<Id>& args)
+SqlBuilder::Id SqlBuilder::add_function(const Glib::ustring& function_name, const std::vector<Id>& args)
{
return gda_sql_builder_add_function_v(gobj(), function_name.c_str(), args.data(), args.size());
}
diff --git a/libgda/src/sqlbuilder.hg b/libgda/src/sqlbuilder.hg
index e6d2847..4ab051d 100644
--- a/libgda/src/sqlbuilder.hg
+++ b/libgda/src/sqlbuilder.hg
@@ -163,7 +163,7 @@ public:
*
* @return The ID of the new expression, or 0 if there was an error.
*/
- Id add_cond(SqlOperatorType op, const Glib::ArrayHandle<Id>& op_ids);
+ Id add_cond(SqlOperatorType op, const std::vector<Id>& op_ids);
_IGNORE(gda_sql_builder_add_function, gda_sql_builder_add_function_v)
_IGNORE(gda_sql_builder_select_join_targets)
@@ -175,7 +175,7 @@ public:
*
* @return The ID of the new target, or 0 if there was an error.
*/
- Id add_function(const Glib::ustring& function_name, const Glib::ArrayHandle<Id>& args);
+ Id add_function(const Glib::ustring& function_name, const std::vector<Id>& args);
/** Builds a new expression which represents a function applied to an argument.
*
diff --git a/libgda/src/statement.ccg b/libgda/src/statement.ccg
index 223e694..99a72bd 100644
--- a/libgda/src/statement.ccg
+++ b/libgda/src/statement.ccg
@@ -101,10 +101,10 @@ Glib::ustring Statement::to_sql(const Glib::RefPtr<const Set>& params, std::auto
#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring Statement::to_sql(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<const Set>& params,
- StatementSqlFlag flags, const HolderSList&) const
+ StatementSqlFlag flags, const HolderVector&) const
#else
Glib::ustring Statement::to_sql(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<const Set>& params,
- StatementSqlFlag flags, const HolderSList&,
+ StatementSqlFlag flags, const HolderVector&,
std::auto_ptr<Glib::Error>& error) const
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
diff --git a/libgda/src/statement.hg b/libgda/src/statement.hg
index b3af345..ba71a47 100644
--- a/libgda/src/statement.hg
+++ b/libgda/src/statement.hg
@@ -97,16 +97,16 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
_IGNORE(gda_statement_to_sql, gda_statement_to_sql_real)
- typedef Glib::ListHandle< const Glib::RefPtr<Holder> > HolderSList;
+ typedef std::vector< const Glib::RefPtr<Holder> > HolderVector;
//TODO: Add an overload without the params?
_WRAP_METHOD_DOCS_ONLY(gda_statement_to_sql_extended)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring to_sql(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<const Set>& params,
- StatementSqlFlag flags, const HolderSList& params_used) const;
+ StatementSqlFlag flags, const HolderVector& params_used) const;
#else
Glib::ustring to_sql(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<const Set>& params,
- StatementSqlFlag flags, const HolderSList& params_used,
+ StatementSqlFlag flags, const HolderVector& params_used,
std::auto_ptr<Glib::Error>& error) const;
#endif //GLIBMM_EXCEPTIONS_ENABLED
diff --git a/libgda/src/xatransaction.ccg b/libgda/src/xatransaction.ccg
index 54a0774..7ca32e5 100644
--- a/libgda/src/xatransaction.ccg
+++ b/libgda/src/xatransaction.ccg
@@ -27,17 +27,17 @@ namespace Gnome
namespace Gda
{
-typedef Glib::SListHandle< Glib::RefPtr<Connection> > ConnectionSList;
+typedef std::vector< Glib::RefPtr<Connection> > ConnectionVector;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
-bool XaTransaction::commit(ConnectionList& cncs_to_recover)
+bool XaTransaction::commit(ConnectionVector& cncs_to_recover)
#else
-bool XaTransaction::commit(ConnectionList& cncs_to_recover, std::auto_ptr<Glib::Error>& error)
+bool XaTransaction::commit(ConnectionVector& cncs_to_recover, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
GSList* cncs = NULL;
- bool retvalue = gda_xa_transaction_commit (gobj(), &cncs, &gerror);
+ const bool retvalue = gda_xa_transaction_commit (gobj(), &cncs, &gerror);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
@@ -46,20 +46,15 @@ bool XaTransaction::commit(ConnectionList& cncs_to_recover, std::auto_ptr<Glib::
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
- ConnectionSList cncs_cpp(cncs, Glib::OWNERSHIP_SHALLOW);
- for (ConnectionSList::const_iterator i = cncs_cpp.begin();
- i != cncs_cpp.end(); i++)
- {
- cncs_to_recover.push_back(*i);
- }
+ cncs_to_recover = Glib::SListHandler< Glib::RefPtr<const Connection> >::slist_to_vector(cncs, Glib::OWNERSHIP_SHALLOW);
return retvalue;
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
-bool XaTransaction::commit_recovered(ConnectionList& cncs_to_recover)
+bool XaTransaction::commit_recovered(ConnectionVector& cncs_to_recover)
#else
-bool XaTransaction::commit_recovered(ConnectionList& cncs_to_recover, std::auto_ptr<Glib::Error>& error)
+bool XaTransaction::commit_recovered(ConnectionVector& cncs_to_recover, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
@@ -73,12 +68,7 @@ bool XaTransaction::commit_recovered(ConnectionList& cncs_to_recover, std::auto_
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
- ConnectionSList cncs_cpp(cncs, Glib::OWNERSHIP_SHALLOW);
- for (ConnectionSList::const_iterator i = cncs_cpp.begin();
- i != cncs_cpp.end(); i++)
- {
- cncs_to_recover.push_back(*i);
- }
+ cncs_to_recover = Glib::SListHandler< Glib::RefPtr<const Connection> >::slist_to_vector(cncs, Glib::OWNERSHIP_SHALLOW);
return retvalue;
}
diff --git a/libgda/src/xatransaction.hg b/libgda/src/xatransaction.hg
index 0a99263..5cb5c56 100644
--- a/libgda/src/xatransaction.hg
+++ b/libgda/src/xatransaction.hg
@@ -49,20 +49,20 @@ public:
_WRAP_METHOD(bool begin(), gda_xa_transaction_begin, errthrow)
_WRAP_METHOD(bool rollback(), gda_xa_transaction_rollback, errthrow)
- typedef std::list<Glib::RefPtr<const Connection> > ConnectionList;
+ typedef std::vector<Glib::RefPtr<const Connection> > ConnectionVector;
_WRAP_METHOD_DOCS_ONLY(gda_xa_transaction_commit)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
- bool commit(ConnectionList& cnc_to_recover);
+ bool commit(ConnectionVector& cnc_to_recover);
#else
- bool commit(ConnectionList& cnc_to_recover, std::auto_ptr<Glib::Error>& error);
+ bool commit(ConnectionVector& cnc_to_recover, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD_DOCS_ONLY (gda_xa_transaction_commit_recovered)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
- bool commit_recovered(ConnectionList& cnc_to_recover);
+ bool commit_recovered(ConnectionVector& cnc_to_recover);
#else
- bool commit_recovered(ConnectionList& cnc_to_recover, std::auto_ptr<Glib::Error>& error);
+ bool commit_recovered(ConnectionVector& cnc_to_recover, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_PROPERTY("transaction-id", Glib::ustring)
diff --git a/tools/m4/convert_libgdamm.m4 b/tools/m4/convert_libgdamm.m4
index 603d272..2f6e91e 100644
--- a/tools/m4/convert_libgdamm.m4
+++ b/tools/m4/convert_libgdamm.m4
@@ -138,14 +138,6 @@ _CONVERSION(`GdaBlob*',`Blob', Glib::wrap($3))
_CONVERSION(`QuarkList&',`GdaQuarkList*',($3).gobj())
_CONVERSION(`GdaQuarkList*',`QuarkList', Glib::wrap($3))
-# Lists
-_CONVERSION(`GSList*',`Glib::SListHandle<Glib::ustring>',__FL2H_SHALLOW)
-_CONVERSION(`const Glib::ListHandle< Glib::RefPtr<ConnectionEvent> >&',`GList*',`$3.data()')
-
-# Arrays
-_CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3)')
-_CONVERSION(`const Glib::ArrayHandle<int>&',`const gint*', `$3.data()')
-
# Value
_CONVERSION(`const Value&', `GValue*', `const_cast<GValue*>(($3).gobj())')
_CONVERSION(`const Value&', `const GValue*', `($3).gobj()')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]