summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/exceptions/TestAMDI.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-12-06 16:36:08 +0000
committerMarc Laukien <marc@zeroc.com>2002-12-06 16:36:08 +0000
commitfda53102d9aa6ef19694e1b8c0b001cd3aae529e (patch)
tree149a69163e0d631e826ab5b3cb49e32fe9e39d24 /cpp/test/Ice/exceptions/TestAMDI.cpp
parentInitial addition (diff)
downloadice-fda53102d9aa6ef19694e1b8c0b001cd3aae529e.tar.bz2
ice-fda53102d9aa6ef19694e1b8c0b001cd3aae529e.tar.xz
ice-fda53102d9aa6ef19694e1b8c0b001cd3aae529e.zip
amd merge
Diffstat (limited to 'cpp/test/Ice/exceptions/TestAMDI.cpp')
-rw-r--r--cpp/test/Ice/exceptions/TestAMDI.cpp167
1 files changed, 167 insertions, 0 deletions
diff --git a/cpp/test/Ice/exceptions/TestAMDI.cpp b/cpp/test/Ice/exceptions/TestAMDI.cpp
new file mode 100644
index 00000000000..75cca588a7c
--- /dev/null
+++ b/cpp/test/Ice/exceptions/TestAMDI.cpp
@@ -0,0 +1,167 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestAMDI.h>
+
+ThrowerI::ThrowerI(const Ice::ObjectAdapterPtr& adapter) :
+ _adapter(adapter)
+{
+}
+
+void
+ThrowerI::shutdown_async(const AMD_Thrower_shutdownPtr& cb,
+ const Ice::Current&)
+{
+ _adapter->getCommunicator()->shutdown();
+ cb->ice_response();
+}
+
+void
+ThrowerI::supportsUndeclaredExceptions_async(const AMD_Thrower_supportsUndeclaredExceptionsPtr& cb,
+ const Ice::Current&)
+{
+ cb->ice_response(true);
+}
+
+void
+ThrowerI::supportsNonIceExceptions_async(const AMD_Thrower_supportsNonIceExceptionsPtr& cb,
+ const Ice::Current&)
+{
+ cb->ice_response(false);
+}
+
+void
+ThrowerI::throwAasA_async(const AMD_Thrower_throwAasAPtr& cb,
+ Ice::Int a, const Ice::Current&)
+{
+ A ex;
+ ex.aMem = a;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwAorDasAorD_async(const AMD_Thrower_throwAorDasAorDPtr& cb,
+ Ice::Int a, const Ice::Current&)
+{
+ if(a > 0)
+ {
+ A ex;
+ ex.aMem = a;
+ cb->ice_exception(ex);
+ }
+ else
+ {
+ D ex;
+ ex.dMem = a;
+ cb->ice_exception(ex);
+ }
+}
+
+void
+ThrowerI::throwBasA_async(const AMD_Thrower_throwBasAPtr& cb,
+ Ice::Int a, Ice::Int b, const Ice::Current& current)
+{
+ B ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwCasA_async(const AMD_Thrower_throwCasAPtr& cb,
+ Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current& current)
+{
+ C ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ ex.cMem = c;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwBasB_async(const AMD_Thrower_throwBasBPtr& cb,
+ Ice::Int a, Ice::Int b, const Ice::Current&)
+{
+ B ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwCasB_async(const AMD_Thrower_throwCasBPtr& cb,
+ Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current& current)
+{
+ C ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ ex.cMem = c;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwCasC_async(const AMD_Thrower_throwCasCPtr& cb,
+ Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current&)
+{
+ C ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ ex.cMem = c;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwUndeclaredA_async(const AMD_Thrower_throwUndeclaredAPtr& cb,
+ Ice::Int a, const Ice::Current&)
+{
+ A ex;
+ ex.aMem = a;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwUndeclaredB_async(const AMD_Thrower_throwUndeclaredBPtr& cb,
+ Ice::Int a, Ice::Int b, const Ice::Current&)
+{
+ B ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwUndeclaredC_async(const AMD_Thrower_throwUndeclaredCPtr& cb,
+ Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current&)
+{
+ C ex;
+ ex.aMem = a;
+ ex.bMem = b;
+ ex.cMem = c;
+ cb->ice_exception(ex);
+}
+
+void
+ThrowerI::throwLocalException_async(const AMD_Thrower_throwLocalExceptionPtr& cb,
+ const Ice::Current&)
+{
+ cb->ice_exception(Ice::TimeoutException(__FILE__, __LINE__));
+}
+
+void
+ThrowerI::throwNonIceException_async(const AMD_Thrower_throwNonIceExceptionPtr&,
+ const Ice::Current&)
+{
+ assert(false); // We cannot throw non-Ice exceptions with AMD.
+}