summaryrefslogtreecommitdiff
path: root/cpp/demo/IcePack/simple/HelloServiceI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2004-02-20 21:32:15 +0000
committerBenoit Foucher <benoit@zeroc.com>2004-02-20 21:32:15 +0000
commit69a05e28e0702e5fd96ff012c64dcf72847818fa (patch)
treed560b8285964520c820ca29b2dd1f7600d5ea725 /cpp/demo/IcePack/simple/HelloServiceI.cpp
parentmore ami (diff)
downloadice-69a05e28e0702e5fd96ff012c64dcf72847818fa.tar.bz2
ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.tar.xz
ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.zip
Fixed IcePack node bug and IcePack hello demo, added simple demo.
Diffstat (limited to 'cpp/demo/IcePack/simple/HelloServiceI.cpp')
-rw-r--r--cpp/demo/IcePack/simple/HelloServiceI.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/cpp/demo/IcePack/simple/HelloServiceI.cpp b/cpp/demo/IcePack/simple/HelloServiceI.cpp
new file mode 100644
index 00000000000..bdaa3193fbd
--- /dev/null
+++ b/cpp/demo/IcePack/simple/HelloServiceI.cpp
@@ -0,0 +1,60 @@
+// **********************************************************************
+//
+// Copyright (c) 2003
+// ZeroC, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <HelloServiceI.h>
+#include <HelloI.h>
+
+using namespace std;
+
+extern "C"
+{
+
+//
+// Factory function
+//
+HELLO_API ::IceBox::Service*
+create(::Ice::CommunicatorPtr communicator)
+{
+ return new HelloServiceI;
+}
+
+}
+
+HelloServiceI::HelloServiceI()
+{
+}
+
+HelloServiceI::~HelloServiceI()
+{
+}
+
+void
+HelloServiceI::start(const string& name,
+ const ::Ice::CommunicatorPtr& communicator,
+ const ::Ice::StringSeq& args)
+{
+ string id = communicator->getProperties()->getProperty("Identity");
+
+ _adapter = communicator->createObjectAdapter(name);
+ ::Ice::ObjectPtr object = new HelloI;
+ _adapter->add(object, Ice::stringToIdentity(id));
+ _adapter->activate();
+}
+
+void
+HelloServiceI::stop()
+{
+ _adapter->deactivate();
+}