summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-04-13 09:14:34 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-04-13 09:14:34 +0000
commitb4aa63207a91edc4fee016877c048f3c862bcb71 (patch)
treebd1cb1a7a30677c39ac9b065528d1ceed89d3d69 /cpp
parentadded Makefile .depend. (diff)
downloadice-b4aa63207a91edc4fee016877c048f3c862bcb71.tar.bz2
ice-b4aa63207a91edc4fee016877c048f3c862bcb71.tar.xz
ice-b4aa63207a91edc4fee016877c048f3c862bcb71.zip
moved session impl into seperate file.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/session/HelloSessionI.cpp55
-rwxr-xr-xcpp/demo/Ice/session/HelloSessionI.h33
-rwxr-xr-xcpp/demo/Ice/session/HelloSessionManagerI.cpp55
-rwxr-xr-xcpp/demo/Ice/session/Makefile1
-rwxr-xr-xcpp/demo/Ice/session/sessionC.plg17
5 files changed, 90 insertions, 71 deletions
diff --git a/cpp/demo/Ice/session/HelloSessionI.cpp b/cpp/demo/Ice/session/HelloSessionI.cpp
new file mode 100644
index 00000000000..2f8dbedeec2
--- /dev/null
+++ b/cpp/demo/Ice/session/HelloSessionI.cpp
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+
+#include <HelloSessionI.h>
+
+using namespace std;
+
+HelloSessionI::HelloSessionI(const SessionManagerIPtr& manager) :
+ _manager(manager)
+{
+}
+
+HelloSessionI::~HelloSessionI()
+{
+}
+
+void
+HelloSessionI::sayHello(const Ice::Current&) const
+{
+ cout << "Hello World!" << endl;
+}
+
+//
+// Destroy all session specific state.
+//
+void
+HelloSessionI::destroyed(const Ice::Current& c)
+{
+ c.adapter->remove(c.id);
+}
+
+//
+// This method is called by the client to destroy a session. All
+// it should do is call remove on the session manager. All user
+// specific cleanup should go in the destroyed() callback.
+//
+void
+HelloSessionI::destroy(const Ice::Current& c)
+{
+ _manager->remove(c.id);
+}
+
+void
+HelloSessionI::refresh(const Ice::Current& c)
+{
+ _manager->refresh(c.id);
+}
diff --git a/cpp/demo/Ice/session/HelloSessionI.h b/cpp/demo/Ice/session/HelloSessionI.h
new file mode 100755
index 00000000000..7d8ae3fffb0
--- /dev/null
+++ b/cpp/demo/Ice/session/HelloSessionI.h
@@ -0,0 +1,33 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef HELLO_SESSION_I_H
+#define HELLO_SESSION_I_H
+
+#include <HelloSession.h>
+#include <SessionManagerI.h>
+
+class HelloSessionI : public ::Demo::HelloSession
+{
+public:
+
+ HelloSessionI(const SessionManagerIPtr&);
+ ~HelloSessionI();
+
+ virtual void sayHello(const Ice::Current&) const;
+ virtual void destroyed(const Ice::Current&);
+ virtual void destroy(const Ice::Current&);
+ virtual void refresh(const Ice::Current&);
+
+private:
+
+ const SessionManagerIPtr _manager;
+};
+
+#endif
diff --git a/cpp/demo/Ice/session/HelloSessionManagerI.cpp b/cpp/demo/Ice/session/HelloSessionManagerI.cpp
index 0ad43dec770..7b7bcda8d3c 100755
--- a/cpp/demo/Ice/session/HelloSessionManagerI.cpp
+++ b/cpp/demo/Ice/session/HelloSessionManagerI.cpp
@@ -9,64 +9,11 @@
#include <Ice/Ice.h>
#include <HelloSessionManagerI.h>
-
-#include <HelloSession.h>
+#include <HelloSessionI.h>
using namespace std;
using namespace Demo;
-class HelloSessionI : public HelloSession
-{
-public:
-
- HelloSessionI(const SessionManagerIPtr& manager) :
- _manager(manager)
- {
- }
-
- ~HelloSessionI()
- {
- }
-
- virtual void
- sayHello(const Ice::Current&) const
- {
- cout << "Hello World!" << endl;
- }
-
- // Common session specific code.
-
- //
- // Destroy all session specific state.
- //
- virtual void
- destroyed(const Ice::Current& c)
- {
- c.adapter->remove(c.id);
- }
-
- //
- // This method is called by the client to destroy a session. All
- // it should do is call remove on the session manager. All user
- // specific cleanup should go in the destroyed() callback.
- //
- virtual void
- destroy(const Ice::Current& c)
- {
- _manager->remove(c.id);
- }
-
- virtual void
- refresh(const Ice::Current& c)
- {
- _manager->refresh(c.id);
- }
-
-private:
-
- const SessionManagerIPtr _manager;
-};
-
SessionPrx
HelloSessionManagerI::create(const Ice::Current& c)
{
diff --git a/cpp/demo/Ice/session/Makefile b/cpp/demo/Ice/session/Makefile
index 8c428585e4e..80f08a37236 100755
--- a/cpp/demo/Ice/session/Makefile
+++ b/cpp/demo/Ice/session/Makefile
@@ -20,6 +20,7 @@ OBJS = Session.o \
COBJS = Client.o
SOBJS = HelloSessionManagerI.o \
+ HelloSessionI.o \
SessionManagerI.o \
Server.o
diff --git a/cpp/demo/Ice/session/sessionC.plg b/cpp/demo/Ice/session/sessionC.plg
index 6d2f72723f4..21075add0ef 100755
--- a/cpp/demo/Ice/session/sessionC.plg
+++ b/cpp/demo/Ice/session/sessionC.plg
@@ -6,23 +6,6 @@
--------------------Configuration: sessionC - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\matthew\LOCALS~1\Temp\RSP2315.tmp" with contents
-[
-/nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_DEBUG" /D "_CONSOLE" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\src\ice\demo\Ice\session\Client.cpp"
-"C:\src\ice\demo\Ice\session\Session.cpp"
-"C:\src\ice\demo\Ice\session\HelloSession.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\matthew\LOCALS~1\Temp\RSP2315.tmp"
-Creating command line "link.exe Iced.lib IceUtild.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/client.pdb" /debug /machine:I386 /out:"client.exe" /pdbtype:sept /libpath:"../../../lib" .\Debug\Client.obj .\Debug\Session.obj .\Debug\HelloSession.obj "
-<h3>Output Window</h3>
-Compiling...
-Client.cpp
-Generating Code...
-Skipping... (no relevant changes detected)
-Session.cpp
-HelloSession.cpp
-Linking...