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