home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / STORPRIV.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  4KB  |  162 lines

  1. /* @(#)Z 1.3 com/src/storage/StorPriv.h, odstorage, od96os2, odos29646d 96/11/15 15:29:27 (96/07/15 18:23:39) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odstorage
  6.  *
  7.  *   CLASSES:   ContainerLink
  8.  *        ContainerList
  9.  *        ContainerListIterator
  10.  *
  11.  *   ORIGINS: 82,27
  12.  *
  13.  *
  14.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  15.  *   All Rights Reserved
  16.  *   Licensed Materials - Property of IBM
  17.  *   US Government Users Restricted Rights - Use, duplication or
  18.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  19.  *       
  20.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  21.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  23.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  24.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  25.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  26.  *   OR PERFORMANCE OF THIS SOFTWARE.
  27.  */
  28. /*====END_GENERATED_PROLOG========================================
  29.  */
  30. /*
  31.     File:        StorPriv.h
  32.  
  33.     Contains:    Private Definition for XMPStorageSystem
  34.  
  35.     Owned by:    Vincent Lo
  36.  
  37.     Copyright:    ⌐ 1992 - 1995 by Apple Computer, Inc., all rights reserved.
  38.  
  39.     Change History (most recent first):
  40.     
  41.          <6>     5/25/95    jpa        List.h --> LinkList.h [1253324]
  42.          <5>     4/15/95    VL        1240014: ContainerList::Add gets the real
  43.                                     ID from container instead of through a
  44.                                     parameter.
  45.          <4>     9/23/94    VL        1184272: ContainerID is now a sequence of
  46.                                     octets.
  47.          <3>     6/20/94    CC        ODMemoryHeap* changed to ODMemoryHeapID.
  48.          <2>     6/15/94    CC        ODHeap -> ODMemoryHeap.
  49.          <1>      6/1/94    VL        first checked in
  50.  
  51.     To Do:
  52.     In Progress:
  53. */
  54.  
  55. #ifndef _STORPRIV_
  56. #define _STORPRIV_
  57.  
  58. #ifndef _PLFMDEF_
  59. #include "PlfmDef.h"
  60. #endif
  61.  
  62. #ifndef _ODMEMORY_
  63. #include "ODMemory.h"
  64. #endif
  65.  
  66. #ifndef _LINKLIST_
  67. #include "LinkList.h"
  68. #endif
  69.  
  70. #ifndef _BARRAY_
  71. #include <BArray.h>
  72. #endif
  73.  
  74. #ifndef SOM_ODContainer_xh
  75. #include "ODCtr.xh"
  76. #endif
  77.  
  78. //==============================================================================
  79. // Classes defined in this interface
  80. //==============================================================================
  81.  
  82. class ContainerLink;
  83. class ContainerList;
  84. class ContainerListIterator;
  85.  
  86. //==============================================================================
  87. // ContainerLink
  88. //==============================================================================
  89.  
  90. class ContainerLink : public Link {
  91.  
  92. public:
  93.     
  94.     ContainerLink(ODContainer* container)
  95.     {
  96.         fContainer = container;
  97.     }
  98.     ~ContainerLink() {};
  99.     
  100.     ODContainer*    fContainer;
  101. };
  102.  
  103. //==============================================================================
  104. // ContainerList
  105. //==============================================================================
  106.  
  107. class ContainerList
  108. {    
  109.  
  110. public:
  111.  
  112.     ContainerList();
  113.     
  114.     ODVMethod    ~ContainerList();
  115.     
  116.     ODMethod    void Initialize();
  117.     
  118.     ODMethod void Add(ODContainer* container);
  119.     
  120.     ODMethod void Remove(ODContainerID* containerID);
  121.     
  122.     ODMethod ODContainer* Get(ODContainerID* containerID);
  123.  
  124. private:
  125.  
  126.     ODMethod ContainerLink*    GetLink(ODContainerID* containerID);
  127.  
  128.     LinkedList*        fLinkedList;
  129.     ODMemoryHeapID    fHeap;
  130.     
  131. public:    // private by convention
  132.     
  133.     ODMethod    ODMemoryHeapID    GetHeap();
  134.     ODMethod    LinkedList*        GetLinkedList();
  135. };
  136.  
  137. //==============================================================================
  138. // ContainerListIterator
  139. //==============================================================================
  140.  
  141. class ContainerListIterator
  142. {
  143.  
  144. public:
  145.  
  146.     ContainerListIterator(ContainerList* containerList);
  147.     
  148.     ODVMethod    ~ContainerListIterator();
  149.     
  150.     ODMethod    void            Initialize();
  151.     ODMethod    ODContainer*    Last();
  152.     ODMethod    ODContainer*    Previous();
  153.     ODMethod    ODBoolean        IsNotComplete();
  154.     
  155. private:
  156.  
  157.     LinkedListIterator* fIterator;
  158.     ContainerList*        fContainerList;
  159. };
  160.     
  161. #endif    // _STORPRIV_
  162.