home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osr1.exe / src / FrFaItr.cpp < prev    next >
C/C++ Source or Header  |  1997-03-21  |  6KB  |  182 lines

  1. /* @(#)Z 1.6 com/src/layout/FrFaItr.cpp, odlayout, od96os2, odos29712d 97/03/21 17:18:27 (96/07/15 18:32:20) */
  2. //====START_GENERATED_PROLOG======================================
  3. //
  4. //
  5. //   COMPONENT_NAME: odlayout
  6. //
  7. //   CLASSES: none
  8. //
  9. //   ORIGINS: 82,27
  10. //
  11. //
  12. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13. //   All Rights Reserved
  14. //   Licensed Materials - Property of IBM
  15. //   US Government Users Restricted Rights - Use, duplication or
  16. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17. //       
  18. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24. //   OR PERFORMANCE OF THIS SOFTWARE.
  25. //
  26. //====END_GENERATED_PROLOG========================================
  27. //
  28. /*
  29.    File:       FrFaItr.cpp
  30.  
  31.    Contains:   Implementation of class ODFrameFacetIterator
  32.  
  33.    Owned by:   Joshua Susser
  34.  
  35.    Copyright:  ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  36.  
  37.    Change History (most recent first):
  38.  
  39.         <6>      8/7/95    JBS     1260631added ASSERT for frame in Init
  40.         <5>      8/3/95    RR      #1257260: Collapse B classes. Remove
  41.                                    somInit methods. Don't call IsInitialized
  42.                                    or SubclassResponsibility
  43.         <4>     5/26/95    RR      #1251403: Multithreading naming support
  44.         <3>      5/2/95    JBS     1244569 Layout iterators need SOM exception
  45.                                    handling; 1243361 FrameFacetIterator should
  46.                                    throw kODErrIteratorNotInitialized
  47.         <2>     4/27/95    JBS     1209506 $5 comments eliminated
  48.         <1>     6/29/94    JBS     first checked in
  49.         <0>     6/28/94    SV      SOMverted
  50. */
  51.  
  52. #define ODFrameFacetIterator_Class_Source
  53.  
  54. #ifndef SOM_ODFrameFacetIterator_xih
  55. #define VARIABLE_MACROS
  56. #include <FrFaItr.xih>
  57. #endif
  58.  
  59. #ifndef _EXCEPT_
  60. #include <Except.h>
  61. #endif
  62.  
  63. #ifndef _ODMEMORY_
  64. #include <ODMemory.h>
  65. #endif
  66.  
  67. #ifndef _ODTYPES_
  68. #include <ODTypes.h>
  69. #endif
  70.  
  71. #ifndef _ORDCOLL_
  72. #include <OrdColl.h>
  73. #endif
  74.  
  75. #ifndef SOM_ODFrame_xh
  76. #include <Frame.xh>
  77. #endif
  78.  
  79. #ifdef _PLATFORM_MACINTOSH_
  80. #pragma segment ODFrFaItr
  81. #endif
  82.  
  83. #ifndef _ODDEBUG_
  84. #include <ODDebug.h>
  85. #endif
  86.  
  87. #ifdef _FACET_DEBUG_
  88. #include <qprintf.h>
  89. #endif
  90.  
  91. SOM_Scope void  SOMLINK ODFrameFacetIteratorsomUninit(ODFrameFacetIterator *somSelf)
  92. {
  93.     ODFrameFacetIteratorData *somThis = ODFrameFacetIteratorGetData(somSelf);
  94.     ODFrameFacetIteratorMethodDebug("ODFrameFacetIterator","somUninit");
  95.  
  96. #ifdef _FACET_DEBUG_
  97.     qprintf("Executing ODFrameFacetIterator::somUninit()\n");
  98. #endif
  99.    delete _fIter;
  100.  
  101.     ODFrameFacetIterator_parents_somUninit(somSelf);
  102.  
  103. }
  104.  
  105. SOM_Scope void  SOMLINK ODFrameFacetIteratorInitFrameFacetIterator(ODFrameFacetIterator *somSelf, Environment *ev,
  106.        ODFrame* frame)
  107. {
  108.     ODFrameFacetIteratorData *somThis = ODFrameFacetIteratorGetData(somSelf);
  109.     ODFrameFacetIteratorMethodDebug("ODFrameFacetIterator","InitFrameFacetIterator");
  110.  
  111. #ifdef _FACET_DEBUG_
  112.     qprintf("Executing ODFrameFacetIterator::InitFrameFacetIterator()\n");
  113. #endif
  114.    SOM_TRY
  115.        ASSERT(frame, kODErrIllegalNullFrameInput);
  116.  
  117.        /* Moved from somInit. SOM itself sets fields to zero
  118.        _fFrame = kODNULL;
  119.        _fIter = kODNULL;
  120.        */
  121.        somSelf->InitObject(ev);
  122.  
  123.        _fFrame = frame;
  124.    SOM_CATCH_ALL
  125.    SOM_ENDTRY
  126. }
  127.  
  128. SOM_Scope ODFacet*  SOMLINK ODFrameFacetIteratorFirst(ODFrameFacetIterator *somSelf, Environment *ev)
  129. {
  130.     ODFrameFacetIteratorData *somThis = ODFrameFacetIteratorGetData(somSelf);
  131.     ODFrameFacetIteratorMethodDebug("ODFrameFacetIterator","First");
  132.  
  133. #ifdef _FACET_DEBUG_
  134.     qprintf("Executing ODFrameFacetIterator::First()\n");
  135. #endif
  136.    SOM_TRY
  137.        if ( !_fIter )
  138.            _fIter = new OrderedCollectionIterator(_fFrame->GetFacets(ev));
  139.        THROW_IF_NULL(_fIter);
  140.  
  141.        return (ODFacet*) _fIter->First();
  142.    SOM_CATCH_ALL
  143.    SOM_ENDTRY
  144.    return kODNULL;
  145. }
  146.  
  147. SOM_Scope ODFacet*  SOMLINK ODFrameFacetIteratorNext(ODFrameFacetIterator *somSelf, Environment *ev)
  148. {
  149.     ODFrameFacetIteratorData *somThis = ODFrameFacetIteratorGetData(somSelf);
  150.     ODFrameFacetIteratorMethodDebug("ODFrameFacetIterator","Next");
  151.  
  152. #ifdef _FACET_DEBUG_
  153.     qprintf("Executing ODFrameFacetIterator::Next()\n");
  154. #endif
  155.    SOM_TRY
  156.        if ( !_fIter )
  157.            THROW(kODErrIteratorNotInitialized);
  158.  
  159.        return (ODFacet*) _fIter->Next();
  160.    SOM_CATCH_ALL
  161.    SOM_ENDTRY
  162.    return kODNULL;
  163. }
  164.  
  165. SOM_Scope ODBoolean  SOMLINK ODFrameFacetIteratorIsNotComplete(ODFrameFacetIterator *somSelf, Environment *ev)
  166. {
  167.     ODFrameFacetIteratorData *somThis = ODFrameFacetIteratorGetData(somSelf);
  168.     ODFrameFacetIteratorMethodDebug("ODFrameFacetIterator","IsNotComplete");
  169.  
  170. #ifdef _FACET_DEBUG_
  171.     qprintf("Executing ODFrameFacetIterator::IsNotComplete()\n");
  172. #endif
  173.    SOM_TRY
  174.        if ( !_fIter )
  175.            THROW(kODErrIteratorNotInitialized);
  176.  
  177.        return _fIter->IsNotComplete();
  178.    SOM_CATCH_ALL
  179.    SOM_ENDTRY
  180.    return kODNULL;
  181. }
  182.