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