summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/bidir/CallbackI.h3
-rw-r--r--cpp/demo/Ice/callback/Client.cpp4
-rw-r--r--cpp/demo/Ice/hello/Client.cpp4
-rw-r--r--cpp/demo/Ice/nested/Client.cpp3
-rw-r--r--cpp/demo/IceBox/hello/Client.cpp4
-rw-r--r--cpp/demo/IcePack/simple/Client.cpp62
-rw-r--r--cpp/demo/IcePack/simple/Server.cpp19
-rw-r--r--cpp/src/IceUtil/ThreadException.cpp1
8 files changed, 41 insertions, 59 deletions
diff --git a/cpp/demo/Ice/bidir/CallbackI.h b/cpp/demo/Ice/bidir/CallbackI.h
index 0990b911f04..7d32a84f64a 100644
--- a/cpp/demo/Ice/bidir/CallbackI.h
+++ b/cpp/demo/Ice/bidir/CallbackI.h
@@ -59,11 +59,10 @@ private:
private:
- CallbackSenderIPtr _callbackSender;
+ const CallbackSenderIPtr _callbackSender;
};
IceUtil::ThreadPtr _callbackSenderThread;
-
};
#endif
diff --git a/cpp/demo/Ice/callback/Client.cpp b/cpp/demo/Ice/callback/Client.cpp
index 28f6e401acd..b0bff93ca3a 100644
--- a/cpp/demo/Ice/callback/Client.cpp
+++ b/cpp/demo/Ice/callback/Client.cpp
@@ -53,8 +53,8 @@ CallbackClient::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- Ice::ObjectPrx base = communicator()->stringToProxy(proxy);
- CallbackSenderPrx twoway = CallbackSenderPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
+ CallbackSenderPrx twoway = CallbackSenderPrx::checkedCast(
+ communicator()->stringToProxy(proxy)->ice_twoway()->ice_timeout(-1)->ice_secure(false));
if(!twoway)
{
cerr << appName() << ": invalid proxy" << endl;
diff --git a/cpp/demo/Ice/hello/Client.cpp b/cpp/demo/Ice/hello/Client.cpp
index 7fbb8d0053d..e6246f75c0c 100644
--- a/cpp/demo/Ice/hello/Client.cpp
+++ b/cpp/demo/Ice/hello/Client.cpp
@@ -43,8 +43,8 @@ HelloClient::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- Ice::ObjectPrx base = communicator()->stringToProxy(proxy);
- HelloPrx twoway = HelloPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
+ HelloPrx twoway = HelloPrx::checkedCast(
+ communicator()->stringToProxy(proxy)->ice_twoway()->ice_timeout(-1)->ice_secure(false));
if(!twoway)
{
cerr << argv[0] << ": invalid proxy" << endl;
diff --git a/cpp/demo/Ice/nested/Client.cpp b/cpp/demo/Ice/nested/Client.cpp
index 38f419b9e6e..29c78d31e35 100644
--- a/cpp/demo/Ice/nested/Client.cpp
+++ b/cpp/demo/Ice/nested/Client.cpp
@@ -39,8 +39,7 @@ NestedClient::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- Ice::ObjectPrx base = communicator()->stringToProxy(proxy);
- NestedPrx nested = NestedPrx::checkedCast(base);
+ NestedPrx nested = NestedPrx::checkedCast(communicator()->stringToProxy(proxy));
if(!nested)
{
cerr << appName() << ": invalid proxy" << endl;
diff --git a/cpp/demo/IceBox/hello/Client.cpp b/cpp/demo/IceBox/hello/Client.cpp
index 8366704983f..4017a29e8c5 100644
--- a/cpp/demo/IceBox/hello/Client.cpp
+++ b/cpp/demo/IceBox/hello/Client.cpp
@@ -60,8 +60,8 @@ HelloClient::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- Ice::ObjectPrx base = communicator()->stringToProxy(proxy);
- HelloPrx twoway = HelloPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
+ HelloPrx twoway = HelloPrx::checkedCast(
+ communicator()->stringToProxy(proxy)->ice_twoway()->ice_timeout(-1)->ice_secure(false));
if(!twoway)
{
cerr << argv[0] << ": invalid proxy" << endl;
diff --git a/cpp/demo/IcePack/simple/Client.cpp b/cpp/demo/IcePack/simple/Client.cpp
index 44619a15a41..7853d89541b 100644
--- a/cpp/demo/IcePack/simple/Client.cpp
+++ b/cpp/demo/IcePack/simple/Client.cpp
@@ -14,8 +14,26 @@
using namespace std;
using namespace Demo;
+class HelloClient : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+
+private:
+
+ void menu();
+};
+
+int
+main(int argc, char* argv[])
+{
+ HelloClient app;
+ return app.main(argc, argv, "config");
+}
+
void
-menu()
+HelloClient::menu()
{
cout <<
"usage:\n"
@@ -33,11 +51,11 @@ menu()
}
int
-run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+HelloClient::run(int argc, char* argv[])
{
- Ice::PropertiesPtr properties = communicator->getProperties();
+ Ice::PropertiesPtr properties = communicator()->getProperties();
- IcePack::QueryPrx query = IcePack::QueryPrx::checkedCast(communicator->stringToProxy("IcePack/Query"));
+ IcePack::QueryPrx query = IcePack::QueryPrx::checkedCast(communicator()->stringToProxy("IcePack/Query"));
Ice::ObjectPrx base = query->findObjectByType("::Demo::Hello");
HelloPrx twoway = HelloPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
@@ -99,7 +117,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
else if(c == 'f')
{
- communicator->flushBatchRequests();
+ communicator()->flushBatchRequests();
}
else if(c == 'T')
{
@@ -172,37 +190,3 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
return EXIT_SUCCESS;
}
-int
-main(int argc, char* argv[])
-{
- int status;
- Ice::CommunicatorPtr communicator;
-
- try
- {
- Ice::PropertiesPtr properties = Ice::createProperties();
- properties->load("config");
- communicator = Ice::initializeWithProperties(argc, argv, properties);
- status = run(argc, argv, communicator);
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
-
- if(communicator)
- {
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
- }
-
- return status;
-}
diff --git a/cpp/demo/IcePack/simple/Server.cpp b/cpp/demo/IcePack/simple/Server.cpp
index c3666ffc5d4..820e88a7051 100644
--- a/cpp/demo/IcePack/simple/Server.cpp
+++ b/cpp/demo/IcePack/simple/Server.cpp
@@ -21,22 +21,21 @@ public:
};
int
+main(int argc, char* argv[])
+{
+ Server app;
+ int status = app.main(argc, argv);
+ return status;
+}
+
+int
Server::run(int argc, char* argv[])
{
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
string id = communicator()->getProperties()->getProperty("Identity");
- Ice::ObjectPtr object = new HelloI;
- adapter->add(object, Ice::stringToIdentity(id));
+ adapter->add(new HelloI(), Ice::stringToIdentity(id));
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
}
-
-int
-main(int argc, char* argv[])
-{
- Server app;
- int status = app.main(argc, argv);
- return status;
-}
diff --git a/cpp/src/IceUtil/ThreadException.cpp b/cpp/src/IceUtil/ThreadException.cpp
index abaa79f26a6..8a9bb039d39 100644
--- a/cpp/src/IceUtil/ThreadException.cpp
+++ b/cpp/src/IceUtil/ThreadException.cpp
@@ -15,6 +15,7 @@ IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int li
Exception(file, line),
_error(err)
{
+ abort(); //XXX:
}
const char* IceUtil::ThreadSyscallException::_name = "IceUtil::ThreadSyscallException";