home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iasb.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  4.2 KB  |  146 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. // IASortedBag
  20. // ---
  21.  
  22. template <class Element>
  23. inline
  24. IASortedBag <Element>::
  25. IASortedBag (INotifier& notifier)
  26. { SetImpl ((Implementation*)¬ifier);
  27. }
  28.  
  29. template <class Element>
  30. inline
  31. IASortedBag <Element>::
  32. ~IASortedBag ()
  33. {
  34. }
  35.  
  36. template <class Element>
  37. inline void
  38. IASortedBag <Element>::
  39. addDifference (IASortedBag <Element> const& collection1,
  40.                IASortedBag <Element> const& collection2)
  41. { ImplOf (*this).
  42.     AddDifference (ImplOf (collection1), ImplOf (collection2));
  43. }
  44.  
  45. template <class Element>
  46. inline void
  47. IASortedBag <Element>::
  48. addIntersection (IASortedBag <Element> const& collection1,
  49.                  IASortedBag <Element> const& collection2)
  50. { ImplOf (*this).
  51.     AddIntersection (ImplOf (collection1), ImplOf (collection2));
  52. }
  53.  
  54. template <class Element>
  55. inline void
  56. IASortedBag <Element>::
  57. addUnion (IASortedBag <Element> const& collection1,
  58.           IASortedBag <Element> const& collection2)
  59. { ImplOf (*this).
  60.     AddUnion (ImplOf (collection1), ImplOf (collection2));
  61. }
  62.  
  63. template <class Element>
  64. inline long
  65. IASortedBag <Element>::
  66. compare (IASortedBag <Element> 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>
  73. inline void
  74. IASortedBag <Element>::
  75. differenceWith (IASortedBag <Element> const& collection)
  76. { ImplOf (*this).Difference (ImplOf (collection));
  77. }
  78.  
  79. template <class Element>
  80. inline void
  81. IASortedBag <Element>::
  82. intersectionWith (IASortedBag <Element> const& collection)
  83. { ImplOf (*this).Intersection (ImplOf (collection));
  84. }
  85.  
  86. template <class Element>
  87. inline INumber
  88. IASortedBag <Element>::
  89. numberOfDifferentElements () const
  90. { return ImplOf (*this).NumberOfDifferentElements ();
  91. }
  92.  
  93. template <class Element>
  94. inline IBoolean
  95. IASortedBag <Element>::
  96. setToNextDifferentElement (ICursor& cursor) const
  97. { return ImplOf (*this).SetToNextDifferentElement (CrsrImplOf (cursor));
  98. }
  99.  
  100. template <class Element>
  101. inline void
  102. IASortedBag <Element>::
  103. unionWith (IASortedBag <Element> const& collection)
  104. { ImplOf (*this).Union (ImplOf (collection));
  105. }
  106.  
  107. template <class Element>
  108. inline IBoolean
  109. IASortedBag <Element>::
  110. operator== (IASortedBag <Element> const& collection) const
  111. { return ImplOf (*this).operator== (ImplOf (collection));
  112. }
  113.  
  114. template <class Element>
  115. inline IBoolean
  116. IASortedBag <Element>::
  117. operator!= (IASortedBag <Element> const& collection) const
  118. { return ImplOf (*this).operator!= (ImplOf (collection));
  119. }
  120.  
  121. // protected members
  122.  
  123. template <class Element>
  124. inline
  125. IASortedBag <Element>::
  126. IASortedBag ()
  127. {
  128. }
  129.  
  130. template <class Element>
  131. inline
  132. IASortedBag <Element>::
  133. IASortedBag (IASortedBag <Element> const& collection)
  134. : Inherited (collection)
  135. {
  136. }
  137.  
  138. // private members
  139.  
  140. template <class Element>
  141. inline IASortedBag <Element>::Implementation&
  142. IASortedBag <Element>::
  143. ImplOf (IASortedBag <Element> const& collection)
  144. { return *(Implementation*)collection.ivImpl;
  145. }
  146.