Code Search for Developers
 
 
  

DCell.h from Magnus at Krugle


Show DCell.h syntax highlighted

// Copyright (C) 1994 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.

// Contents: Definition and implementation of utility
//           template <class T> class DCell
//
// DCell is the basic component of externally double linked lists.
//
// Principal Author: Sergey Lyutikov, Roger Needham
//
// Status: Useable.
//
// Revision History:
// 07/96 Alexey M. implemented IPC

#ifndef _DCELL_H_
#define _DCELL_H_

#include <iostream>
#include "IPC.h"

template<class T> class DCell {

public:

  T      contents;
  DCell*  previousCell;
  DCell*  nextCell;
  
  DCell() {nextCell = previousCell = NULL; }  
  DCell(const DCell& C) : contents(C.contents) { 
	nextCell = previousCell = NULL;
  }

  DCell(const T& e, DCell* previous = NULL, DCell* next = NULL) :
	contents(e) {
	previousCell = previous;
	nextCell = next;
  }
  
  ~DCell() { nextCell = previousCell = NULL; } // Compiler ~'s contents.
 
 /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // IPC tools:                                                          //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  friend std::ostream& operator < ( std::ostream& ostr, const DCell& DC )
  {
    ostr < DC.contents;
    return ostr;
  }
  
  friend std::istream& operator > ( std::istream& istr, DCell& DC )
  {
    istr > DC.contents;
    return istr;
  }

};

#endif  // _DCELL_H_




See more files for this project here

Magnus

Magnus is a special purpose mathematical package for Infinite Group Theory computations

Project homepage: http://sourceforge.net/projects/magnus
Programming language(s): C,C++
License: other

  Associations.h
  BTree.h
  BlackBox.h
  Cell.h
  Chars.h
  DArray.h
  DCell.h
  DList.h
  File.h
  GCD.h
  GlobalRandom.h
  IStreamPoll.h
  Int2.h
  List.h
  LogWatcher.h
  MagnusHome.h
  MultiDimArray.h
  QuickAssociations.h
  RandomNumbers.h
  Set.h
  Stack.h
  Timer.h
  Type.h
  Vector.h
  WordParser.h
  conversions.h