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

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

Go to the documentation of this file.
00001 /*
00002  *   $Id: SMObject.h,v 1.12 2000/09/26 20:33:02 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: Declarations of class SMObject, and helper IconID
00009 //
00010 // Principal Author: Roger Needham
00011 //
00012 // Status: useable
00013 //
00014 // Revision History:
00015 //
00016 // * EP added:
00017 //
00018 //              static const IconID VectorOfWords;
00019 
00020 
00021 #ifndef _SMOBJECT_H_
00022 #define _SMOBJECT_H_
00023 
00024 
00025 #include "List.h"
00026 #include "FEData.h"
00027 
00028 
00029 //---------------------------------------------------------------------------//
00030 //----------------------------- IconID --------------------------------------//
00031 //---------------------------------------------------------------------------//
00032 
00033 //@rn In separate attributes wrapper?
00034 
00035 class IconID
00036 {
00037 public:
00038 
00039   static const IconID group;
00040   static const IconID subgroup;
00041   static const IconID SetOfWords;
00042   static const IconID VectorOfWords;
00043   static const IconID elt;
00044   static const IconID equation;
00045   static const IconID systemOfEquations;
00046   static const IconID map;
00047   static const IconID homomorphism;
00048   static const IconID permutation;
00049   static const IconID enumerator_object;
00050   static const IconID enumerator_problem;
00051   static const IconID list_object;
00052   static const IconID problem;
00053   static const IconID none;
00054   static const IconID do_not_display;
00055 
00056   bool operator == ( const IconID& ) const;
00057   bool operator != ( const IconID& ) const;
00058 
00059   friend inline ostream& operator << ( ostream& ostr, const IconID& iid ) {
00060          ostr << iid.theName;
00061          return ostr;
00062   }
00063 
00064 private:
00065 
00066   IconID( const char* name ) : theName( name ) { }
00067 
00068   const char* theName;
00069 
00070 };
00071 
00072 
00073 //---------------------------------------------------------------------------//
00074 //---------------------------- SMObject -------------------------------------//
00075 //---------------------------------------------------------------------------//
00076 
00077 
00078 class SMObject : protected FEData
00079 {
00080 public:
00081 
00082   /////////////////////////////////////////////////////////////////////////
00083   //                                                                     //
00084   // Front End Interfacing:                                              //
00085   //                                                                     //
00086   /////////////////////////////////////////////////////////////////////////
00087 
00088   operator OID ( ) const { return theOid; }
00089 
00090   OID oid( ) const { return theOid; }
00091 
00092   virtual const char* typeID( ) const = 0;
00093 
00094   virtual const IconID iconID( ) const = 0;
00095 
00096   virtual void viewStructure(ostream& ostr) const = 0;
00097 
00098   virtual void printProperties(ostream& ostr) const = 0;
00099 
00100   virtual void printDefinition(ostream& ostr) const = 0;
00101 
00102   virtual bool displayInFE( ) const { return true; }
00103 
00104   bool isComputationManager( ) const { return isCM; }
00105   // Used by class TheObjects.
00106 
00107 
00108 protected:
00109 
00110   /////////////////////////////////////////////////////////////////////////
00111   //                                                                     //
00112   // Constructors:                                                       //
00113   //                                                                     //
00114   /////////////////////////////////////////////////////////////////////////
00115 
00116   SMObject(bool is_cm = false);
00117 
00118   virtual ~SMObject( ) { }
00119 
00120   /////////////////////////////////////////////////////////////////////////
00121   //                                                                     //
00122   // `Public' Members Touched by Friends:                                //
00123   //                                                                     //
00124   /////////////////////////////////////////////////////////////////////////
00125 
00126   friend class SessionManager;
00127   friend class TheObjects;
00128   friend class Ctor;
00129   friend class SubordinateBase;
00130   friend class SMFPGroup;
00131   friend class SMSubgroup;
00132   friend class SMWord;
00133   friend class SMMap;
00134   friend class SMMagnusBreakdown;
00135   friend class UnboundedSupervisor;
00136   friend class CheckinMessage;
00137 
00138   virtual void readMessage(istream&) = 0;
00139   // Used by class SessionManager.
00140   //@rn return bool, so overriding fns can use default too?
00141 
00142 
00143 private:
00144 
00145   ListOf<OID> getDependents( ) { return dependents; }
00146   // Used by class TheObjects for deleting dependents.
00147 
00148   void addDependent(OID oid) { dependents.append( oid ); }
00149   // Used by classes Ctor, SubordinateBase, SMFPGroup, UnboundedSupervisor.
00150 
00151   SMObject(const SMObject&);
00152   // Hidden, not to be implemented.
00153 
00154   /////////////////////////////////////////////////////////////////////////
00155   //                                                                     //
00156   // Data Members:                                                       //
00157   //                                                                     //
00158   /////////////////////////////////////////////////////////////////////////
00159 
00160   const OID theOid;
00161 
00162   bool isCM;
00163   // Cheap way to distinguish ComputationManagers from AlgebraicObjects.
00164 
00165   ListOf<OID> dependents;
00166   // The oids of the SMObjects which depend on this one.
00167 };
00168 
00169 #endif

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