home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iiatree.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  3.2 KB  |  149 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. // ITreeCursorImpl
  20. // ---------------
  21.  
  22. // public members
  23.  
  24. inline
  25. ITreeCursorImpl::
  26. ITreeCursorImpl (IATreeImpl const& tree)
  27. : ivTree (&tree)
  28. {
  29. }
  30.  
  31. inline
  32. ITreeCursorImpl::
  33. ~ITreeCursorImpl ()
  34. {
  35. }
  36.  
  37. inline void const*
  38. ITreeCursorImpl::
  39. Element () const
  40. { return ivTree->ElementAt (*this);
  41. }
  42.  
  43. inline IBoolean
  44. ITreeCursorImpl::
  45. IsFor (IATreeImpl const& tree) const
  46. { return (ivTree == &tree);
  47. }
  48.  
  49. inline IBoolean
  50. ITreeCursorImpl::
  51. SetToChild (IPosition position)
  52. { return ivTree->SetToChild (position, *this);
  53. }
  54.  
  55. inline IBoolean
  56. ITreeCursorImpl::
  57. SetToFirstExistingChild ()
  58. { return ivTree->SetToFirstExistingChild (*this);
  59. }
  60.  
  61. inline IBoolean
  62. ITreeCursorImpl::
  63. SetToLastExistingChild ()
  64. { return ivTree->SetToLastExistingChild (*this);
  65. }
  66.  
  67. inline IBoolean
  68. ITreeCursorImpl::
  69. SetToNextExistingChild ()
  70. { return ivTree->SetToNextExistingChild (*this);
  71. }
  72.  
  73. inline IBoolean
  74. ITreeCursorImpl::
  75. SetToParent ()
  76. { return ivTree->SetToParent (*this);
  77. }
  78.  
  79. inline IBoolean
  80. ITreeCursorImpl::
  81. SetToPreviousExistingChild ()
  82. { return ivTree->SetToPreviousExistingChild (*this);
  83. }
  84.  
  85. inline IBoolean
  86. ITreeCursorImpl::
  87. SetToRoot ()
  88. { return ivTree->SetToRoot (*this);
  89. }
  90.  
  91. inline void
  92. ITreeCursorImpl::
  93. operator= (ITreeCursorImpl const& cursor)
  94. { ivTree = cursor.ivTree;
  95. }
  96.  
  97. inline IBoolean
  98. ITreeCursorImpl::
  99. operator== (ITreeCursorImpl const& cursor) const
  100. { return (ivTree == cursor.ivTree);
  101. }
  102.  
  103. inline IBoolean
  104. ITreeCursorImpl::
  105. operator!= (ITreeCursorImpl const& cursor) const
  106. { return ! operator== (cursor);
  107. }
  108.  
  109. // protected members
  110.  
  111. inline void*
  112. ITreeCursorImpl::
  113. CheckPointer (void* ptr)
  114. { return IATreeImpl::CheckPointer (ptr);
  115. }
  116.  
  117. // ----------
  118. // IATreeImpl
  119. // ----------
  120.  
  121. // public members
  122.  
  123. inline
  124. IATreeImpl::
  125. ~IATreeImpl ()
  126. {
  127. }
  128.  
  129. // protected members
  130.  
  131. inline
  132. IATreeImpl::
  133. IATreeImpl (Ops& ops)
  134. : ivOps (&ops), ivReferenceCount (0)
  135. {
  136. }
  137.  
  138. inline
  139. IATreeImpl::
  140. IATreeImpl (IATreeImpl const&)
  141. { // should never be executed
  142. }
  143.  
  144. inline IATreeImpl::Ops&
  145. IATreeImpl::
  146. OpsOf (IATreeImpl const& tree)
  147. { return *tree.ivOps;
  148. }
  149.