diff options
author | Joe George <joe@zeroc.com> | 2015-12-08 11:33:42 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2015-12-08 16:09:24 -0500 |
commit | 6a43686ce26de5d2d5edf4a485ecff3a242c26b6 (patch) | |
tree | d31e4f16dc9ed6e28056a7224e045a4638955f5e /cpp/test/Ice/exceptions/AllTests.cpp | |
parent | C++11 mapping IceDiscovery plug-in (diff) | |
download | ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.tar.bz2 ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.tar.xz ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.zip |
ICE-6908 - Add ValueFactory
ValueFactory is a replacement for ObjectFactory (which is still
available if needed). It is an interface with only one operation
and can has the "delegate" metadata.
Diffstat (limited to 'cpp/test/Ice/exceptions/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/exceptions/AllTests.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index 562fb63a935..55eaa81147e 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -39,12 +39,13 @@ public: #endif }; -class ObjectFactoryI : virtual public Ice::ObjectFactory +#ifndef ICE_CPP11_MAPPING // C++98 +class ValueFactoryI : virtual public Ice::ValueFactory { public: virtual Ice::ObjectPtr create(const string&) { return 0; } - virtual void destroy() {} }; +#endif class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> { @@ -634,10 +635,10 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing object factory registration exception... " << flush; + cout << "testing value factory registration exception... " << flush; { #ifdef ICE_CPP11_MAPPING - communicator->addObjectFactory( + communicator->addValueFactory( [](const std::string&) { return nullptr; @@ -645,7 +646,7 @@ allTests(const Ice::CommunicatorPtr& communicator) "x"); try { - communicator->addObjectFactory( + communicator->addValueFactory( [](const std::string&) { return nullptr; @@ -657,11 +658,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { } #else - Ice::ObjectFactoryPtr of = new ObjectFactoryI; - communicator->addObjectFactory(of, "x"); + Ice::ValueFactoryPtr vf = new ValueFactoryI; + communicator->addValueFactory(vf, "x"); try { - communicator->addObjectFactory(of, "x"); + communicator->addValueFactory(vf, "x"); test(false); } catch(const Ice::AlreadyRegisteredException&) |