home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iicsr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  10.2 KB  |  373 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. // ICSortedRelationImpl
  25. // ---
  26.  
  27. // public members
  28.  
  29. template <class CInherited>
  30. ICSortedRelationImpl <CInherited>::
  31. ICSortedRelationImpl (Ops& ops, INumber numberOfElements)
  32. : CInherited (ops, numberOfElements)
  33. {
  34. }
  35.  
  36. template <class CInherited>
  37. ICSortedRelationImpl <CInherited>::
  38. ICSortedRelationImpl
  39.   (Ops& ops, ICSortedRelationImpl <CInherited> const& collection)
  40. : CInherited (ops, collection)
  41. {
  42. }
  43.  
  44. template <class CInherited>
  45. IBoolean
  46. ICSortedRelationImpl <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. ICSortedRelationImpl <CInherited>::
  57. AddAllFrom (IACollectionImpl const& collection)
  58. { ICHECK_Identical (ClassName (), "AddAllFrom")
  59.  
  60.   CInherited::AddAllFrom (collection);
  61. }
  62.  
  63. template <class CInherited>
  64. IBoolean
  65. ICSortedRelationImpl <CInherited>::
  66. AddOrReplaceElementWithKey (void const* element, ICursorImpl& cursor)
  67. { ICHECK_IsFor (ClassName (), "AddOrReplaceElementWithKey")
  68.  
  69.   return CInherited::AddOrReplaceElementWithKey (element, cursor);
  70. }
  71.  
  72. template <class CInherited>
  73. void*
  74. ICSortedRelationImpl <CInherited>::
  75. Any () const
  76. { ICHECK_IsEmpty (ClassName (), "Any")
  77.  
  78.   return CInherited::Any ();
  79. }
  80.  
  81. template <class CInherited>
  82. void*
  83. ICSortedRelationImpl <CInherited>::
  84. ElementAt (ICursorImpl const& cursor) const
  85. { ICHECK_IsFor        (ClassName (), "ElementAt")
  86.   ICHECK_IsValid      (ClassName (), "ElementAt")
  87. #if defined (IALL_CHECKS)
  88.   ICHECK_Cursor       (ClassName (), "ElementAt")
  89. #endif
  90.  
  91.   return CInherited::ElementAt (cursor);
  92. }
  93.  
  94. template <class CInherited>
  95. void*
  96. ICSortedRelationImpl <CInherited>::
  97. ElementAtPosition (IPosition position) const
  98. { ICHECK_Position (ClassName (), "ElementAtPosition")
  99.  
  100.   return CInherited::ElementAtPosition (position);
  101. }
  102.  
  103. template <class CInherited>
  104. void*
  105. ICSortedRelationImpl <CInherited>::
  106. ElementWithKey (void const* key) const
  107. { return CInherited::ElementWithKey (key);
  108. }
  109.  
  110. template <class CInherited>
  111. void*
  112. ICSortedRelationImpl <CInherited>::
  113. First () const
  114. { ICHECK_IsEmpty (ClassName (), "First")
  115.  
  116.   return CInherited::First ();
  117. }
  118.  
  119. template <class CInherited>
  120. IBoolean
  121. ICSortedRelationImpl <CInherited>::
  122. IsFirstAt (ICursorImpl const& cursor) const
  123. { ICHECK_IsFor        (ClassName (), "IsFirstAt")
  124.   ICHECK_IsValid      (ClassName (), "IsFirstAt")
  125. #if defined (IALL_CHECKS)
  126.   ICHECK_Cursor       (ClassName (), "IsFirstAt")
  127. #endif
  128.  
  129.   return CInherited::IsFirstAt (cursor);
  130. }
  131.  
  132. template <class CInherited>
  133. IBoolean
  134. ICSortedRelationImpl <CInherited>::
  135. IsLastAt (ICursorImpl const& cursor) const
  136. { ICHECK_IsFor        (ClassName (), "IsLastAt")
  137.   ICHECK_IsValid      (ClassName (), "IsLastAt")
  138. #if defined (IALL_CHECKS)
  139.   ICHECK_Cursor       (ClassName (), "IsLastAt")
  140. #endif
  141.  
  142.   return CInherited::IsLastAt (cursor);
  143. }
  144.  
  145. template <class CInherited>
  146. void*
  147. ICSortedRelationImpl <CInherited>::
  148. Last () const
  149. { ICHECK_IsEmpty (ClassName (), "Last")
  150.  
  151.   return CInherited::Last ();
  152. }
  153.  
  154. template <class CInherited>
  155. IBoolean
  156. ICSortedRelationImpl <CInherited>::
  157. Locate (void const* element, ICursorImpl& cursor) const
  158. { ICHECK_IsFor (ClassName (), "Locate")
  159.  
  160.   return CInherited::Locate (element, cursor);
  161. }
  162.  
  163. template <class CInherited>
  164. IBoolean
  165. ICSortedRelationImpl <CInherited>::
  166. LocateElementWithKey (void const* key, ICursorImpl& cursor) const
  167. { ICHECK_IsFor (ClassName (), "LocateElementWithKey")
  168.  
  169.   return CInherited::LocateElementWithKey (key, cursor);
  170. }
  171.  
  172. template <class CInherited>
  173. IBoolean
  174. ICSortedRelationImpl <CInherited>::
  175. LocateNext (void const* element, ICursorImpl& cursor) const
  176. { ICHECK_IsFor   (ClassName (), "LocateNext")
  177.   ICHECK_IsValid (ClassName (), "LocateNext")
  178. #if defined (IALL_CHECKS)
  179.   ICHECK_Cursor  (ClassName (), "LocateNext")
  180. #endif
  181.  
  182.   return CInherited::LocateNext (element, cursor);
  183. }
  184.  
  185. template <class CInherited>
  186. IBoolean
  187. ICSortedRelationImpl <CInherited>::
  188. LocateNextElementWithKey (void const* key, ICursorImpl& cursor) const
  189. { ICHECK_IsFor   (ClassName (), "LocateNextElementWithKey")
  190.   ICHECK_IsValid (ClassName (), "LocateNextElementWithKey")
  191. #if defined (IALL_CHECKS)
  192.   ICHECK_Cursor  (ClassName (), "LocateNextElementWithKey")
  193. #endif
  194.  
  195.   return CInherited::LocateNextElementWithKey (key, cursor);
  196. }
  197.  
  198. template <class CInherited>
  199. IBoolean
  200. ICSortedRelationImpl <CInherited>::
  201. LocateOrAdd (void const* element, ICursorImpl& cursor)
  202. { ICHECK_IsFor (ClassName (), "LocateOrAdd")
  203.  
  204.   return CInherited::LocateOrAdd (element, cursor);
  205. }
  206.  
  207. template <class CInherited>
  208. IBoolean
  209. ICSortedRelationImpl <CInherited>::
  210. LocateOrAddElementWithKey (void const* key, ICursorImpl& cursor)
  211. { ICHECK_IsFor (ClassName (), "LocateOrAddElementWithKey")
  212.  
  213.   return CInherited::LocateOrAddElementWithKey (key, cursor);
  214. }
  215.  
  216. template <class CInherited>
  217. IPosition
  218. ICSortedRelationImpl <CInherited>::
  219. PositionAt (ICursorImpl const& cursor) const
  220. { ICHECK_IsFor        (ClassName (), "PositionAt")
  221.   ICHECK_IsValid      (ClassName (), "PositionAt")
  222. #if defined (IALL_CHECKS)
  223.   ICHECK_Cursor       (ClassName (), "PositionAt")
  224. #endif
  225.  
  226.   return CInherited::PositionAt (cursor);
  227. }
  228.  
  229. template <class CInherited>
  230. void
  231. ICSortedRelationImpl <CInherited>::
  232. RemoveAt (ICursorImpl& cursor)
  233. { ICHECK_IsFor        (ClassName (), "RemoveAt")
  234.   ICHECK_IsValid      (ClassName (), "RemoveAt")
  235. #if defined (IALL_CHECKS)
  236.   ICHECK_Cursor       (ClassName (), "RemoveAt")
  237. #endif
  238.  
  239.   CInherited::RemoveAt (cursor);
  240. }
  241.  
  242. template <class CInherited>
  243. void
  244. ICSortedRelationImpl <CInherited>::
  245. RemoveAtPosition (IPosition position)
  246. { ICHECK_Position (ClassName (), "RemoveAtPosition")
  247.  
  248.   CInherited::RemoveAtPosition (position);
  249. }
  250.  
  251. template <class CInherited>
  252. void
  253. ICSortedRelationImpl <CInherited>::
  254. RemoveFirst ()
  255. { ICHECK_IsEmpty (ClassName (), "RemoveFirst")
  256.  
  257.   CInherited::RemoveFirst ();
  258. }
  259.  
  260. template <class CInherited>
  261. void
  262. ICSortedRelationImpl <CInherited>::
  263. RemoveLast ()
  264. { ICHECK_IsEmpty (ClassName (), "RemoveLast")
  265.  
  266.   CInherited::RemoveLast ();
  267. }
  268.  
  269. template <class CInherited>
  270. void
  271. ICSortedRelationImpl <CInherited>::
  272. ReplaceAt (ICursorImpl const& cursor, void const* element)
  273. { ICHECK_IsFor        (ClassName (), "ReplaceAt")
  274.   ICHECK_IsValid      (ClassName (), "ReplaceAt")
  275. #if defined (IALL_CHECKS)
  276.   ICHECK_Cursor       (ClassName (), "ReplaceAt")
  277. #endif
  278.   ICHECK_Replacement  (ClassName (), "ReplaceAt")
  279.  
  280.   CInherited::ReplaceAt (cursor, element);
  281. }
  282.  
  283. template <class CInherited>
  284. void
  285. ICSortedRelationImpl <CInherited>::
  286. ReplaceAtPosition (IPosition position, void const* element)
  287. { ICHECK_Position    (ClassName (), "ReplaceAtPosition")
  288.   ICursorImpl& cursor = CursorOf (*this);
  289.   CInherited::SetToPosition (position, cursor);
  290.   ICHECK_Replacement (ClassName (), "ReplaceAtPosition")
  291.  
  292.   CInherited::ReplaceAtPosition (position, element);
  293. }
  294.  
  295. template <class CInherited>
  296. IBoolean
  297. ICSortedRelationImpl <CInherited>::
  298. ReplaceElementWithKey (void const* element, ICursorImpl& cursor)
  299. { ICHECK_IsFor (ClassName (), "ReplaceElementWithKey")
  300.  
  301.   return CInherited::ReplaceElementWithKey (element, cursor);
  302. }
  303.  
  304. template <class CInherited>
  305. IBoolean
  306. ICSortedRelationImpl <CInherited>::
  307. SetToFirst (ICursorImpl& cursor) const
  308. { ICHECK_IsFor (ClassName (), "SetToFirst")
  309.  
  310.   return CInherited::SetToFirst (cursor);
  311. }
  312.  
  313. template <class CInherited>
  314. IBoolean
  315. ICSortedRelationImpl <CInherited>::
  316. SetToLast (ICursorImpl& cursor) const
  317. { ICHECK_IsFor (ClassName (), "SetToLast")
  318.  
  319.   return CInherited::SetToLast (cursor);
  320. }
  321.  
  322. template <class CInherited>
  323. IBoolean
  324. ICSortedRelationImpl <CInherited>::
  325. SetToNext (ICursorImpl& cursor) const
  326. { ICHECK_IsFor   (ClassName (), "SetToNext")
  327.   ICHECK_IsValid (ClassName (), "SetToNext")
  328. #if defined (IALL_CHECKS)
  329.   ICHECK_Cursor  (ClassName (), "SetToNext")
  330. #endif
  331.  
  332.   return CInherited::SetToNext (cursor);
  333. }
  334.  
  335. template <class CInherited>
  336. IBoolean
  337. ICSortedRelationImpl <CInherited>::
  338. SetToNextWithDifferentKey (ICursorImpl& cursor) const
  339. { ICHECK_IsFor        (ClassName (), "SetToNextWithDifferentKey")
  340.   ICHECK_IsValid      (ClassName (), "SetToNextWithDifferentKey")
  341. #if defined (IALL_CHECKS)
  342.   ICHECK_Cursor       (ClassName (), "SetToNextWithDifferentKey")
  343. #endif
  344.  
  345.   return CInherited::SetToNextWithDifferentKey (cursor);
  346. }
  347.  
  348. template <class CInherited>
  349. void
  350. ICSortedRelationImpl <CInherited>::
  351. SetToPosition (IPosition position, ICursorImpl& cursor) const
  352. { ICHECK_IsFor     (ClassName (), "SetToPosition")
  353.   ICHECK_Position  (ClassName (), "SetToPosition")
  354.  
  355.   CInherited::SetToPosition (position, cursor);
  356. }
  357.  
  358. template <class CInherited>
  359. IBoolean
  360. ICSortedRelationImpl <CInherited>::
  361. SetToPrevious (ICursorImpl& cursor) const
  362. { ICHECK_IsFor   (ClassName (), "SetToPrevious")
  363.   ICHECK_IsValid (ClassName (), "SetToPrevious")
  364. #if defined (IALL_CHECKS)
  365.   ICHECK_Cursor  (ClassName (), "SetToPrevious")
  366. #endif
  367.  
  368.   return CInherited::SetToPrevious (cursor);
  369. }
  370.  
  371. #pragma info (restore)
  372. #pragma pack ()
  373.