summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/nested
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-09 07:05:32 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-09 07:05:32 +0000
commitd9e37798719846dd6ea7f25fcc4eb053db2c2efe (patch)
tree04dc91fdacae69db9adb3ba8c8d0872a7243662d /cpp/demo/Ice/nested
parentFirst saving support (diff)
downloadice-d9e37798719846dd6ea7f25fcc4eb053db2c2efe.tar.bz2
ice-d9e37798719846dd6ea7f25fcc4eb053db2c2efe.tar.xz
ice-d9e37798719846dd6ea7f25fcc4eb053db2c2efe.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'cpp/demo/Ice/nested')
-rw-r--r--cpp/demo/Ice/nested/Client.cpp13
-rw-r--r--cpp/demo/Ice/nested/NestedI.h2
-rw-r--r--cpp/demo/Ice/nested/README11
-rw-r--r--cpp/demo/Ice/nested/Server.cpp7
4 files changed, 21 insertions, 12 deletions
diff --git a/cpp/demo/Ice/nested/Client.cpp b/cpp/demo/Ice/nested/Client.cpp
index f9c7d8cf2f6..38f419b9e6e 100644
--- a/cpp/demo/Ice/nested/Client.cpp
+++ b/cpp/demo/Ice/nested/Client.cpp
@@ -7,14 +7,13 @@
//
// **********************************************************************
-#include <Ice/Application.h>
#include <NestedI.h>
+#include <Ice/Application.h>
using namespace std;
-using namespace Ice;
using namespace Demo;
-class NestedClient : public Application
+class NestedClient : public Ice::Application
{
public:
@@ -31,7 +30,7 @@ main(int argc, char* argv[])
int
NestedClient::run(int argc, char* argv[])
{
- PropertiesPtr properties = communicator()->getProperties();
+ Ice::PropertiesPtr properties = communicator()->getProperties();
const char* proxyProperty = "Nested.Client.NestedServer";
std::string proxy = properties->getProperty(proxyProperty);
if(proxy.empty())
@@ -40,7 +39,7 @@ NestedClient::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- ObjectPrx base = communicator()->stringToProxy(proxy);
+ Ice::ObjectPrx base = communicator()->stringToProxy(proxy);
NestedPrx nested = NestedPrx::checkedCast(base);
if(!nested)
{
@@ -48,7 +47,7 @@ NestedClient::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Nested.Client");
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Nested.Client");
NestedPrx self = NestedPrx::uncheckedCast(adapter->createProxy(Ice::stringToIdentity("nestedClient")));
adapter->add(new NestedI(self), Ice::stringToIdentity("nestedClient"));
adapter->activate();
@@ -72,7 +71,7 @@ NestedClient::run(int argc, char* argv[])
nested->nestedCall(level, self);
}
}
- catch(const Exception& ex)
+ catch(const Ice::Exception& ex)
{
cerr << ex << endl;
}
diff --git a/cpp/demo/Ice/nested/NestedI.h b/cpp/demo/Ice/nested/NestedI.h
index 7117bf9b402..0e6777ea2cc 100644
--- a/cpp/demo/Ice/nested/NestedI.h
+++ b/cpp/demo/Ice/nested/NestedI.h
@@ -21,7 +21,7 @@ public:
private:
- Demo::NestedPrx _self;
+ const Demo::NestedPrx _self;
};
#endif
diff --git a/cpp/demo/Ice/nested/README b/cpp/demo/Ice/nested/README
new file mode 100644
index 00000000000..5f1b1b9a044
--- /dev/null
+++ b/cpp/demo/Ice/nested/README
@@ -0,0 +1,11 @@
+A demo to illustrate how nested callbacks work, and how the size of
+the thread pool affects the maximum nesting depth.
+
+To run the demo, first start the server:
+
+$ server
+
+In a separate window, start the client:
+
+$ client
+
diff --git a/cpp/demo/Ice/nested/Server.cpp b/cpp/demo/Ice/nested/Server.cpp
index 39cbfbd2faa..21c90e32baf 100644
--- a/cpp/demo/Ice/nested/Server.cpp
+++ b/cpp/demo/Ice/nested/Server.cpp
@@ -7,14 +7,13 @@
//
// **********************************************************************
-#include <Ice/Application.h>
#include <NestedI.h>
+#include <Ice/Application.h>
using namespace std;
-using namespace Ice;
using namespace Demo;
-class NestedServer : public Application
+class NestedServer : public Ice::Application
{
public:
@@ -31,7 +30,7 @@ main(int argc, char* argv[])
int
NestedServer::run(int argc, char* argv[])
{
- ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Nested.Server");
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Nested.Server");
NestedPrx self = NestedPrx::uncheckedCast(adapter->createProxy(Ice::stringToIdentity("nestedServer")));
adapter->add(new NestedI(self), Ice::stringToIdentity("nestedServer"));
adapter->activate();