gnomemm r1552 - in libgdamm/branches/libgdamm-4-0: libgda libgda/src tools/m4



Author: jhs
Date: Thu Jun  5 15:06:34 2008
New Revision: 1552
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1552&view=rev

Log:
2008-06-05  Johannes Schmid  <johannes schmid openismus com>

	* libgda/Makefile.am:
	* libgda/src/connection.ccg:
	* libgda/src/connection.hg:
	* libgda/src/serveroperation.hg:
	* libgda/src/serverprovider.hg:
	* tools/m4/convert_libgdamm.m4:
	
	Wrapped some missing methods

Modified:
   libgdamm/branches/libgdamm-4-0/libgda/Makefile.am
   libgdamm/branches/libgdamm-4-0/libgda/src/connection.ccg
   libgdamm/branches/libgdamm-4-0/libgda/src/connection.hg
   libgdamm/branches/libgdamm-4-0/libgda/src/serveroperation.hg
   libgdamm/branches/libgdamm-4-0/libgda/src/serverprovider.hg
   libgdamm/branches/libgdamm-4-0/tools/m4/convert_libgdamm.m4

Modified: libgdamm/branches/libgdamm-4-0/libgda/Makefile.am
==============================================================================
--- libgdamm/branches/libgdamm-4-0/libgda/Makefile.am	(original)
+++ libgdamm/branches/libgdamm-4-0/libgda/Makefile.am	Thu Jun  5 15:06:34 2008
@@ -2,14 +2,14 @@
 
 EXTRA_DIST	= README					\
 		  libgdammconfig.h.in libgdamm.h	\
-		  libgdamm-3.0.pc.in
+		  libgdamm-4.0.pc.in
 
-libgdamm_includedir		= $(includedir)/libgdamm-3.0
+libgdamm_includedir		= $(includedir)/libgdamm-4.0
 libgdamm_include_HEADERS	= libgdamm.h
 
-libgdamm_configdir		= $(libdir)/libgdamm-3.0/include
+libgdamm_configdir		= $(libdir)/libgdamm-4.0/include
 libgdamm_config_DATA	= libgdammconfig.h
 
 pkgconfigdir		= $(libdir)/pkgconfig
-pkgconfig_DATA		= libgdamm-3.0.pc
+pkgconfig_DATA		= libgdamm-4.0.pc
 

Modified: libgdamm/branches/libgdamm-4-0/libgda/src/connection.ccg
==============================================================================
--- libgdamm/branches/libgdamm-4-0/libgda/src/connection.ccg	(original)
+++ libgdamm/branches/libgdamm-4-0/libgda/src/connection.ccg	Thu Jun  5 15:06:34 2008
@@ -21,6 +21,7 @@
  */
 
 #include <libgdamm/serverprovider.h>
+#include <libgdamm/metastore.h>
 #include <libgda/gda-enum-types.h>
 #include <libgda/gda-connection.h>
 #include <libgda/libgda.h> //For GDA_GENERAL_ERROR
@@ -49,6 +50,54 @@
   gda_connection_close(gobj());
 }
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Glib::Object> Connection::statement_execute(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage, Glib::RefPtr<Set>& last_inserted_row)
+#else
+Glib::RefPtr<Glib::Object> Connection::statement_execute(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage, Glib::RefPtr<Set>& last_inserted_row, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GdaSet* lir = 0;
+  Glib::RefPtr<Glib::Object> retval = Glib::wrap(
+    gda_connection_statement_execute(gobj(), cmd->gobj(), params->gobj(), (GdaStatementModelUsage)model_usage, &lir, &gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (lir)
+  {
+    last_inserted_row = Glib::wrap(lir);
+  }
+  return retval;
+}
+
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+int Connection::statement_execute_non_select(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, Glib::RefPtr<Set>& last_inserted_row)
+#else
+int Connection::statement_execute_non_select(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, Glib::RefPtr<Set>& last_inserted_row, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GdaSet* lir = 0;
+  int retval = gda_connection_statement_execute_non_select(gobj(), cmd->gobj(), params->gobj(), &lir, &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (lir)
+  {
+    last_inserted_row = Glib::wrap(lir);
+  }
+  return retval;
+}
+
 } //namespace Gda
 
 } //namespace Gnome

Modified: libgdamm/branches/libgdamm-4-0/libgda/src/connection.hg
==============================================================================
--- libgdamm/branches/libgdamm-4-0/libgda/src/connection.hg	(original)
+++ libgdamm/branches/libgdamm-4-0/libgda/src/connection.hg	Thu Jun  5 15:06:34 2008
@@ -25,6 +25,7 @@
 #include <libgdamm/datamodel.h>
 #include <libgdamm/statement.h>
 #include <libgdamm/sqlparser.h>
+#include <libgdamm/serveroperation.h>
 
 #include <libgda/gda-meta-store.h>
 
@@ -38,6 +39,7 @@
 {
 
 class ServerProvider;
+class MetaStore;
 typedef GdaServerProviderInfo ServerProviderInfo;
 
 /** Exception class for Gda connection errors.
@@ -82,7 +84,8 @@
           gda_connection_internal_savepoint_rolledback, gda_connection_execute_command,
           gda_connection_internal_sql_executed, gda_connection_internal_change_transaction_state,
           gda_connection_internal_statement_executed, gda_connection_internal_get_provider_data,
-          gda_connection_internal_set_provider_data)
+          gda_connection_internal_set_provider_data, gda_connection_add_prepared_statement,
+          gda_connection_del_prepared_statement, gda_connection_get_prepared_statement)
 
   _WRAP_METHOD(bool is_opened() const, gda_connection_is_opened)
 
@@ -93,7 +96,7 @@
   _WRAP_METHOD(Glib::ustring get_cnc_string() const, gda_connection_get_cnc_string)
 
   _WRAP_METHOD(void add_event(const Glib::RefPtr<ConnectionEvent>& event), gda_connection_add_event)
-  _WRAP_METHOD( Glib::RefPtr<ConnectionEvent> add_event_string(const Glib::ustring& str), gda_connection_add_event_string)
+  _WRAP_METHOD(Glib::RefPtr<ConnectionEvent> add_event_string(const Glib::ustring& str), gda_connection_add_event_string)
 
   //TODO: Use ListHandle, and watch out because the C function frees the input list parameter.
   //However, this is not high-priority because this is apparently just a convenience function.
@@ -106,16 +109,26 @@
   #m4 //Use deep ownership because we own both the list and its elements;
   #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<DataModel> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
 
-  //_WRAP_METHOD(Glib::RefPtr<DataModel> statement_execute(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage, Glib::RefPtr<Set>& last_inserted_row), gda_connection_statement_execute, errthrow)
+  _WRAP_METHOD_DOCS_ONLY(gda_connection_statement_execute)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  Glib::RefPtr<Glib::Object> statement_execute(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage, Glib::RefPtr<Set>& last_inserted_row);
+#else
+  Glib::RefPtr<Glib::Object> statement_execute(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage, Glib::RefPtr<Set>& last_inserted_row, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
   _WRAP_METHOD(Glib::RefPtr<DataModel> statement_execute_select(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params), gda_connection_statement_execute_select, errthrow)
   
   #m4 _CONVERSION(`const Glib::ArrayHandle<GType>&', `GType*', `const_cast<GType*>(($3).data())')
   _WRAP_METHOD(Glib::RefPtr<DataModel> statement_execute_select_full(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage, const Glib::ArrayHandle<GType>& col_types), gda_connection_statement_execute_select_full, errthrow)
   _IGNORE (gda_connection_statement_execute_select_fullv)
   
-  // TODO:
-  //_WRAP_METHOD(int statement_execute_non_select(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, Glib::RefPtr<Set>& last_inserted_row), gda_connection_statement_execute_non_select, errthrow)
-  
+  _WRAP_METHOD_DOCS_ONLY (gda_connection_statement_execute_non_select);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  int statement_execute_non_select(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, Glib::RefPtr<Set>& last_inserted_row);
+#else
+  int statement_execute_non_select(const Glib::RefPtr<Statement>& cmd, const Glib::RefPtr<Set>& params, Glib::RefPtr<Set>& last_inserted_row, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED  
+
   //Note that we do not add a non-const version of this because the documentation says that it should not be modified:
   _WRAP_METHOD(Glib::RefPtr<const TransactionStatus> get_transaction_status() const, gda_connection_get_transaction_status, errthrow, refreturn)
 
@@ -153,6 +166,11 @@
 
   // TODO: The variable argument list must be wrapped...
   //_WRAP_METHOD(Glib::RefPtr<DataModel> get_meta_store_data (...), gda_connection_get_meta_store_data)
+  _WRAP_METHOD(Glib::RefPtr<MetaStore> get_meta_store(), gda_connection_get_meta_store);
+
+  _WRAP_METHOD(Glib::RefPtr<Glib::Object> batch_execute(const Glib::RefPtr<Batch>& batch, const Glib::RefPtr<Set>& params, StatementModelUsage model_usage), gda_connection_batch_execute, errthrow)
+  _WRAP_METHOD(Glib::RefPtr<ServerOperation> create_operation (ServerOperationType type, const Glib::RefPtr<Set>& options), gda_connection_create_operation, errthrow)
+  _WRAP_METHOD(bool perform_operation (const Glib::RefPtr<ServerOperation>& op), gda_connection_perform_operation, errthrow)
 
 _CONVERSION(`GdaConnectionEvent*',`const Glib::RefPtr<ConnectionEvent>&',Glib::wrap($3, true))
   _WRAP_SIGNAL(void error(const Glib::RefPtr<ConnectionEvent>& error), "error")

Modified: libgdamm/branches/libgdamm-4-0/libgda/src/serveroperation.hg
==============================================================================
--- libgdamm/branches/libgdamm-4-0/libgda/src/serveroperation.hg	(original)
+++ libgdamm/branches/libgdamm-4-0/libgda/src/serveroperation.hg	Thu Jun  5 15:06:34 2008
@@ -37,6 +37,7 @@
 //_WRAP_ENUM(ClientSpecsType, GdaClientSpecsType)
 _WRAP_ENUM(ServerOperationNodeType, GdaServerOperationNodeType)
 _WRAP_ENUM(ServerOperationNodeStatus, GdaServerOperationNodeStatus)
+_WRAP_ENUM(ServerOperationType, GdaServerOperationType)
 
 /** @defgroup DDL Data definition (DDL) queries
  */

Modified: libgdamm/branches/libgdamm-4-0/libgda/src/serverprovider.hg
==============================================================================
--- libgdamm/branches/libgdamm-4-0/libgda/src/serverprovider.hg	(original)
+++ libgdamm/branches/libgdamm-4-0/libgda/src/serverprovider.hg	Thu Jun  5 15:06:34 2008
@@ -37,9 +37,6 @@
 
 class Connection;
 
-//_WRAP_ENUM(ClientSpecsType, GdaClientSpecsType)
-_WRAP_ENUM(ServerOperationType, GdaServerOperationType)
-
 /* TODO: Is this appropriate. Investigate how it is used. */
 typedef GdaServerProviderInfo ServerProviderInfo;
 

Modified: libgdamm/branches/libgdamm-4-0/tools/m4/convert_libgdamm.m4
==============================================================================
--- libgdamm/branches/libgdamm-4-0/tools/m4/convert_libgdamm.m4	(original)
+++ libgdamm/branches/libgdamm-4-0/tools/m4/convert_libgdamm.m4	Thu Jun  5 15:06:34 2008
@@ -22,6 +22,7 @@
 _CONVERSION(`GdaSqlParser*',`Glib::RefPtr<SqlParser>',`Glib::wrap($3)')
 _CONVERSION(`GdaBatch*',`Glib::RefPtr<Batch>',`Glib::wrap($3)')
 _CONVERSION(`GdaMetaStruct*',`Glib::RefPtr<MetaStruct>',`Glib::wrap($3)')
+_CONVERSION(`GdaMetaStore*',`Glib::RefPtr<MetaStore>',`Glib::wrap($3)')
 _CONVERSION(`GdaConfig*',`Glib::RefPtr<Config>',`Glib::wrap($3)')
 
 _CONVERSION(`const Glib::RefPtr<DataModel>&', `GdaDataModel*', __CONVERT_REFPTR_TO_P)
@@ -100,8 +101,6 @@
 _CONV_ENUM(Gda,MetaStructFeature)
 
 # Lists
-_CONVERSION(`const Glib::ListHandle<Value>&',`GList*',`$3.data()')
-_CONVERSION(`GList*',`const Glib::ListHandle<Value>',__FL2H_SHALLOW)
 _CONVERSION(`GSList*',`Glib::SListHandle<Parameter>',__FL2H_SHALLOW)
 _CONVERSION(`const Glib::SListHandle<Parameter>&',`GSList*',`$3.data()')
 _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<QueryField> >',__FL2H_SHALLOW)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]