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