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

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

Go to the documentation of this file.
00001 /*
00002  *   $Id: TheObjects.h,v 1.6 1999/11/23 20:32:45 bormotov 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 TheObjects
00009 //
00010 // Principal Author: Roger Needham
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 
00017 #ifndef _THEOBJECTS_H_
00018 #define _THEOBJECTS_H_
00019 
00020 
00021 #include "Set.h"
00022 #include "Associations.h"
00023 #include "Chars.h"
00024 
00025 
00026 //---------------------------------------------------------------------------//
00027 //--------------------------- TheObjects ------------------------------------//
00028 //---------------------------------------------------------------------------//
00029 
00030 class TheObjects
00031 {
00032 public:
00033 
00034   /////////////////////////////////////////////////////////////////////////
00035   //                                                                     //
00036   // Constructors:                                                       //
00037   //                                                                     //
00038   /////////////////////////////////////////////////////////////////////////
00039 
00040   // No constructors for this static class.
00041 
00042   /////////////////////////////////////////////////////////////////////////
00043   //                                                                     //
00044   // Accessors:                                                          //
00045   //                                                                     //
00046   /////////////////////////////////////////////////////////////////////////
00047 
00048   static bool isRunning(OID oid);
00049   // True iff oid is the OID of a ComputationManager which is in
00050   // state RUNNING.
00051 
00052   static bool isStalled(OID oid);
00053   // Returns true when no running CM has any ARCs from oid.
00054 
00055 
00056   static SetOf<OID> remove(OID oid);
00057   // Removes and deletes the indicated SMObject, and all of its dependents.
00058   // A bad oid is quietly ignored, for messaging fault-tolerance.
00059   // Returns the dependency closure of oid, i.e., the objects which were
00060   // deleted.
00061 
00062   static SMObject* get(OID oid);
00063   // Returns the SMObject* with the given oid,
00064   // or 0 if there is no such object, for messaging fault-tolerance.
00065   // Used by class SessionManager and class Ctor.
00066 
00067   static SetOf<OID> dependencyClosure(OID oid);
00068   // A bad oid is quietly ignored, for messaging fault-tolerance.
00069 
00070   static Chars name(OID oid);
00071   // Returns name of the object with the given oid
00072  
00073 private:
00074 
00075   /////////////////////////////////////////////////////////////////////////
00076   //                                                                     //
00077   // `Public' Members Touched by Friends:                                //
00078   //                                                                     //
00079   /////////////////////////////////////////////////////////////////////////
00080 
00081   friend class SMObject;
00082   friend class SessionManager;
00083   friend class Ctor;
00084   friend class UnboundedSupervisor;
00085   friend class ResourceManager;
00086   friend class ExtendToHomProblem; //@db temporary hack
00087 
00088   static OID reserveOid( );
00089   // Reserves a place in theObjects for a new SMObject, and returns the index.
00090   // Used by class SMObject to prepare for enrollment.
00091 
00092   static void enroll(SMObject* newObject);
00093   // Used by class SMObject.
00094 
00095   static void passControl( );
00096   // Passes control to a ComputationManager in a fair way.
00097 
00098   static void setName(OID oid, Chars name);
00099   // Changes name of an object
00100 
00101   /////////////////////////////////////////////////////////////////////////
00102   //                                                                     //
00103   // Private Members:                                                    //
00104   //                                                                     //
00105   /////////////////////////////////////////////////////////////////////////
00106 
00107   static void resize(int newLength);
00108   // A helper for expanding theObjects.
00109 
00110   /////////////////////////////////////////////////////////////////////////
00111   //                                                                     //
00112   // Data Members:                                                       //
00113   //                                                                     //
00114   /////////////////////////////////////////////////////////////////////////
00115 
00116   static const int minimumLength = 16;
00117   static int theObjectsLength;
00118   static SMObject** theObjects;
00119 
00120   static int CMToGetControl;
00121   
00122   // keeps a copy of the names of the objects for SM use
00123   static AssociationsOf<OID,Chars>* theNames; 
00124 };
00125 
00126 #endif

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