#ifndef PLISTELEMENT_C #define PLISTELEMENT_C //***************************************************************************** // // PListElement.C // //***************************************************************************** // // 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. // //***************************************************************************** #include "PListElement.h" // // Constructors and Destructors // template PListElement :: PListElement ( void ) : data ( NULL ) , next ( NULL ) { } template PListElement :: PListElement ( TYPE* t ) : data ( t ) , next ( NULL ) { } template PListElement :: PListElement ( const PListElement& e ) { Copy ( e ) ; } template PListElement :: ~PListElement ( void ) { Delete ( ) ; } // // Private Member Functions // template void PListElement :: Copy ( const PListElement& e ) { data = e.data ; next = NULL ; } template void PListElement :: Delete ( void ) { delete data ; delete next ; data = NULL ; next = NULL ; } // // Public Member Functions // template PListElement& PListElement :: operator= ( const PListElement& e ) { if ( this == &e ) return ( *this ) ; Delete ( ) ; Copy ( e ) ; return ( *this ) ; } template PListElement* PListElement :: Get_Copy ( void ) const { return ( new PListElement ( *this ) ) ; } template int PListElement :: Compare_Data ( const TYPE* t ) const { return ( data == t ) ; } #endif