dlist.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2001 Adrian Thurston <thurston@cs.queensu.ca>
  3. */
  4. /* This file is part of Aapl.
  5. *
  6. * Aapl is free software; you can redistribute it and/or modify it under the
  7. * terms of the GNU Lesser General Public License as published by the Free
  8. * Software Foundation; either version 2.1 of the License, or (at your option)
  9. * any later version.
  10. *
  11. * Aapl is distributed in the hope that it will be useful, but WITHOUT ANY
  12. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with Aapl; if not, write to the Free Software Foundation, Inc., 59
  18. * Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef _AAPL_DLIST_H
  21. #define _AAPL_DLIST_H
  22. #define BASE_EL(name) name
  23. #define DLMEL_TEMPDEF class Element
  24. #define DLMEL_TEMPUSE Element
  25. #define DList DList
  26. /**
  27. * \addtogroup dlist
  28. * @{
  29. */
  30. /**
  31. * \class DList
  32. * \brief Basic doubly linked list.
  33. *
  34. * DList is the standard by-structure list type. This class requires the
  35. * programmer to declare a list element type that has the necessary next and
  36. * previous pointers in it. This can be achieved by inheriting from the
  37. * DListEl class or by simply adding next and previous pointers directly into
  38. * the list element class.
  39. *
  40. * DList does not assume ownership of elements in the list. If the elements
  41. * are known to reside on the heap, the provided empty() routine can be used to
  42. * delete all elements, however the destructor will not call this routine, it
  43. * will simply abandon all the elements. It is up to the programmer to
  44. * explicitly de-allocate items when necessary.
  45. *
  46. * \include ex_dlist.cpp
  47. */
  48. /*@}*/
  49. #include "dlcommon.h"
  50. #undef BASE_EL
  51. #undef DLMEL_TEMPDEF
  52. #undef DLMEL_TEMPUSE
  53. #undef DList
  54. #endif /* _AAPL_DLIST_H */