List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:December 11 2007 5:11pm
Subject:Rev 358: Fixed exceptions in csharp build in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 358
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2007-12-11 15:11:11 -0200
message:
  Fixed exceptions in csharp build
added:
  csharp/MgmExceptions.cs        mgmexceptions.cs-20071210124313-0b931d6ya49of70g-1
renamed:
  csharp/exceptions.cs => csharp/NdbExceptions.cs
exceptions.cs-20070503031240-jegjod5xercecu78-1
modified:
  csharp/Makefile.am             makefile.in-20070228073157-gkwqutuh9f3nq7s2-1
  csharp/mgmapi.i                mgmapi.i-20071125232130-9b1hlszp987p1mhb-1
=== added file 'csharp/MgmExceptions.cs'
--- a/csharp/MgmExceptions.cs	1970-01-01 00:00:00 +0000
+++ b/csharp/MgmExceptions.cs	2007-12-11 17:11:11 +0000
@@ -0,0 +1,90 @@
+
+namespace MySql.Cluster.MgmApi {
+
+using System; 
+
+  public class NdbApiException : System.ApplicationException {
+    public NdbApiException(string message) 
+      : base(message) {
+    }
+  }
+
+  public class BlobUndefinedException : NdbApiException { 
+    public BlobUndefinedException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbApiPermanentException : NdbApiException { 
+    public NdbApiPermanentException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbApiRuntimeException : NdbApiException { 
+    public NdbApiRuntimeException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbApiTemporaryException : NdbApiException { 
+    public NdbApiTemporaryException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbApiTimeStampOutOfBoundsException : NdbApiException { 
+    public NdbApiTimeStampOutOfBoundsException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbApiUserErrorPermanentException : NdbApiPermanentException { 
+    public NdbApiUserErrorPermanentException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbClusterConnectionPermanentException : NdbApiPermanentException { 
+    public NdbClusterConnectionPermanentException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NdbClusterConnectionTemporaryException : NdbApiTemporaryException { 
+    public NdbClusterConnectionTemporaryException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NoSuchColumnException : NdbApiException { 
+    public NoSuchColumnException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NoSuchIndexException : NdbApiException { 
+    public NoSuchIndexException(string message)
+      : base(message) {
+    }
+  }
+
+
+  public class NoSuchTableException : NdbApiException { 
+    public NoSuchTableException(string message)
+      : base(message) {
+    }
+  }
+
+
+
+}

=== renamed file 'csharp/exceptions.cs' => 'csharp/NdbExceptions.cs'
=== modified file 'csharp/Makefile.am'
--- a/csharp/Makefile.am	2007-11-26 03:09:58 +0000
+++ b/csharp/Makefile.am	2007-12-11 17:11:11 +0000
@@ -6,13 +6,13 @@
 nodist_libndbsharp_la_SOURCES = ndbapi.cpp
 libndbsharp_la_LDFLAGS = -fpic
 libndbsharp_la_CPPFLAGS = $(PTHREAD_CFLAGS)
-#libndbsharp_la_DEPENDENCIES = MySql.Cluster.NdbApi.dll 
+libndbsharp_la_DEPENDENCIES = MySql.Cluster.NdbApi.dll 
 nodist_libmgmsharp_la_SOURCES = mgmapi.cpp
 libmgmsharp_la_LDFLAGS = -fpic
 libmgmsharp_la_CPPFLAGS = $(PTHREAD_CFLAGS)
-#libmgmsharp_la_DEPENDENCIES = MySql.Cluster.MgmApi.dll 
+libmgmsharp_la_DEPENDENCIES = MySql.Cluster.MgmApi.dll 
 
-EXTRA_DIST = ndbapi.i mgmapi.i exceptions.cs NdbError.cs test*cs
+EXTRA_DIST = ndbapi.i mgmapi.i NdbExceptions.cs MgmExceptions.cs NdbError.cs test*cs
 
 clean-local:
 	@rm -rf ndbapi mgmapi
@@ -25,9 +25,9 @@
 	$(MCS)  -r:MySql.Cluster.NdbApi.dll -r:$(MYSQL_DLL) $<
 
 MySql.Cluster.MgmApi.dll: 
-	$(MCS) -target:library -out:$@ mgmapi/*.cs exceptions.cs
+	$(MCS) -target:library -out:$@ mgmapi/*.cs MgmExceptions.cs
 MySql.Cluster.NdbApi.dll: 
-	$(MCS) -target:library -out:$@ ndbapi/*.cs exceptions.cs
+	$(MCS) -target:library -out:$@ ndbapi/*.cs NdbExceptions.cs
 
 #$(CSHARP_SOURCES)
 #.PRECIOUS: %.cpp %.so %.dll
@@ -37,7 +37,11 @@
 
 mgmapi.cpp: ${SWIG_MGM_SOURCES}
 
-.i.cpp: ${SWIG_SOURCES}
+mgmapi.cpp: mgmapi.i ${SWIG_SOURCES}
+	@mkdir -p $*
+	${SWIG} -csharp -dllimport libmgmsharp -namespace MySql.Cluster.MgmApi \
+		-I$(top_srcdir) -I$(SWIG_DIR) $(MYSQL_INCLUDES) -outdir $* -o $@ $<
+ndbapi.cpp: ndbapi.i ${SWIG_SOURCES}
 	@mkdir -p $*
 	${SWIG} -csharp -dllimport libndbsharp -namespace MySql.Cluster.NdbApi \
 		-I$(top_srcdir) -I$(SWIG_DIR) $(MYSQL_INCLUDES) -outdir $* -o $@ $<

=== modified file 'csharp/mgmapi.i'
--- a/csharp/mgmapi.i	2007-11-26 03:09:58 +0000
+++ b/csharp/mgmapi.i	2007-12-11 17:11:11 +0000
@@ -20,6 +20,7 @@
 
 %include "enumtypesafe.swg"
 
+%include "typemaps.swg"
 
 %include "mgmapi/mgmglobals.i"
 
@@ -43,6 +44,23 @@
 
 %}
 
+enum NdbException {
+    BaseRuntimeError,
+    NdbApiException,
+    BlobUndefinedException,
+    NdbApiPermanentException,
+    NdbApiRuntimeException,
+    NdbApiTemporaryException,
+    NdbApiTimeStampOutOfBoundsException,
+    NdbApiUserErrorPermanentException,
+    NdbClusterConnectionPermanentException,
+    NdbClusterConnectionTemporaryException,
+    NoSuchColumnException,
+    NoSuchIndexException,
+    NoSuchTableException,
+    MgmApiException,
+};
+
 %insert(runtime) %{
   // Code to handle throwing of C# CustomApplicationException from C/C++ code.
   // The equivalent delegate to the callback, CSharpExceptionCallback_t, is
CustomExceptionDelegate

Thread
Rev 358: Fixed exceptions in csharp build in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/develMonty Taylor11 Dec