diff options
Diffstat (limited to 'cpp/test/IceStorm/federation2/Publisher.cpp')
-rw-r--r-- | cpp/test/IceStorm/federation2/Publisher.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/cpp/test/IceStorm/federation2/Publisher.cpp b/cpp/test/IceStorm/federation2/Publisher.cpp index 8b2b853286e..4ff73cf0f13 100644 --- a/cpp/test/IceStorm/federation2/Publisher.cpp +++ b/cpp/test/IceStorm/federation2/Publisher.cpp @@ -2,7 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include <IceUtil/IceUtil.h> #include <IceUtil/Options.h> #include <Ice/Ice.h> #include <IceStorm/IceStorm.h> @@ -14,11 +13,11 @@ using namespace Ice; using namespace IceStorm; using namespace Test; -class Publisher : public Test::TestHelper +class Publisher final : public Test::TestHelper { public: - void run(int, char**); + void run(int, char**) override; }; void @@ -29,22 +28,22 @@ Publisher::run(int argc, char** argv) opts.addOpt("", "count", IceUtilInternal::Options::NeedArg); opts.parse(argc, (const char**)argv); - PropertiesPtr properties = communicator->getProperties(); - string managerProxy = properties->getProperty("IceStormAdmin.TopicManager.Default"); + auto properties = communicator->getProperties(); + auto managerProxy = properties->getProperty("IceStormAdmin.TopicManager.Default"); if(managerProxy.empty()) { throw runtime_error("property `IceStormAdmin.TopicManager.Default' is not set"); } - ObjectPrx base = communicator->stringToProxy(managerProxy); - IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); + auto base = communicator->stringToProxy(managerProxy); + auto manager = checkedCast<IceStorm::TopicManagerPrx>(base); if(!manager) { throw runtime_error("`" + managerProxy + "' is not running"); } - TopicPrx fed1 = manager->retrieve("fed1"); - EventPrx eventFed1 = EventPrx::uncheckedCast(fed1->getPublisher()->ice_oneway()); + auto fed1 = manager->retrieve("fed1"); + auto eventFed1 = uncheckedCast<EventPrx>(fed1->getPublisher()->ice_oneway()); string arg = opts.optArg("count"); int count = 1; @@ -63,14 +62,14 @@ Publisher::run(int argc, char** argv) // Before we exit, we ping all proxies as twoway, to make sure // that all oneways are delivered. // - EventPrx::uncheckedCast(eventFed1->ice_twoway())->ice_ping(); + eventFed1->ice_twoway()->ice_ping(); if(count == 0) { break; } --count; - IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(1)); + this_thread::sleep_for(1s); } } |