home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iiacllct.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  4.2 KB  |  184 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. // ICursorImpl
  20. // -----------
  21.  
  22. // public members
  23.  
  24. inline
  25. ICursorImpl::
  26. ICursorImpl (IACollectionImpl const& collection)
  27. : ivCollection (&collection)
  28. {
  29. }
  30.  
  31. inline
  32. ICursorImpl::
  33. ~ICursorImpl ()
  34. {
  35. }
  36.  
  37. inline void const*
  38. ICursorImpl::
  39. Element () const
  40. { return ivCollection->ElementAt (*this);
  41. }
  42.  
  43. inline IBoolean
  44. ICursorImpl::
  45. IsFor (IACollectionImpl const& collection) const
  46. { return (ivCollection == &collection);
  47. }
  48.  
  49. inline IPosition
  50. ICursorImpl::
  51. Position () const
  52. { return ivCollection->PositionAt (*this);
  53. }
  54.  
  55. inline IBoolean
  56. ICursorImpl::
  57. SetToFirst ()
  58. { return ivCollection->SetToFirst (*this);
  59. }
  60.  
  61. inline IBoolean
  62. ICursorImpl::
  63. SetToLast ()
  64. { return ivCollection->SetToLast (*this);
  65. }
  66.  
  67. inline IBoolean
  68. ICursorImpl::
  69. SetToNext ()
  70. { return ivCollection->SetToNext (*this);
  71. }
  72.  
  73. inline void
  74. ICursorImpl::
  75. SetToPosition (IPosition position)
  76. { ivCollection->SetToPosition (position, *this);
  77. }
  78.  
  79. inline IBoolean
  80. ICursorImpl::
  81. SetToPrevious ()
  82. { return ivCollection->SetToPrevious (*this);
  83. }
  84.  
  85. inline IBoolean
  86. ICursorImpl::
  87. operator== (ICursorImpl const& cursor) const
  88. { return (ivCollection == cursor.ivCollection);
  89. }
  90.  
  91. inline IBoolean
  92. ICursorImpl::
  93. operator!= (ICursorImpl const& cursor) const
  94. { return ! operator== (cursor);
  95. }
  96.  
  97. // protected members
  98.  
  99. inline void*
  100. ICursorImpl::
  101. CheckPointer (void* ptr)
  102. { return IACollectionImpl::CheckPointer (ptr);
  103. }
  104.  
  105. // ----------------
  106. // IACollectionImpl
  107. // ----------------
  108.  
  109. // public members
  110.  
  111. inline IBoolean
  112. IACollectionImpl::
  113. Add (void const* element)
  114. { return Add (element, *ivDummyCursor);
  115. }
  116.  
  117. inline void
  118. IACollectionImpl::
  119. AddAsFirst (void const* element)
  120. { AddAsFirst (element, CursorOf (*this));
  121. }
  122.  
  123. inline void
  124. IACollectionImpl::
  125. AddAsLast (void const* element)
  126. { AddAsLast (element, CursorOf (*this));
  127. }
  128.  
  129. inline void
  130. IACollectionImpl::
  131. AddAtPosition (IPosition position, void const* element)
  132. { AddAtPosition (position, element, CursorOf (*this));
  133. }
  134.  
  135. inline IBoolean
  136. IACollectionImpl::
  137. AddOrReplaceElementWithKey (void const* element)
  138. { return AddOrReplaceElementWithKey (element, CursorOf (*this));
  139. }
  140.  
  141. inline IBoolean
  142. IACollectionImpl::
  143. Contains (void const* element) const
  144. { return Locate (element, CursorOf (*this));
  145. }
  146.  
  147. inline IBoolean
  148. IACollectionImpl::
  149. LocateOrAdd (void const* element)
  150. { return LocateOrAdd (element, CursorOf (*this));
  151. }
  152.  
  153. inline IBoolean
  154. IACollectionImpl::
  155. LocateOrAddElementWithKey (void const* element)
  156. { return LocateOrAddElementWithKey (element, CursorOf (*this));
  157. }
  158.  
  159. inline IBoolean
  160. IACollectionImpl::
  161. ReplaceElementWithKey (void const* element)
  162. { return ReplaceElementWithKey (element, CursorOf (*this));
  163. }
  164.  
  165. // protected members
  166.  
  167. inline
  168. IACollectionImpl::
  169. IACollectionImpl (IACollectionImpl const&)
  170. { // should never be executed
  171. }
  172.  
  173. inline ICursorImpl&
  174. IACollectionImpl::
  175. CursorOf (IACollectionImpl const& collection)
  176. { return *collection.ivDummyCursor;
  177. }
  178.  
  179. inline IACollectionImpl::Ops&
  180. IACollectionImpl::
  181. OpsOf (IACollectionImpl const& collection)
  182. { return *collection.ivOps;
  183. }
  184.