container.hh

Go to the documentation of this file.
00001 
00002 #ifndef CONTAINER_HH
00003 #define CONTAINER_HH
00004 
00005 // Copyright (c) 1994-1999 The University of Cincinnati.
00006 // All rights reserved. 
00007 
00008 // UC MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
00009 // THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
00010 // TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
00011 // PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  UC SHALL NOT BE LIABLE
00012 // FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
00013 // RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
00014 // DERIVATIVES.
00015 
00016 // By using or copying this Software, Licensee agrees to abide by the
00017 // intellectual property laws, and all other applicable laws of the
00018 // U.S., and the terms of this license.
00019 
00020 
00021 // You may modify, distribute, and use the software contained in this package
00022 // under the terms of the "GNU LIBRARY GENERAL PUBLIC LICENSE" version 2,
00023 // June 1991. A copy of this license agreement can be found in the file
00024 // "LGPL", distributed with this archive.
00025 
00026 // Authors: Philip A. Wilsey            phil.wilsey@uc.edu
00027 //          Tim McBrayer                tmcbraye@thor.ece.uc.edu
00028 
00029 #ifndef NULL
00030 #define NULL 0
00031 #endif
00032 
00033 // container template class for misc use in lists, queues, and such.
00034 
00035 template <class type>
00036 class container {
00037 
00038 
00039 
00040 
00041 public:
00042   
00043   container() {object = NULL; previous = NULL; next = NULL;};
00044   ~container() {};
00045   
00046   container(type* s) {object = s; previous = NULL; next = NULL;};
00047   
00048   void link_next(container<type>* s) {next = s;};
00049   void link_previous(container<type>* s) {previous = s;};
00050   
00051   container<type>* next_container() {return next;};
00052   container<type>* previous_container() {return previous;};
00053   
00054   type* return_object() {return object;};
00055 
00056 private:
00057   
00058   type* object;
00059   container<type>* previous;
00060   container<type>* next;
00061   
00062 };
00063 
00064 #endif

Generated on Fri Mar 31 11:04:13 2006 for Savant by  doxygen 1.4.6