diff options
Diffstat (limited to 'cpp/test/Ice/dispatcher/Collocated.cpp')
-rw-r--r-- | cpp/test/Ice/dispatcher/Collocated.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/cpp/test/Ice/dispatcher/Collocated.cpp b/cpp/test/Ice/dispatcher/Collocated.cpp index a83ee20a446..b08e2440643 100644 --- a/cpp/test/Ice/dispatcher/Collocated.cpp +++ b/cpp/test/Ice/dispatcher/Collocated.cpp @@ -39,27 +39,6 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) return EXIT_SUCCESS; } -#ifdef ICE_CPP11_MAPPING -class DispatcherCall : public Ice::DispatcherCall -{ -public: - - DispatcherCall(function<void()> call) : - _call(move(call)) - { - } - - virtual void run() - { - _call(); - } - -private: - - function<void()> _call; -}; -#endif - int main(int argc, char* argv[]) { @@ -72,10 +51,10 @@ main(int argc, char* argv[]) Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); #ifdef ICE_CPP11_MAPPING - Ice::DispatcherPtr dispatcher = new Dispatcher(); + IceUtil::Handle<Dispatcher> dispatcher = new Dispatcher; initData.dispatcher = [=](function<void()> call, const shared_ptr<Ice::Connection>& conn) { - dispatcher->dispatch(new DispatcherCall(call), conn); + dispatcher->dispatch(make_shared<DispatcherCall>(call), conn); }; #else initData.dispatcher = new Dispatcher(); |