home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iaset.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  3.9 KB  |  144 lines

  1. /**********************************************************************
  2. *                                                                     *
  3. *  IBM(R) VisualAge(TM) for C++ for Windows(R), Version 3.5           *
  4. *                                                                     *
  5. *  PID: 5622-880                                                      *
  6. *  - Licensed Material - Program-Property of IBM                      *
  7. *  (C) Copyright IBM Corp. 1991, 1995 - All Right Reserved.           *
  8. *                                                                     *
  9. *  US Government Users Restricted Rights - Use, duplication or        *
  10. *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  *
  11. *                                                                     *
  12. *  VisualAge, and IBM are trademarks or registered trademarks of      *
  13. *  International Business Machines Corporation.                       *
  14. *  Windows is a registered trademark of Microsoft Corporation.        *
  15. *                                                                     *
  16. **********************************************************************/
  17.  
  18. // ---
  19. // IASet
  20. // ---
  21.  
  22. template <class Element>
  23. inline
  24. IASet <Element>::
  25. IASet (INotifier& notifier)
  26. { SetImpl ((Implementation*)¬ifier);
  27. }
  28.  
  29. template <class Element>
  30. inline
  31. IASet <Element>::
  32. ~IASet ()
  33. {
  34. }
  35.  
  36. template <class Element>
  37. inline void
  38. IASet <Element>::
  39. addDifference (IASet <Element> const& collection1,
  40.                IASet <Element> const& collection2)
  41. { ImplOf (*this).
  42.     AddDifference (ImplOf (collection1), ImplOf (collection2));
  43. }
  44.  
  45. template <class Element>
  46. inline void
  47. IASet <Element>::
  48. addIntersection (IASet <Element> const& collection1,
  49.                  IASet <Element> const& collection2)
  50. { ImplOf (*this).
  51.     AddIntersection (ImplOf (collection1), ImplOf (collection2));
  52. }
  53.  
  54. template <class Element>
  55. inline void
  56. IASet <Element>::
  57. addUnion (IASet <Element> const& collection1,
  58.           IASet <Element> const& collection2)
  59. { ImplOf (*this).
  60.     AddUnion (ImplOf (collection1), ImplOf (collection2));
  61. }
  62.  
  63. template <class Element>
  64. inline void
  65. IASet <Element>::
  66. differenceWith (IASet <Element> const& collection)
  67. { ImplOf (*this).Difference (ImplOf (collection));
  68. }
  69.  
  70. template <class Element>
  71. inline void
  72. IASet <Element>::
  73. intersectionWith (IASet <Element> const& collection)
  74. { ImplOf (*this).Intersection (ImplOf (collection));
  75. }
  76.  
  77. template <class Element>
  78. inline void
  79. IASet <Element>::
  80. unionWith (IASet <Element> const& collection)
  81. { ImplOf (*this).Union (ImplOf (collection));
  82. }
  83.  
  84. template <class Element>
  85. inline IBoolean
  86. IASet <Element>::
  87. operator== (IASet <Element> const& collection) const
  88. { return ImplOf (*this).operator== (ImplOf (collection));
  89. }
  90.  
  91. template <class Element>
  92. inline IBoolean
  93. IASet <Element>::
  94. operator!= (IASet <Element> const& collection) const
  95. { return ImplOf (*this).operator!= (ImplOf (collection));
  96. }
  97.  
  98. // protected members
  99.  
  100. template <class Element>
  101. inline
  102. IASet <Element>::
  103. IASet ()
  104. {
  105. }
  106.  
  107. template <class Element>
  108. inline
  109. IASet <Element>::
  110. IASet (IASet <Element> const& collection)
  111. : Inherited (collection)
  112. {
  113. }
  114.  
  115. template <class Element>
  116. inline IBoolean
  117. IASet <Element>::
  118. locateNext (Element const& element, ICursor& cursor) const
  119. { return IAEqualityCollection <Element>::locateNext (element, cursor);
  120. }
  121.  
  122. template <class Element>
  123. inline INumber
  124. IASet <Element>::
  125. numberOfOccurrences (Element const& element) const
  126. { return IAEqualityCollection <Element>::numberOfOccurrences (element);
  127. }
  128.  
  129. template <class Element>
  130. inline INumber
  131. IASet <Element>::
  132. removeAllOccurrences (Element const& element)
  133. { return IAEqualityCollection <Element>::removeAllOccurrences (element);
  134. }
  135.  
  136. // private members
  137.  
  138. template <class Element>
  139. inline IASet <Element>::Implementation&
  140. IASet <Element>::
  141. ImplOf (IASet <Element> const& collection)
  142. { return *(Implementation*)collection.ivImpl;
  143. }
  144.