CC_Dlist.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: CC_Dlist.h /main/5 1996/08/21 15:48:36 drk $ */
  24. #ifndef __CC_Dlist_h
  25. #define __CC_Dlist_h
  26. #include "CC_Listbase.h"
  27. #include "CC_Slist.h"
  28. template <class T> class CC_TPtrDlist;
  29. template <class T> class CC_TPtrDlistIterator;
  30. template <class T>
  31. class CC_TPtrDlist : public CC_TPtrSlist<T>
  32. {
  33. friend class CC_TPtrDlistIterator<T>;
  34. // Inherit all the public/protected members from CC_TPtrSlist<T>
  35. /*
  36. entries();
  37. prepend(T*element);
  38. append(T*element);
  39. insert(T*element);
  40. at(size_t);
  41. removeAt
  42. removeLast
  43. removeFirst
  44. first
  45. last
  46. T *find(const T*)
  47. T *find(Boolean...)
  48. contains
  49. remove
  50. operator CC_Listbase *
  51. */
  52. public:
  53. CC_TPtrDlist(const CC_TPtrDlist<T>&);
  54. CC_TPtrDlist() {}
  55. ~CC_TPtrDlist();
  56. void clear();
  57. virtual void clearAndDestroy();
  58. operator CC_TPtrSlist<T> *() { return(this); }
  59. };
  60. template <class T>
  61. class CC_TPtrDlistIterator : public CC_TPtrSlistIterator<T>
  62. {
  63. /* all the inherited member from CC_TPtrSlistIterator<T> and
  64. * List_Iterator_base...
  65. */
  66. // From CC_TPtrSlistIterator<T>
  67. // T *key() const
  68. // T *operator()()
  69. // Boolean operator++()
  70. // From CC_Listbase_Iterator
  71. // Boolean operator--();
  72. public:
  73. CC_TPtrDlistIterator (CC_TPtrDlist<T> &list)
  74. : CC_TPtrSlistIterator<T>( *((CC_TPtrSlist<T> *)&list) )
  75. { }
  76. CC_Boolean operator+=(size_t n);
  77. };
  78. #ifdef EXPAND_TEMPLATES
  79. #include "CC_Dlist.C"
  80. #endif
  81. #endif /* __CC_Slist_h */
  82. /* DO NOT ADD ANY LINES AFTER THIS #endif */