diff options
author | Joe George <joe@zeroc.com> | 2021-02-03 11:16:06 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2021-02-03 11:42:30 -0500 |
commit | 48f9b28634908c43a23c30e219a9abfb038c1539 (patch) | |
tree | 81420c7142bb57902ad96de1d057b5259c29a287 /cpp/test/IceStorm/stress/Publisher.cpp | |
parent | IceGrid and IceStorm fixes (diff) | |
download | ice-48f9b28634908c43a23c30e219a9abfb038c1539.tar.bz2 ice-48f9b28634908c43a23c30e219a9abfb038c1539.tar.xz ice-48f9b28634908c43a23c30e219a9abfb038c1539.zip |
Additional C++11 fixes
Diffstat (limited to 'cpp/test/IceStorm/stress/Publisher.cpp')
-rw-r--r-- | cpp/test/IceStorm/stress/Publisher.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cpp/test/IceStorm/stress/Publisher.cpp b/cpp/test/IceStorm/stress/Publisher.cpp index 221d4c74d73..10b4c6feeb6 100644 --- a/cpp/test/IceStorm/stress/Publisher.cpp +++ b/cpp/test/IceStorm/stress/Publisher.cpp @@ -13,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 @@ -56,8 +56,8 @@ Publisher::run(int argc, char** argv) bool oneway = opts.isSet("oneway"); bool maxQueueTest = opts.isSet("maxQueueTest"); - PropertiesPtr properties = communicator->getProperties(); - const char* managerProxyProperty = "IceStormAdmin.TopicManager.Default"; + auto properties = communicator->getProperties(); + string managerProxyProperty = "IceStormAdmin.TopicManager.Default"; string managerProxy = properties->getProperty(managerProxyProperty); if(managerProxy.empty()) { @@ -66,7 +66,7 @@ Publisher::run(int argc, char** argv) throw invalid_argument(os.str()); } - IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast( + auto manager = checkedCast<IceStorm::TopicManagerPrx>( communicator->stringToProxy(managerProxy)); if(!manager) { @@ -75,13 +75,13 @@ Publisher::run(int argc, char** argv) throw invalid_argument(os.str()); } - TopicPrx topic = manager->retrieve("fed1"); + auto topic = manager->retrieve("fed1"); - EventPrx twowayProxy = EventPrx::uncheckedCast(topic->getPublisher()->ice_twoway()); - EventPrx proxy; + auto twowayProxy = uncheckedCast<EventPrx>(topic->getPublisher()->ice_twoway()); + shared_ptr<EventPrx> proxy; if(oneway) { - proxy = EventPrx::uncheckedCast(twowayProxy->ice_oneway()); + proxy = twowayProxy->ice_oneway(); } else { @@ -93,7 +93,7 @@ Publisher::run(int argc, char** argv) if(maxQueueTest && i == 10) { // Sleep one seconds to give some time to IceStorm to connect to the subscriber - IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(1)); + this_thread::sleep_for(1s); } proxy->pub(i); } |