home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Storage / StorPriv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.8 KB  |  134 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        StorPriv.h
  3.  
  4.     Contains:    Private Definition for XMPStorageSystem
  5.  
  6.     Owned by:    Vincent Lo
  7.  
  8.     Copyright:    © 1992 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.     
  12.          <2>     3/15/96    DM        1295410: create list iterators on stack
  13.                                     (avoid mem thrash during purge)
  14.          <6>     5/25/95    jpa        List.h --> LinkList.h [1253324]
  15.          <5>     4/15/95    VL        1240014: ContainerList::Add gets the real
  16.                                     ID from container instead of through a
  17.                                     parameter.
  18.          <4>     9/23/94    VL        1184272: ContainerID is now a sequence of
  19.                                     octets.
  20.          <3>     6/20/94    CC        ODMemoryHeap* changed to ODMemoryHeapID.
  21.          <2>     6/15/94    CC        ODHeap -> ODMemoryHeap.
  22.          <1>      6/1/94    VL        first checked in
  23.  
  24.     To Do:
  25.     In Progress:
  26. */
  27.  
  28. #ifndef _STORPRIV_
  29. #define _STORPRIV_
  30.  
  31. #ifndef _PLFMDEF_
  32. #include "PlfmDef.h"
  33. #endif
  34.  
  35. #ifndef _ODMEMORY_
  36. #include "ODMemory.h"
  37. #endif
  38.  
  39. #ifndef _LINKLIST_
  40. #include "LinkList.h"
  41. #endif
  42.  
  43. #ifndef _BARRAY_
  44. #include <BArray.h>
  45. #endif
  46.  
  47. #ifndef SOM_ODContainer_xh
  48. #include "ODCtr.xh"
  49. #endif
  50.  
  51. //==============================================================================
  52. // Classes defined in this interface
  53. //==============================================================================
  54.  
  55. class ContainerLink;
  56. class ContainerList;
  57. class ContainerListIterator;
  58.  
  59. //==============================================================================
  60. // ContainerLink
  61. //==============================================================================
  62.  
  63. class ContainerLink : public Link {
  64.  
  65. public:
  66.     
  67.     ContainerLink(ODContainer* container)
  68.     {
  69.         fContainer = container;
  70.     }
  71.     ~ContainerLink() {};
  72.     
  73.     ODContainer*    fContainer;
  74. };
  75.  
  76. //==============================================================================
  77. // ContainerList
  78. //==============================================================================
  79.  
  80. class ContainerList
  81. {    
  82.  
  83. public:
  84.  
  85.     ContainerList();
  86.     
  87.     ODVMethod    ~ContainerList();
  88.     
  89.     ODMethod    void Initialize();
  90.     
  91.     ODMethod void Add(ODContainer* container);
  92.     
  93.     ODMethod void Remove(ODContainerID* containerID);
  94.     
  95.     ODMethod ODContainer* Get(ODContainerID* containerID);
  96.  
  97. private:
  98.  
  99.     ODMethod ContainerLink*    GetLink(ODContainerID* containerID);
  100.  
  101.     LinkedList*        fLinkedList;
  102.     ODMemoryHeapID    fHeap;
  103.     
  104. public:    // private by convention
  105.     
  106.     ODMethod    ODMemoryHeapID    GetHeap();
  107.     ODMethod    LinkedList*        GetLinkedList();
  108. };
  109.  
  110. //==============================================================================
  111. // ContainerListIterator
  112. //==============================================================================
  113.  
  114. class ContainerListIterator
  115. {
  116.  
  117. public:
  118.  
  119.     ContainerListIterator(ContainerList* containerList);
  120.     
  121.     ODVMethod    ~ContainerListIterator();
  122.     
  123.     ODMethod    void            Initialize();
  124.     ODMethod    ODContainer*    Last();
  125.     ODMethod    ODContainer*    Previous();
  126.     ODMethod    ODBoolean        IsNotComplete();
  127.     
  128. private:
  129.  
  130.     LinkedListIterator  fIterator;
  131.     ContainerList*        fContainerList;
  132. };
  133.     
  134. #endif    // _STORPRIV_