diff options
Diffstat (limited to 'cpp/test/Ice/objects/Client.cpp')
-rw-r--r-- | cpp/test/Ice/objects/Client.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cpp/test/Ice/objects/Client.cpp b/cpp/test/Ice/objects/Client.cpp index c61fa56625c..d9a019848cd 100644 --- a/cpp/test/Ice/objects/Client.cpp +++ b/cpp/test/Ice/objects/Client.cpp @@ -14,9 +14,41 @@ using namespace std; +class MyObjectFactory : public Ice::ObjectFactory +{ +public: + + virtual Ice::ObjectPtr create(const string& type) + { + if (type == "::B") + { + return new B; + } + else if (type == "::C") + { + return new C; + } + else if (type == "::D") + { + return new D; + } + assert(false); // Should never be reached + } + + virtual void destroy() + { + // Nothing to do + } +}; + int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { + Ice::ObjectFactoryPtr factory = new MyObjectFactory; + communicator->addObjectFactory(factory, "::B"); + communicator->addObjectFactory(factory, "::C"); + communicator->addObjectFactory(factory, "::D"); + InitialPrx allTests(const Ice::CommunicatorPtr&); InitialPrx initial = allTests(communicator); initial->shutdown(); |