home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / iogrp.idl < prev    next >
Text File  |  1999-02-22  |  3KB  |  114 lines

  1. //
  2. //   COMPONENT_NAME: somp
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996 
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13. //#  @(#) 2.9 src/somp/iogrp.idl, somp, som2.1 12/26/95 16:56:06 [7/30/96 14:46:52]
  14.  
  15.  
  16. #ifndef iogrp_idl
  17. #define iogrp_idl
  18.  
  19. #include <somp.idl>
  20. #include <srkset.idl>
  21. interface SOMPPersistentId;
  22. interface SOMPPersistentObject;
  23. interface SOMPIteratorHandle; /* for convenience */
  24.  
  25. interface SOMPIOGroup : SOMPKeyedSet
  26.  
  27. // An IOGroup is a collection of objects which have been grouped
  28. // together with the intention that they will be written/read to/from
  29. // a storage media at the same time. For example, the group of objects
  30. // could be stored in the same file.
  31. //
  32. // Objects are added, located and removed from the group via an integer
  33. // key.
  34. {
  35.    typedef long SOMPIOGroupKey;
  36.  
  37.  
  38.    long sompCount();
  39. // Returns the number of objects in this group
  40.  
  41.    SOMObject sompFirst();
  42. // Returns the first available object in the group. The object returned
  43. // is not based on any ordering, it is simply the one closest at hand.
  44.  
  45.    SOMPIteratorHandle sompNewIterator();
  46. // Returns a handle which can be used with the sompNextObjectInGroup
  47. // method of this class to iterate through all the objects contained
  48. // by an instance of this class.
  49.  
  50.    SOMObject sompNextObjectInGroup(in SOMPIteratorHandle iteratorHandle);
  51. // Return the next object in the group. If there are no more objects left,
  52. // it returns NULL.
  53. //
  54. // Example use:
  55. //
  56. // hit = _sompNewIterator(myGroup)
  57. // while (obj = _sompNextObjectInGroup(hit)) {
  58. //    ...
  59. //    use obj
  60. //    ...
  61. //    }
  62. // _sompFreeIterator(hit);
  63.  
  64.    void sompFreeIterator(in SOMPIteratorHandle iteratorHandle);
  65. // Free the resources used by the given iterator.
  66.  
  67.    void sompAddToGroup(in SOMObject newObject, in SOMPIOGroupKey key);
  68. // Adds the given object to this group of objects. The given key for
  69. // the new object must be unique among all the other objects in
  70. // this group.
  71.  
  72.    SOMObject sompRemoveFromGroup(in SOMPIOGroupKey key);
  73. // Remove from the group and return the object with the given key value.
  74.  
  75.    SOMObject sompFindByKey(in SOMPIOGroupKey key);
  76. // Return the object with the given key value.
  77.  
  78. #ifdef __SOMIDL__
  79.  
  80. implementation
  81. {
  82.   callstyle=idl;
  83.   dllname="somp.dll";
  84.  
  85.   releaseorder: sompGetLastOffset, sompGetNextAvailableOffset,
  86.         sompSetLastOffset, sompFindById,
  87.         sompSetGroupName, sompGetGroupName,
  88.         sompCount,
  89.         sompFirst,
  90.         sompNewIterator,
  91.         sompNextObjectInGroup,
  92.         sompFreeIterator,
  93.         sompAddToGroup,
  94.         sompRemoveFromGroup,
  95.         sompFindByKey;
  96.  
  97. // Class Modifiers
  98.    majorversion = 2;
  99.    minorversion = 1;
  100.    filestem = iogrp;
  101.  
  102.  
  103. // Method Modifiers
  104.    somInit: override;
  105.    somUninit: override;
  106.    somDumpSelfInt: override;
  107.  
  108. };
  109. #endif /* __SOMIDL__ */
  110.  
  111. };
  112.  
  113. #endif  /* iogrp_idl */
  114.