avlbasic.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright 2002 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_AVLBASIC_H
  21. #define _AAPL_AVLBASIC_H
  22. #include "compare.h"
  23. /**
  24. * \addtogroup avltree
  25. * @{
  26. */
  27. /**
  28. * \class AvlBasic
  29. * \brief AVL Tree in which the entire element structure is the key.
  30. *
  31. * AvlBasic is an AVL tree that does not distinguish between the element that
  32. * it contains and the key. The entire element structure is the key that is
  33. * used to compare the relative ordering of elements. This is similar to the
  34. * BstSet structure.
  35. *
  36. * AvlBasic does not assume ownership of elements in the tree. Items must be
  37. * explicitly de-allocated.
  38. */
  39. /*@}*/
  40. #define BASE_EL(name) name
  41. #define BASEKEY(name) name
  42. #define AVLMEL_CLASSDEF class Element, class Compare
  43. #define AVLMEL_TEMPDEF class Element, class Compare
  44. #define AVLMEL_TEMPUSE Element, Compare
  45. #define AvlTree AvlBasic
  46. #define AVL_BASIC
  47. #include "avlcommon.h"
  48. #undef BASE_EL
  49. #undef BASEKEY
  50. #undef AVLMEL_CLASSDEF
  51. #undef AVLMEL_TEMPDEF
  52. #undef AVLMEL_TEMPUSE
  53. #undef AvlTree
  54. #undef AVL_BASIC
  55. #endif /* _AAPL_AVLBASIC_H */