summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/SessionI.h
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-04-19 00:24:08 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-04-19 00:24:08 +0000
commit985f18404d3b00ef445ea44619fad548da549ff0 (patch)
tree383f58b121b52227cd05cfb0851205656acc5443 /cpp/demo/Ice/session/SessionI.h
parentfix for bug 243: python demos lack mutex protection (diff)
downloadice-985f18404d3b00ef445ea44619fad548da549ff0.tar.bz2
ice-985f18404d3b00ef445ea44619fad548da549ff0.tar.xz
ice-985f18404d3b00ef445ea44619fad548da549ff0.zip
addressed comments added by Marc.
Diffstat (limited to 'cpp/demo/Ice/session/SessionI.h')
-rwxr-xr-xcpp/demo/Ice/session/SessionI.h32
1 files changed, 9 insertions, 23 deletions
diff --git a/cpp/demo/Ice/session/SessionI.h b/cpp/demo/Ice/session/SessionI.h
index 2d46ef27d3d..512a7acc4a1 100755
--- a/cpp/demo/Ice/session/SessionI.h
+++ b/cpp/demo/Ice/session/SessionI.h
@@ -15,45 +15,31 @@
// XXX Get rid of leading ::, i.e., use Demo::, not ::Demo::
// (everywhere).
+// Style: The other demos all use ::Demo::
class SessionI : public ::Demo::Session, public IceUtil::Mutex
{
public:
- // XXX Should be private, with SessionFactoryI being a friend.
- SessionI(const Ice::ObjectAdapterPtr&, const IceUtil::Time&);
- virtual ~SessionI();
-
virtual ::Demo::HelloPrx createHello(const Ice::Current&);
virtual void refresh(const Ice::Current&);
virtual void destroy(const Ice::Current&);
- // XXX Should be private, with SessionFactoryI being a friend. (Or Reaper being a friend, see the other comments.)
- // Return true if the session is destroyed, false otherwise.
- bool destroyed() const;
-
- // XXX Should be private, with SessionFactoryI being a friend. (Or Reaper being a friend, see the other comments.)
- // XXX The name is wrong. It's not a callback, it's a call.
- // XXX Why have this function at all? Why not do whatever this function does directly in destroy()?
- // per-client allocated resources.
- void destroyCallback();
-
private:
- const Ice::ObjectAdapterPtr _adapter; // XXX Get rid of this (you can after all the other XXX's have been fixed).
-
- // XXX Get rid of this. Only the reaper has to know this. It can
- // call a timestamp() function, compare the elapsed time with its
- // _timeout value, and call destroy() and reap if timed out.
+ // Only the ReapThread is interested in the timestamp.
+ friend class ReapThread;
+ IceUtil::Time timestamp() const;
- const IceUtil::Time _timeout; // How long until the session times out.
- bool _destroy; // true if destroy() was called, false otherwise.
+ // Only the session factory can create sessions.
+ friend class SessionFactoryI;
+ SessionI();
- // XXX Rename to _timestamp;
- IceUtil::Time _refreshTime; // The last time the session was refreshed.
+ IceUtil::Time _timestamp; // The last time the session was refreshed.
int _nextId; // The id of the next hello object. This is used for tracing purposes.
std::list< ::Demo::HelloPrx> _objs; // List of per-client allocated Hello objects.
+ bool _destroy;
};
typedef IceUtil::Handle<SessionI> SessionIPtr;