home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iicmap.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  6.6 KB  |  238 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. // ICMapImpl
  25. // ---
  26.  
  27. // public members
  28.  
  29. template <class CInherited>
  30. ICMapImpl <CInherited>::
  31. ICMapImpl (Ops& ops, INumber numberOfElements)
  32. : CInherited (ops, numberOfElements)
  33. {
  34. }
  35.  
  36. template <class CInherited>
  37. ICMapImpl <CInherited>::
  38. ICMapImpl
  39.   (Ops& ops, ICMapImpl <CInherited> const& collection)
  40. : CInherited (ops, collection)
  41. {
  42. }
  43.  
  44. template <class CInherited>
  45. IBoolean
  46. ICMapImpl <CInherited>::
  47. Add (void const* element, ICursorImpl& cursor)
  48. { ICHECK_IsFor      (ClassName (), "Add")
  49.  
  50.   IBoolean hasBeenAdded = CInherited::Add (element, cursor);
  51.   if (! hasBeenAdded)
  52.     ICHECK_Equality (ClassName (), "Add")
  53.   return hasBeenAdded;
  54. }
  55.  
  56. template <class CInherited>
  57. void
  58. ICMapImpl <CInherited>::
  59. AddAllFrom (IACollectionImpl const& collection)
  60. { ICHECK_Identical (ClassName (), "AddAllFrom")
  61.  
  62.   CInherited::AddAllFrom (collection);
  63. }
  64.  
  65. template <class CInherited>
  66. IBoolean
  67. ICMapImpl <CInherited>::
  68. AddOrReplaceElementWithKey (void const* element, ICursorImpl& cursor)
  69. { ICHECK_IsFor (ClassName (), "AddOrReplaceElementWithKey")
  70.  
  71.   return CInherited::AddOrReplaceElementWithKey (element, cursor);
  72. }
  73.  
  74. template <class CInherited>
  75. void*
  76. ICMapImpl <CInherited>::
  77. Any () const
  78. { ICHECK_IsEmpty (ClassName (), "Any")
  79.  
  80.   return CInherited::Any ();
  81. }
  82.  
  83. template <class CInherited>
  84. void*
  85. ICMapImpl <CInherited>::
  86. ElementAt (ICursorImpl const& cursor) const
  87. { ICHECK_IsFor        (ClassName (), "ElementAt")
  88.   ICHECK_IsValid      (ClassName (), "ElementAt")
  89. #if defined (IALL_CHECKS)
  90.   ICHECK_Cursor       (ClassName (), "ElementAt")
  91. #endif
  92.  
  93.   return CInherited::ElementAt (cursor);
  94. }
  95.  
  96. template <class CInherited>
  97. void*
  98. ICMapImpl <CInherited>::
  99. ElementWithKey (void const* key) const
  100. { return CInherited::ElementWithKey (key);
  101. }
  102.  
  103. template <class CInherited>
  104. IBoolean
  105. ICMapImpl <CInherited>::
  106. Locate (void const* element, ICursorImpl& cursor) const
  107. { ICHECK_IsFor (ClassName (), "Locate")
  108.  
  109.   return CInherited::Locate (element, cursor);
  110. }
  111.  
  112. template <class CInherited>
  113. IBoolean
  114. ICMapImpl <CInherited>::
  115. LocateElementWithKey (void const* key, ICursorImpl& cursor) const
  116. { ICHECK_IsFor (ClassName (), "LocateElementWithKey")
  117.  
  118.   return CInherited::LocateElementWithKey (key, cursor);
  119. }
  120.  
  121. template <class CInherited>
  122. IBoolean
  123. ICMapImpl <CInherited>::
  124. LocateNext (void const* element, ICursorImpl& cursor) const
  125. { ICHECK_IsFor   (ClassName (), "LocateNext")
  126.   ICHECK_IsValid (ClassName (), "LocateNext")
  127. #if defined (IALL_CHECKS)
  128.   ICHECK_Cursor  (ClassName (), "LocateNext")
  129. #endif
  130.  
  131.   return CInherited::LocateNext (element, cursor);
  132. }
  133.  
  134. template <class CInherited>
  135. IBoolean
  136. ICMapImpl <CInherited>::
  137. LocateNextElementWithKey (void const* key, ICursorImpl& cursor) const
  138. { ICHECK_IsFor   (ClassName (), "LocateNextElementWithKey")
  139.   ICHECK_IsValid (ClassName (), "LocateNextElementWithKey")
  140. #if defined (IALL_CHECKS)
  141.   ICHECK_Cursor  (ClassName (), "LocateNextElementWithKey")
  142. #endif
  143.  
  144.   return CInherited::LocateNextElementWithKey (key, cursor);
  145. }
  146.  
  147. template <class CInherited>
  148. IBoolean
  149. ICMapImpl <CInherited>::
  150. LocateOrAdd (void const* element, ICursorImpl& cursor)
  151. { ICHECK_IsFor (ClassName (), "LocateOrAdd")
  152.  
  153.   return CInherited::LocateOrAdd (element, cursor);
  154. }
  155.  
  156. template <class CInherited>
  157. IBoolean
  158. ICMapImpl <CInherited>::
  159. LocateOrAddElementWithKey (void const* key, ICursorImpl& cursor)
  160. { ICHECK_IsFor (ClassName (), "LocateOrAddElementWithKey")
  161.  
  162.   return CInherited::LocateOrAddElementWithKey (key, cursor);
  163. }
  164.  
  165. template <class CInherited>
  166. void
  167. ICMapImpl <CInherited>::
  168. RemoveAt (ICursorImpl& cursor)
  169. { ICHECK_IsFor        (ClassName (), "RemoveAt")
  170.   ICHECK_IsValid      (ClassName (), "RemoveAt")
  171. #if defined (IALL_CHECKS)
  172.   ICHECK_Cursor       (ClassName (), "RemoveAt")
  173. #endif
  174.  
  175.   CInherited::RemoveAt (cursor);
  176. }
  177.  
  178. template <class CInherited>
  179. void
  180. ICMapImpl <CInherited>::
  181. ReplaceAt (ICursorImpl const& cursor, void const* element)
  182. { ICHECK_IsFor        (ClassName (), "ReplaceAt")
  183.   ICHECK_IsValid      (ClassName (), "ReplaceAt")
  184. #if defined (IALL_CHECKS)
  185.   ICHECK_Cursor       (ClassName (), "ReplaceAt")
  186. #endif
  187.   ICHECK_Replacement  (ClassName (), "ReplaceAt")
  188.  
  189.   CInherited::ReplaceAt (cursor, element);
  190. }
  191.  
  192. template <class CInherited>
  193. IBoolean
  194. ICMapImpl <CInherited>::
  195. ReplaceElementWithKey (void const* element, ICursorImpl& cursor)
  196. { ICHECK_IsFor (ClassName (), "ReplaceElementWithKey")
  197.  
  198.   return CInherited::ReplaceElementWithKey (element, cursor);
  199. }
  200.  
  201. template <class CInherited>
  202. IBoolean
  203. ICMapImpl <CInherited>::
  204. SetToFirst (ICursorImpl& cursor) const
  205. { ICHECK_IsFor (ClassName (), "SetToFirst")
  206.  
  207.   return CInherited::SetToFirst (cursor);
  208. }
  209.  
  210. template <class CInherited>
  211. IBoolean
  212. ICMapImpl <CInherited>::
  213. SetToNext (ICursorImpl& cursor) const
  214. { ICHECK_IsFor   (ClassName (), "SetToNext")
  215.   ICHECK_IsValid (ClassName (), "SetToNext")
  216. #if defined (IALL_CHECKS)
  217.   ICHECK_Cursor  (ClassName (), "SetToNext")
  218. #endif
  219.  
  220.   return CInherited::SetToNext (cursor);
  221. }
  222.  
  223. template <class CInherited>
  224. IBoolean
  225. ICMapImpl <CInherited>::
  226. SetToNextWithDifferentKey (ICursorImpl& cursor) const
  227. { ICHECK_IsFor        (ClassName (), "SetToNextWithDifferentKey")
  228.   ICHECK_IsValid      (ClassName (), "SetToNextWithDifferentKey")
  229. #if defined (IALL_CHECKS)
  230.   ICHECK_Cursor       (ClassName (), "SetToNextWithDifferentKey")
  231. #endif
  232.  
  233.   return CInherited::SetToNextWithDifferentKey (cursor);
  234. }
  235.  
  236. #pragma info (restore)
  237. #pragma pack ()
  238.