diff options
author | Jose <jose@zeroc.com> | 2015-12-01 17:36:19 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2015-12-01 17:36:19 +0100 |
commit | 2029ff368e49fae489b8ec8fc12f7d126b182dfb (patch) | |
tree | 6075d652b7851831c39e6f22004d8720864f1a60 /cpp/test/Ice/operations/OnewaysAMI.cpp | |
parent | The default LMDB map size for IceGrid and IceStorm is now 10MB (Windows) (diff) | |
download | ice-2029ff368e49fae489b8ec8fc12f7d126b182dfb.tar.bz2 ice-2029ff368e49fae489b8ec8fc12f7d126b182dfb.tar.xz ice-2029ff368e49fae489b8ec8fc12f7d126b182dfb.zip |
C++11 mapping initial commit
Diffstat (limited to 'cpp/test/Ice/operations/OnewaysAMI.cpp')
-rw-r--r-- | cpp/test/Ice/operations/OnewaysAMI.cpp | 107 |
1 files changed, 103 insertions, 4 deletions
diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index ee48f534b0b..c4342818256 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -80,22 +80,43 @@ typedef IceUtil::Handle<Callback> CallbackPtr; } void -onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) +onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { - Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(proxy->ice_oneway()); + Test::MyClassPrxPtr p = ICE_UNCHECKED_CAST(Test::MyClassPrx, proxy->ice_oneway()); { CallbackPtr cb = new Callback; +#ifdef ICE_CPP11_MAPPING + p->ice_ping_async( + nullptr, + [](exception_ptr) + { + test(false); + }, + [&](bool sent) + { + cb->sent(sent); + }); +#else Ice::Callback_Object_ice_pingPtr callback = Ice::newCallback_Object_ice_ping(cb, &Callback::noException, &Callback::sent); p->begin_ice_ping(callback); +#endif cb->check(); } { try { +#ifdef ICE_CPP11_MAPPING + p->ice_isA_async(Test::MyClass::ice_staticId(), + [&](bool) + { + test(false); + }); +#else p->begin_ice_isA(Test::MyClass::ice_staticId()); +#endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -106,7 +127,15 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { try { +#ifdef ICE_CPP11_MAPPING + p->ice_id_async( + [&](string) + { + test(false); + }); +#else p->begin_ice_id(); +#endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -117,7 +146,14 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { try { +#ifdef ICE_CPP11_MAPPING + p->ice_ids_async( + [&](vector<string>) + { + }); +#else p->begin_ice_ids(); +#endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -127,51 +163,104 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { CallbackPtr cb = new Callback; +#ifdef ICE_CPP11_MAPPING + p->opVoid_async( + nullptr, + [](exception_ptr) + { + test(false); + }, + [&](bool sent) + { + cb->sent(sent); + }); +#else Test::Callback_MyClass_opVoidPtr callback = Test::newCallback_MyClass_opVoid(cb, &Callback::noException, &Callback::sent); p->begin_opVoid(callback); +#endif cb->check(); } { CallbackPtr cb = new Callback; +#ifdef ICE_CPP11_MAPPING + p->opIdempotent_async( + nullptr, + [](exception_ptr) + { + test(false); + }, + [&](bool sent) + { + cb->sent(sent); + }); +#else Test::Callback_MyClass_opIdempotentPtr callback = Test::newCallback_MyClass_opIdempotent(cb, &Callback::noException, &Callback::sent); p->begin_opIdempotent(callback); +#endif cb->check(); } { CallbackPtr cb = new Callback; +#ifdef ICE_CPP11_MAPPING + p->opNonmutating_async( + nullptr, + [](exception_ptr) + { + test(false); + }, + [&](bool sent) + { + cb->sent(sent); + }); +#else Test::Callback_MyClass_opNonmutatingPtr callback = Test::newCallback_MyClass_opNonmutating(cb, &Callback::noException, &Callback::sent); p->begin_opNonmutating(callback); +#endif cb->check(); } { try { +#ifdef ICE_CPP11_MAPPING + p->opByte_async(Ice::Byte(0xff), Ice::Byte(0x0f), + [](Ice::Byte, Ice::Byte) + { + test(false); + }); +#else p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f)); +#endif test(false); } catch(const IceUtil::IllegalArgumentException&) { } } -#ifdef ICE_CPP11 +#ifdef ICE_CPP11_COMPILER +# ifndef ICE_CPP11_MAPPING { CallbackPtr cb = new Callback; p->begin_ice_ping(nullptr, [=](const Ice::Exception& ex){ cb->noException(ex); }, [=](bool sent){ cb->sent(sent); }); cb->check(); - } + } +# endif { try { +# ifdef ICE_CPP11_MAPPING + p->ice_isA_async(Test::MyClass::ice_staticId()); +# else p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool){ test(false); }); +# endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -182,7 +271,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { try { +# ifdef ICE_CPP11_MAPPING + p->ice_id_async(); +# else p->begin_ice_id([=](const string&){ test(false); }); +# endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -193,7 +286,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { try { +# ifdef ICE_CPP11_MAPPING + p->ice_ids_async(); +# else p->begin_ice_ids([=](const Ice::StringSeq&){ test(false); }); +# endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -201,6 +298,7 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) } } +# ifndef ICE_CPP11_MAPPING { CallbackPtr cb = new Callback; p->begin_opVoid(nullptr, @@ -235,5 +333,6 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { } } +# endif #endif } |