diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-03-20 18:18:03 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-03-20 18:18:03 +0100 |
commit | c6133370d229578697c157f94b297dcc593b4a5f (patch) | |
tree | 9bbc2e3083338315393109a511e7a65d09dc9ac6 /cpp/test/Ice/interceptor/Client.cpp | |
parent | Remove src directory. (diff) | |
download | ice-c6133370d229578697c157f94b297dcc593b4a5f.tar.bz2 ice-c6133370d229578697c157f94b297dcc593b4a5f.tar.xz ice-c6133370d229578697c157f94b297dcc593b4a5f.zip |
Added iOS support for IceTouch
Diffstat (limited to 'cpp/test/Ice/interceptor/Client.cpp')
-rw-r--r-- | cpp/test/Ice/interceptor/Client.cpp | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp index 79ed9bcc62a..5f25a07f199 100644 --- a/cpp/test/Ice/interceptor/Client.cpp +++ b/cpp/test/Ice/interceptor/Client.cpp @@ -27,7 +27,58 @@ DEFINE_TEST("client") using namespace std; -class Client : public Ice::Application +#ifdef __APPLE__ +namespace +{ + +class App +{ +public: + + ~App() + { + if(_communicator) + { + try + { + _communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cout << ex << endl; + } + } + } + + Ice::CommunicatorPtr communicator() + { + return _communicator; + } + + virtual int _main(int argc, char** argv) + { + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.Warn.Dispatch", "0"); + _communicator = Ice::initialize(initData); + return run(argc, argv); + } + virtual int run(int argc, char** argv) = 0; + +private: + + Ice::CommunicatorPtr _communicator; +}; + +} +#else +namespace +{ +typedef Ice::Application App; +} +#endif + +class Client : public App { public: @@ -61,7 +112,11 @@ main(int argc, char* argv[]) #endif Client app; +#if __APPLE__ + int result = app._main(argc, argv); +#else int result = app.main(argc, argv); +#endif #ifndef _WIN32 // |