diff options
Diffstat (limited to 'cpp/demo/Ice')
-rw-r--r-- | cpp/demo/Ice/hello/Client.cpp | 10 | ||||
-rw-r--r-- | cpp/demo/Ice/latency/Client.cpp | 10 | ||||
-rw-r--r-- | cpp/demo/Ice/pickle/ServantFactory.cpp | 6 | ||||
-rw-r--r-- | cpp/demo/Ice/pickle/ServantFactory.h | 1 | ||||
-rw-r--r-- | cpp/demo/Ice/value/Client.cpp | 10 | ||||
-rw-r--r-- | cpp/demo/Ice/value/ServantFactory.cpp | 6 | ||||
-rw-r--r-- | cpp/demo/Ice/value/ServantFactory.h | 1 |
7 files changed, 38 insertions, 6 deletions
diff --git a/cpp/demo/Ice/hello/Client.cpp b/cpp/demo/Ice/hello/Client.cpp index ecc5680cd77..f02cc612d48 100644 --- a/cpp/demo/Ice/hello/Client.cpp +++ b/cpp/demo/Ice/hello/Client.cpp @@ -35,9 +35,15 @@ int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); - std::string ref = properties->getProperty("Hello.Hello"); - Ice::ObjectPrx base = communicator->stringToProxy(ref); + const char* refProperty = "Hello.Hello"; + std::string ref = properties->getProperty(refProperty); + if (ref.empty()) + { + cerr << argv[0] << ": property `" << refProperty << "' not set" << endl; + return EXIT_FAILURE; + } + Ice::ObjectPrx base = communicator->stringToProxy(ref); HelloPrx twoway = HelloPrx::checkedCast(base); if (!twoway) { diff --git a/cpp/demo/Ice/latency/Client.cpp b/cpp/demo/Ice/latency/Client.cpp index 78d6734d948..0af75905205 100644 --- a/cpp/demo/Ice/latency/Client.cpp +++ b/cpp/demo/Ice/latency/Client.cpp @@ -22,9 +22,15 @@ int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); - std::string ref = properties->getProperty("Latency.Ping"); - Ice::ObjectPrx base = communicator->stringToProxy(ref); + const char* refProperty = "Latency.Ping"; + std::string ref = properties->getProperty(refProperty); + if (ref.empty()) + { + cerr << argv[0] << ": property `" << refProperty << "' not set" << endl; + return EXIT_FAILURE; + } + Ice::ObjectPrx base = communicator->stringToProxy(ref); PingPrx ping = PingPrx::checkedCast(base); if (!ping) { diff --git a/cpp/demo/Ice/pickle/ServantFactory.cpp b/cpp/demo/Ice/pickle/ServantFactory.cpp index fd34ec210a7..906db19f5cd 100644 --- a/cpp/demo/Ice/pickle/ServantFactory.cpp +++ b/cpp/demo/Ice/pickle/ServantFactory.cpp @@ -20,3 +20,9 @@ ServantFactory::create(const string& type) assert(type == "::Persistent"); return new Persistent; } + +void +ServantFactory::destroy() +{ + // Nothing to do +} diff --git a/cpp/demo/Ice/pickle/ServantFactory.h b/cpp/demo/Ice/pickle/ServantFactory.h index 74493f88848..67931bca3fb 100644 --- a/cpp/demo/Ice/pickle/ServantFactory.h +++ b/cpp/demo/Ice/pickle/ServantFactory.h @@ -16,6 +16,7 @@ class ServantFactory : public Ice::ServantFactory public: virtual Ice::ObjectPtr create(const std::string&); + virtual void destroy(); }; #endif diff --git a/cpp/demo/Ice/value/Client.cpp b/cpp/demo/Ice/value/Client.cpp index 8636b07b94f..246fcceb8bf 100644 --- a/cpp/demo/Ice/value/Client.cpp +++ b/cpp/demo/Ice/value/Client.cpp @@ -18,9 +18,15 @@ int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); - string ref = properties->getProperty("Value.Initial"); - Ice::ObjectPrx base = communicator->stringToProxy(ref); + const char* refProperty = "Value.Initial"; + std::string ref = properties->getProperty(refProperty); + if (ref.empty()) + { + cerr << argv[0] << ": property `" << refProperty << "' not set" << endl; + return EXIT_FAILURE; + } + Ice::ObjectPrx base = communicator->stringToProxy(ref); InitialPrx initial = InitialPrx::checkedCast(base); if (!initial) { diff --git a/cpp/demo/Ice/value/ServantFactory.cpp b/cpp/demo/Ice/value/ServantFactory.cpp index 6f774c4a014..1f9768c08ed 100644 --- a/cpp/demo/Ice/value/ServantFactory.cpp +++ b/cpp/demo/Ice/value/ServantFactory.cpp @@ -30,3 +30,9 @@ ServantFactory::create(const string& type) assert(false); return 0; } + +void +ServantFactory::destroy() +{ + // Nothing to do +} diff --git a/cpp/demo/Ice/value/ServantFactory.h b/cpp/demo/Ice/value/ServantFactory.h index 74493f88848..67931bca3fb 100644 --- a/cpp/demo/Ice/value/ServantFactory.h +++ b/cpp/demo/Ice/value/ServantFactory.h @@ -16,6 +16,7 @@ class ServantFactory : public Ice::ServantFactory public: virtual Ice::ObjectPtr create(const std::string&); + virtual void destroy(); }; #endif |