Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/magnus/back_end/SessionManager/include/SessionManager.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: SessionManager.h,v 1.5 2001/03/01 00:06:42 alex Exp $
00003  */
00004  
00005 // Copyright (C) 1995 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 //
00008 // Contents: Declaration of class SessionManager
00009 //
00010 // Principal Author: Roger Needham
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 
00017 
00018 #ifndef _SESSIONMANAGER_H_
00019 #define _SESSIONMANAGER_H_
00020 
00021 #include <iostream.h>
00022 #include "ObjectSmith.h"
00023 #include "OutMessages.h"
00024 
00025 
00026 //---------------------------------------------------------------------------//
00027 //------------------------- SessionManager ----------------------------------//
00028 //---------------------------------------------------------------------------//
00029 
00030 class SessionManager
00031 {
00032 public:
00033 
00034   /////////////////////////////////////////////////////////////////////////
00035   //                                                                     //
00036   // Constructors:                                                       //
00037   //                                                                     //
00038   /////////////////////////////////////////////////////////////////////////
00039 
00040   // No constructors for this static class.
00041 
00042   /////////////////////////////////////////////////////////////////////////
00043   //                                                                     //
00044   // Outgoing Messages:                                                  //
00045   //                                                                     //
00046   /////////////////////////////////////////////////////////////////////////
00047 
00048   static OID getObjectSmithOid( ) { return objectSmithOid; }
00049 
00050 
00051 private:
00052 
00053   /////////////////////////////////////////////////////////////////////////
00054   //                                                                     //
00055   // Restricted Access:                                                  //
00056   //                                                                     //
00057   /////////////////////////////////////////////////////////////////////////
00058 
00059   friend int main(int argc, char* argv[]);
00060 
00061   static void start( );
00062   static void initializeFrontEnd( );
00063   static bool areMessages( );
00064   static void readMessages( );
00065   static void readMessage(istream& istr);
00066   static void takeControl( );
00067 
00068   /////////////////////////////////////////////////////////////////////////
00069   //                                                                     //
00070   // Data Members:                                                       //
00071   //                                                                     //
00072   /////////////////////////////////////////////////////////////////////////
00073 
00074   // SessionManager dispatches incoming messages.
00075   // Generic message handling could be implemented with a class
00076   // MessageHandler, which would provide `mailbox ids' and automatic
00077   // registration for its derivates in the same way class SMObject
00078   // provides object ids.
00079   // But the recipient of a message can now only be a SMObject, or one
00080   // of the special cases: SessionManager, ObjectSmith.
00081   // So for now we assign `pseudo' object ids to the latter, and use
00082   // ordinary object ids for the `mailbox ids'.
00083   // Class SMObject provides a message reading interface.
00084 
00085   static const int sessionManagerOid = -1;
00086   static const int objectSmithOid = -2;
00087   static const int databaseManagerOid = -3;
00088   static const int randomDefnGeneratorOid = -4;
00089   // Some messages are handled by SessionManager directly. These are
00090   // the message tags:
00091 
00092   enum MessageTag { QUIT, DELETE, SET_NAME };
00093 
00094   static const long magicCookie;
00095   // Will be used for low-rent message authentication.
00096 
00097   static bool quitRequested;
00098 };
00099 
00100 #endif

Generated at Tue Jun 19 09:49:38 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001