diff options
Diffstat (limited to 'cpp/test/Ice/metrics/TestAMDI.cpp')
-rw-r--r-- | cpp/test/Ice/metrics/TestAMDI.cpp | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/cpp/test/Ice/metrics/TestAMDI.cpp b/cpp/test/Ice/metrics/TestAMDI.cpp index f582a1384a8..0bc92643bfe 100644 --- a/cpp/test/Ice/metrics/TestAMDI.cpp +++ b/cpp/test/Ice/metrics/TestAMDI.cpp @@ -10,6 +10,74 @@ #include <Ice/Ice.h> #include <TestAMDI.h> +using namespace std; + +#ifdef ICE_CPP11_MAPPING +void +MetricsI::op_async(function<void ()> response, function<void (exception_ptr)>, const Ice::Current&) +{ + response(); +} + +void +MetricsI::fail_async(function<void ()> response, function<void (exception_ptr)>, const Ice::Current& current) +{ + current.con->close(true); + response(); +} + +void +MetricsI::opWithUserException_async(function<void ()>, function<void (exception_ptr)> error, const Ice::Current&) +{ + try + { + throw Test::UserEx(); + } + catch(...) + { + error(current_exception()); + } +} + +void +MetricsI::opWithRequestFailedException_async(function<void ()>, function<void (exception_ptr)> error, + const Ice::Current&) +{ + try + { + throw Ice::ObjectNotExistException(__FILE__, __LINE__); + } + catch(...) + { + error(current_exception()); + } +} + +void +MetricsI::opWithLocalException_async(function<void ()>, function<void (exception_ptr)> error, const Ice::Current&) +{ + try + { + throw Ice::SyscallException(__FILE__, __LINE__); + } + catch(...) + { + error(current_exception()); + } +} + +void +MetricsI::opWithUnknownException_async(function<void ()>, function<void (exception_ptr)>, const Ice::Current&) +{ + throw "Test"; +} + +void +MetricsI::opByteS_async(Test::ByteSeq, function<void ()> response, function<void (exception_ptr)>, const Ice::Current&) +{ + response(); +} +#else void MetricsI::op_async(const Test::AMD_Metrics_opPtr& cb, const Ice::Current&) { @@ -53,8 +121,9 @@ MetricsI::opByteS_async(const Test::AMD_Metrics_opByteSPtr& cb, const Test::Byte { cb->ice_response(); } +#endif -Ice::ObjectPrx +Ice::ObjectPrxPtr MetricsI::getAdmin(const Ice::Current& current) { return current.adapter->getCommunicator()->getAdmin(); |