home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iamap.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  5.2 KB  |  181 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. // IAMap
  20. // ---
  21.  
  22. template <class Element, class Key>
  23. inline
  24. IAMap <Element, Key>::
  25. IAMap (INotifier& notifier)
  26. { SetImpl ((Implementation*)¬ifier);
  27. }
  28.  
  29. template <class Element, class Key>
  30. inline
  31. IAMap <Element, Key>::
  32. ~IAMap ()
  33. {
  34. }
  35.  
  36. template <class Element, class Key>
  37. inline void
  38. IAMap <Element, Key>::
  39. addDifference (IAMap <Element, Key> const& collection1,
  40.                IAMap <Element, Key> const& collection2)
  41. { ImplOf (*this).
  42.     AddDifference (ImplOf (collection1), ImplOf (collection2));
  43. }
  44.  
  45. template <class Element, class Key>
  46. inline void
  47. IAMap <Element, Key>::
  48. addIntersection (IAMap <Element, Key> const& collection1,
  49.                  IAMap <Element, Key> const& collection2)
  50. { ImplOf (*this).
  51.     AddIntersection (ImplOf (collection1), ImplOf (collection2));
  52. }
  53.  
  54. template <class Element, class Key>
  55. inline void
  56. IAMap <Element, Key>::
  57. addUnion (IAMap <Element, Key> const& collection1,
  58.           IAMap <Element, Key> const& collection2)
  59. { ImplOf (*this).
  60.     AddUnion (ImplOf (collection1), ImplOf (collection2));
  61. }
  62.  
  63. template <class Element, class Key>
  64. inline void
  65. IAMap <Element, Key>::
  66. differenceWith (IAMap <Element, Key> const& collection)
  67. { ImplOf (*this).Difference (ImplOf (collection));
  68. }
  69.  
  70. template <class Element, class Key>
  71. inline void
  72. IAMap <Element, Key>::
  73. intersectionWith (IAMap <Element, Key> const& collection)
  74. { ImplOf (*this).Intersection (ImplOf (collection));
  75. }
  76.  
  77. template <class Element, class Key>
  78. inline void
  79. IAMap <Element, Key>::
  80. unionWith (IAMap <Element, Key> const& collection)
  81. { ImplOf (*this).Union (ImplOf (collection));
  82. }
  83.  
  84. template <class Element, class Key>
  85. inline IBoolean
  86. IAMap <Element, Key>::
  87. operator== (IAMap <Element, Key> const& collection) const
  88. { return ImplOf (*this).operator== (ImplOf (collection));
  89. }
  90.  
  91. template <class Element, class Key>
  92. inline IBoolean
  93. IAMap <Element, Key>::
  94. operator!= (IAMap <Element, Key> const& collection) const
  95. { return ImplOf (*this).operator!= (ImplOf (collection));
  96. }
  97.  
  98. // protected members
  99.  
  100. template <class Element, class Key>
  101. inline
  102. IAMap <Element, Key>::
  103. IAMap ()
  104. {
  105. }
  106.  
  107. template <class Element, class Key>
  108. inline
  109. IAMap <Element, Key>::
  110. IAMap (IAMap <Element, Key> const& collection)
  111. : Inherited (collection)
  112. {
  113. }
  114.  
  115. template <class Element, class Key>
  116. inline IBoolean
  117. IAMap <Element, Key>::
  118. locateNext (Element const& element, ICursor& cursor) const
  119. { return IAEqualityCollection <Element>::locateNext (element, cursor);
  120. }
  121.  
  122. template <class Element, class Key>
  123. inline IBoolean
  124. IAMap <Element, Key>::
  125. locateNextElementWithKey (Key const& key, ICursor& cursor) const
  126. { return IAKeyCollection <Element, Key>::
  127.     locateNextElementWithKey (key, cursor);
  128. }
  129.  
  130. template <class Element, class Key>
  131. inline INumber
  132. IAMap <Element, Key>::
  133. numberOfDifferentKeys () const
  134. { return IAKeyCollection <Element, Key>::numberOfDifferentKeys ();
  135. }
  136.  
  137. template <class Element, class Key>
  138. inline INumber
  139. IAMap <Element, Key>::
  140. numberOfElementsWithKey (Key const& key) const
  141. { return IAKeyCollection <Element, Key>::numberOfElementsWithKey (key);
  142. }
  143.  
  144. template <class Element, class Key>
  145. inline INumber
  146. IAMap <Element, Key>::
  147. numberOfOccurrences (Element const& element) const
  148. { return IAEqualityCollection <Element>::numberOfOccurrences (element);
  149. }
  150.  
  151. template <class Element, class Key>
  152. inline INumber
  153. IAMap <Element, Key>::
  154. removeAllOccurrences (Element const& element)
  155. { return IAEqualityCollection <Element>::removeAllOccurrences (element);
  156. }
  157.  
  158. template <class Element, class Key>
  159. inline INumber
  160. IAMap <Element, Key>::
  161. removeAllElementsWithKey (Key const& key)
  162. { return IAKeyCollection <Element, Key>::removeAllElementsWithKey (key);
  163. }
  164.  
  165. template <class Element, class Key>
  166. inline IBoolean
  167. IAMap <Element, Key>::
  168. setToNextWithDifferentKey (ICursor& cursor) const
  169. { return
  170.     IAKeyCollection <Element, Key>::setToNextWithDifferentKey (cursor);
  171. }
  172.  
  173. // private members
  174.  
  175. template <class Element, class Key>
  176. inline IAMap <Element, Key>::Implementation&
  177. IAMap <Element, Key>::
  178. ImplOf (IAMap <Element, Key> const& collection)
  179. { return *(Implementation*)collection.ivImpl;
  180. }
  181.