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

/magnus/back_end/global/BaseObjectOf.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: BaseObjectOf.h,v 1.1.1.1 1995/11/20 17:54:39 rogern 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: A representation pointer wrapper
00009 //
00010 // Principal Author: Stephane Collart
00011 //
00012 // Status: Complete
00013 //
00014 // Description:
00015 //
00016 // Usage:
00017 //
00018 //   @stc see comments in PureRep
00019 //
00020 // Revision History:
00021 //
00022 
00023 #ifndef _BASE_OBJECT_OF_H_
00024 #define _BASE_OBJECT_OF_H_
00025 
00026 
00027 #include "PureRep.h"
00028 #include "ObjectOf.h"
00029 
00030 
00031 template<class Rep> class BaseObjectOf : private ObjectOf<Rep>
00032 {
00033 
00034 //!< This assumes that Rep is derived from PureRep
00035 
00036 public:
00037 
00038   /////////////////////////////////////////////////////////////////////////
00039   //                                                                     //
00040   // Constructors                                                        //
00041   //                                                                     //  
00042   /////////////////////////////////////////////////////////////////////////
00043 
00044   // copy constructor provided by compiler
00045 
00046   // destructor provided by compiler
00047 
00048   /////////////////////////////////////////////////////////////////////////
00049   //                                                                     //
00050   // Conventional Operators                                              //
00051   //                                                                     //  
00052   /////////////////////////////////////////////////////////////////////////
00053 
00054   // assignment operator provided by compiler
00055 
00056 protected:
00057 
00058   /////////////////////////////////////////////////////////////////////////
00059   //                                                                     //
00060   // Representation Handles                                              //
00061   //                                                                     //  
00062   /////////////////////////////////////////////////////////////////////////
00063 
00064   // Inherited from base; adjust access:
00065   ObjectOf<Rep>::look;
00066   ObjectOf<Rep>::change;
00067   ObjectOf<Rep>::enhance;
00068   ObjectOf<Rep>::acquireRep;
00069 
00070   /////////////////////////////////////////////////////////////////////////
00071   //                                                                     //
00072   // Special Constructors                                                //
00073   //                                                                     //  
00074   /////////////////////////////////////////////////////////////////////////
00075 
00076   BaseObjectOf( Rep* newrep ) : ObjectOf<Rep>( newrep) { }
00077 
00078 private:
00079 
00080   /////////////////////////////////////////////////////////////////////////
00081   //                                                                     //
00082   // Safety:                                                             //
00083   //                                                                     //  
00084   /////////////////////////////////////////////////////////////////////////
00085 
00086         // Dummy Forcing Member:
00087 
00088         void force_derivation( ) { const PureRep* rc = look(); }
00089         /*!< With this member PureRep is forced to be an accessible base class of Rep*/
00090 
00091 };
00092 
00093 #endif
00094 

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