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

/magnus/back_end/global/PureRep.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: PureRep.h,v 1.1.1.1 1995/11/20 17:54:39 rogern Exp $
00003  */
00004 
00005 // Copyright (C) 1994 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Definition of class PureRep
00009 //
00010 /*! Description:
00011 
00012    PureRep is an abstract base class for representations used in
00013    pointer wrapping schemes
00014 
00015  This class is a `pure object representation' class, encapsulating the
00016  reference counter part of the representation. Normally it serves as
00017  the root base of a hierarchy of representations with virtual
00018  functions.
00019 
00020  Usage:
00021 
00022    Use as a private base class of representations wrapped with
00023    BaseObjectOf; make BaseObjectOf a friend; give the class
00024    a protected ctor Class(Rep*) : BaseObjectOf(Rep*)
00025 */
00026 //   @stc needs to be written up better with an example
00027 //   @stc maybe the pointer wrappers should go in a seperate dir with
00028 //   @stc explanations and examples
00029 //
00030 // Principal Author: Stephane Collart
00031 //
00032 // Status: Complete
00033 //
00034 // Bugs:
00035 //
00036 // Revision History:
00037 //
00038 
00039 #ifndef _PURE_REP_H_
00040 #define _PURE_REP_H_
00041 
00042 #include "RefCounter.h"
00043 
00044 
00045 
00046 
00047 struct PureRep : public RefCounter {
00048 
00049 
00050 public :
00051 
00052   /////////////////////////////////////////////////////////////////////////
00053   //                                                                     //
00054   // Constructors                                                        //
00055   //                                                                     //  
00056   /////////////////////////////////////////////////////////////////////////
00057 
00058   // default ctor provided by compiler (initialises ref count)
00059 
00060   // copy ctor provided by compiler (resets ref count)
00061 
00062   virtual ~PureRep( ) { }
00063   /*!< Make the destructor virtual to ensure that each derived representation
00064     gets deleted as what it really is */
00065 
00066   /////////////////////////////////////////////////////////////////////////
00067   //                                                                     //
00068   // Representation Stuff                                                //
00069   //                                                                     //  
00070   /////////////////////////////////////////////////////////////////////////
00071 
00072   virtual PureRep* clone( ) const = 0;
00073   /*!< Returns a pointer to a copy of the object.
00074    Should be implemented as a member which gives a new `deep-copy'
00075    by each representation derived from this; normally, by making it
00076    new CopyConstrutor(*this) with CopyConstructor doing `deep-copy'
00077    (`' because it is enough for the copy constructor to do logical
00078    deep copy). */
00079 
00080 };
00081 
00082 #endif
00083 

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