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

/magnus/back_end/general/include/DCell.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: DCell.h,v 1.2 1996/08/20 22:58:45 alex 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 and implementation of utility
00009 //           template <class T> class DCell
00010 //
00011 // DCell is the basic component of externally double linked lists.
00012 //
00013 // Principal Author: Sergey Lyutikov, Roger Needham
00014 //
00015 // Status: Useable.
00016 //
00017 // Revision History:
00018 // 07/96 Alexey M. implemented IPC
00019 
00020 #ifndef _DCELL_H_
00021 #define _DCELL_H_
00022 
00023 #include <iostream.h>
00024 #include "IPC.h"
00025 
00026 template<class T> class DCell {
00027 
00028 public:
00029 
00030   T      contents;
00031   DCell*  previousCell;
00032   DCell*  nextCell;
00033   
00034   DCell() {nextCell = previousCell = NULL; }  
00035   DCell(const DCell& C) : contents(C.contents) { 
00036         nextCell = previousCell = NULL;
00037   }
00038 
00039   DCell(const T& e, DCell* previous = NULL, DCell* next = NULL) :
00040         contents(e) {
00041         previousCell = previous;
00042         nextCell = next;
00043   }
00044   
00045   ~DCell() { nextCell = previousCell = NULL; } // Compiler ~'s contents.
00046  
00047  /////////////////////////////////////////////////////////////////////////
00048   //                                                                     //
00049   // IPC tools:                                                          //
00050   //                                                                     //
00051   /////////////////////////////////////////////////////////////////////////
00052 
00053   friend ostream& operator < ( ostream& ostr, const DCell& DC )
00054   {
00055     ostr < DC.contents;
00056     return ostr;
00057   }
00058   
00059   friend istream& operator > ( istream& istr, DCell& DC )
00060   {
00061     istr > DC.contents;
00062     return istr;
00063   }
00064 
00065 };
00066 
00067 #endif  // _DCELL_H_

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