diff options
author | Jose <jose@zeroc.com> | 2015-12-22 22:34:36 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2015-12-22 22:34:36 +0100 |
commit | 27d7d8f432d73318e30dd4fe3395ec19cd18edea (patch) | |
tree | d796c6d56df6aebc40aac4513984e6072a6d61e6 /cpp/test/Ice/metrics/TestAMDI.cpp | |
parent | Fixed C++98 to get rid of Ice::Context pointers now that we use Ice::noExplic... (diff) | |
download | ice-27d7d8f432d73318e30dd4fe3395ec19cd18edea.tar.bz2 ice-27d7d8f432d73318e30dd4fe3395ec19cd18edea.tar.xz ice-27d7d8f432d73318e30dd4fe3395ec19cd18edea.zip |
C++11 metrics fixes
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(); |