home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iicbag.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.0 KB  |  180 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. #include <iiexc.h>
  19.  
  20. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  21. #pragma pack (4)
  22.  
  23. // ---
  24. // ICBagImpl
  25. // ---
  26.  
  27. // public members
  28.  
  29. template <class CInherited>
  30. ICBagImpl <CInherited>::
  31. ICBagImpl (Ops& ops, INumber numberOfElements)
  32. : CInherited (ops, numberOfElements)
  33. {
  34. }
  35.  
  36. template <class CInherited>
  37. ICBagImpl <CInherited>::
  38. ICBagImpl
  39.   (Ops& ops, ICBagImpl <CInherited> const& collection)
  40. : CInherited (ops, collection)
  41. {
  42. }
  43.  
  44. template <class CInherited>
  45. IBoolean
  46. ICBagImpl <CInherited>::
  47. Add (void const* element, ICursorImpl& cursor)
  48. { ICHECK_IsFor      (ClassName (), "Add")
  49.  
  50.   IBoolean hasBeenAdded = CInherited::Add (element, cursor);
  51.   return hasBeenAdded;
  52. }
  53.  
  54. template <class CInherited>
  55. void
  56. ICBagImpl <CInherited>::
  57. AddAllFrom (IACollectionImpl const& collection)
  58. { ICHECK_Identical (ClassName (), "AddAllFrom")
  59.  
  60.   CInherited::AddAllFrom (collection);
  61. }
  62.  
  63. template <class CInherited>
  64. void*
  65. ICBagImpl <CInherited>::
  66. Any () const
  67. { ICHECK_IsEmpty (ClassName (), "Any")
  68.  
  69.   return CInherited::Any ();
  70. }
  71.  
  72. template <class CInherited>
  73. void*
  74. ICBagImpl <CInherited>::
  75. ElementAt (ICursorImpl const& cursor) const
  76. { ICHECK_IsFor        (ClassName (), "ElementAt")
  77.   ICHECK_IsValid      (ClassName (), "ElementAt")
  78. #if defined (IALL_CHECKS)
  79.   ICHECK_Cursor       (ClassName (), "ElementAt")
  80. #endif
  81.  
  82.   return CInherited::ElementAt (cursor);
  83. }
  84.  
  85. template <class CInherited>
  86. IBoolean
  87. ICBagImpl <CInherited>::
  88. Locate (void const* element, ICursorImpl& cursor) const
  89. { ICHECK_IsFor (ClassName (), "Locate")
  90.  
  91.   return CInherited::Locate (element, cursor);
  92. }
  93.  
  94. template <class CInherited>
  95. IBoolean
  96. ICBagImpl <CInherited>::
  97. LocateNext (void const* element, ICursorImpl& cursor) const
  98. { ICHECK_IsFor   (ClassName (), "LocateNext")
  99.   ICHECK_IsValid (ClassName (), "LocateNext")
  100. #if defined (IALL_CHECKS)
  101.   ICHECK_Cursor  (ClassName (), "LocateNext")
  102. #endif
  103.  
  104.   return CInherited::LocateNext (element, cursor);
  105. }
  106.  
  107. template <class CInherited>
  108. IBoolean
  109. ICBagImpl <CInherited>::
  110. LocateOrAdd (void const* element, ICursorImpl& cursor)
  111. { ICHECK_IsFor (ClassName (), "LocateOrAdd")
  112.  
  113.   return CInherited::LocateOrAdd (element, cursor);
  114. }
  115.  
  116. template <class CInherited>
  117. void
  118. ICBagImpl <CInherited>::
  119. RemoveAt (ICursorImpl& cursor)
  120. { ICHECK_IsFor        (ClassName (), "RemoveAt")
  121.   ICHECK_IsValid      (ClassName (), "RemoveAt")
  122. #if defined (IALL_CHECKS)
  123.   ICHECK_Cursor       (ClassName (), "RemoveAt")
  124. #endif
  125.  
  126.   CInherited::RemoveAt (cursor);
  127. }
  128.  
  129. template <class CInherited>
  130. void
  131. ICBagImpl <CInherited>::
  132. ReplaceAt (ICursorImpl const& cursor, void const* element)
  133. { ICHECK_IsFor        (ClassName (), "ReplaceAt")
  134.   ICHECK_IsValid      (ClassName (), "ReplaceAt")
  135. #if defined (IALL_CHECKS)
  136.   ICHECK_Cursor       (ClassName (), "ReplaceAt")
  137. #endif
  138.   ICHECK_Replacement  (ClassName (), "ReplaceAt")
  139.  
  140.   CInherited::ReplaceAt (cursor, element);
  141. }
  142.  
  143. template <class CInherited>
  144. IBoolean
  145. ICBagImpl <CInherited>::
  146. SetToFirst (ICursorImpl& cursor) const
  147. { ICHECK_IsFor (ClassName (), "SetToFirst")
  148.  
  149.   return CInherited::SetToFirst (cursor);
  150. }
  151.  
  152. template <class CInherited>
  153. IBoolean
  154. ICBagImpl <CInherited>::
  155. SetToNext (ICursorImpl& cursor) const
  156. { ICHECK_IsFor   (ClassName (), "SetToNext")
  157.   ICHECK_IsValid (ClassName (), "SetToNext")
  158. #if defined (IALL_CHECKS)
  159.   ICHECK_Cursor  (ClassName (), "SetToNext")
  160. #endif
  161.  
  162.   return CInherited::SetToNext (cursor);
  163. }
  164.  
  165. template <class CInherited>
  166. IBoolean
  167. ICBagImpl <CInherited>::
  168. SetToNextDifferentElement (ICursorImpl& cursor) const
  169. { ICHECK_IsFor        (ClassName (), "SetToNextDifferentElement")
  170.   ICHECK_IsValid      (ClassName (), "SetToNextDifferentElenent")
  171. #if defined (IALL_CHECKS)
  172.   ICHECK_Cursor       (ClassName (), "SetToNextDifferentElement")
  173. #endif
  174.  
  175.   return CInherited::SetToNextDifferentElement (cursor);
  176. }
  177.  
  178. #pragma info (restore)
  179. #pragma pack ()
  180.