#ifndef PLISTELEMENT_H #define PLISTELEMENT_H //***************************************************************************** // // PListElement.h // //***************************************************************************** // // Copyright (C) 1996 // // Ronald A. MacCracken // Graduate Student // Computer Science Department // University of California // Davis, CA 95616 // // Permission is granted to use at your own risk and // distribute this software in source and binary forms // provided the above copyright notice and this paragraph // are preserved on all copies. This software is provided // "as is" with no express or implied warranty. // //***************************************************************************** //***************************************************************************** // // NOTE: This class is used solely by the the template PList and PListIterator // classes, and should not be used in application code. // // This class' constructors, like the PList class, creates copies of the // data if a reference is passed, but uses the data if a pointer is passed. // //***************************************************************************** template class PListElement { private: TYPE* data ; PListElement* next ; private: void Copy ( const PListElement& ) ; void Delete ( void ) ; public: // default constructor PListElement ( void ) ; // user-defined constructors PListElement ( TYPE* ) ; // copy constructors PListElement ( const PListElement& ) ; // destructors ~PListElement ( void ) ; // assignment operator PListElement& operator= ( const PListElement& ) ; // return new element with same data PListElement* Get_Copy ( void ) const ; // access functions PListElement* Get_Next ( void ) const { return next ; } TYPE* Get_Data ( void ) { return data ; } const TYPE* Get_Data ( void ) const { return data ; } void Set_Data ( TYPE* d ) { data = d ; } void Set_Next ( PListElement* n ) { next = n ; } // compare data pointers int Compare_Data ( const TYPE* ) const ; } ; #include "PListElement.C" #endif