home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / iogma.idl < prev    next >
Text File  |  1999-02-22  |  6KB  |  149 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/iogma.idl, somp, som2.1 12/26/95 16:56:50 [7/30/96 14:46:53]
  14.  
  15.  
  16.  
  17. #ifndef iogma_idl
  18. #define iogma_idl
  19.  
  20. #include <somp.idl>
  21. #include <somobj.idl>
  22. #include <somperrd.idl>
  23. interface SOMPMediaInterfaceAbstract;
  24. interface SOMPIOGroup;
  25. interface SOMPPersistentId;
  26. interface SOMPPersistentObject;
  27.  
  28. interface SOMPIOGroupMgrAbstract : SOMObject
  29.  
  30. // This is the abstract class for an IO Group Manager object.  An IO Group
  31. // Manager is a class which is used by the Persistent Storage Manager
  32. // (see psm.sc) for storing/restoring persistent objects and groups of
  33. // persistent objects.
  34. //
  35. // An IO Group Manager object is the principle object which knows the
  36. // stored format of a group of objects stored on some media.  The IO
  37. // Group Manager does not know how an individual object is formatted.
  38. // The stored format of an individual object is known only by the
  39. // encoder/decoder for that object. The encoder/decoder for an object
  40. // is invoked by the IO Group Manager.
  41. //
  42. // There may be many IO Group Managers available in the system. The
  43. // IO Group Manager which is used to store a given persistent object is
  44. // determined by the persistent ID (see pid.sc) of that object. The
  45. // class name of the IO Group Manager is part of the persistent ID.
  46.  
  47. {
  48.    void sompNewMediaInterface(in string IOInfo) raises(SOMPError::sompException);
  49. // Gets a new Media Interface for this IO Group Mgr and prepares it
  50. // for I/O.  This method must be called prior to calling any of the
  51. // other methods of this class since other methods rely on the media
  52. // interface.
  53.  
  54.    SOMPMediaInterfaceAbstract sompGetMediaInterface();
  55. // Returns this group's media interface. If sompNewMediaInterface
  56. // has not been called first, this method returns NULL.
  57. // This method also returns NULL after (the last) sompFreeMediaInterface.
  58.  
  59.    void sompFreeMediaInterface();
  60. // Frees this IOGroup Mgr's media interface.
  61.  
  62.    SOMPMediaInterfaceAbstract sompInstantiateMediaInterface();
  63. // Override this if you want to change the MediaInterface
  64. // this IOGroupMananager uses to write out IO Groups.
  65.  
  66.    boolean sompWriteGroup(in SOMPPersistentObject thisPo) raises(SOMPError::sompException);
  67. // Store the object and everything grouped with it or just store
  68. // the object given. It is the choice of the IO Group Mgr implementor.
  69. //
  70. // To store the object and all the others grouped with,
  71. // invoke _sompGetIOGroup(thisPo) to get the group and then
  72. // iterate across the group, storing each object. If a group is
  73. // stored this method must return TRUE.
  74. // Note:
  75. // Only objects in the IO Group which have been marked as "dirty"
  76. // should be stored. (See po.idl for methods to get the state of a
  77. // persistent object.)
  78. //
  79. // If the IO Group Mgr is written to store only the given object,
  80. // this method must return FALSE.
  81. //
  82.  
  83. // OLD INTERFACE...
  84. // void sompWriteGroup(in SOMPIOGroup thisGroup) raises(SOMPError::sompException);
  85.  
  86.    SOMPPersistentObject sompReadGroup(in SOMPPersistentId objectID) raises(SOMPError::sompException);
  87. // At the very least, this method will instantiate the persistent object which
  88. // is specified by the given objectID and return that object. This method
  89. // may be implemented to instantiate all the objects stored in the same group
  90. // as the specified object. It may restore objects and mark them as
  91. // SOMP_STATE_STABLE, however this is typically accomplished via the
  92. // sompReadObjectData.
  93. // The returned object is NULL if an error is encountered and
  94. // an exception is raised.
  95.  
  96. // OLD INTERFACE...
  97. // SOMPIOGroup sompReadGroup(in string IOInfo) raises(SOMPError::sompException);
  98. // Restores the IO Group with the name given in <IOInfo>.
  99. // The instance data of the objects in the IO Group is not read.
  100. // The returned IO Group is NULL if an error is encountered and
  101. // an exception is raised.
  102.  
  103.    void sompReadObjectData(in SOMPPersistentObject thisPo) raises(SOMPError::sompException);
  104. // Read the given persistent object's data from storage.
  105.  
  106.    boolean sompGroupExists(in string IOInfo);
  107. // See if the IO Group with the name given in <IOInfo> exists in persistent
  108. // storage. Returns TRUE if group exists, FALSE otherwise.
  109.  
  110.    boolean sompObjectInGroup(in SOMPPersistentId objectID) raises(SOMPError::sompException);
  111. // See if the persisent object specified by <objectID> is in the group.
  112. // If so, return TRUE, otherwise FALSE.
  113.  
  114.    boolean sompMediaFormatOk(in string mediaFormatName);
  115. // Check to see if the given mediaFormatName is supported by this
  116. // IO Group Manager. If it is, returns TRUE, otherwise returns FALSE.
  117.  
  118.    void sompDeleteObjectFromGroup(in SOMPPersistentId objectID) raises(SOMPError::sompException);
  119. // Delete the persisent object specified by <objectID>.
  120.  
  121. #ifdef __SOMIDL__
  122.  
  123. implementation
  124. {
  125.     callstyle=idl;
  126.     dllname="somp.dll";
  127.  
  128.     releaseorder: sompNewMediaInterface, sompGetMediaInterface,
  129.           sompFreeMediaInterface, sompInstantiateMediaInterface,
  130.           sompWriteGroup, sompReadGroup,
  131.           sompReadObjectData, sompGroupExists,
  132.           sompObjectInGroup, sompMediaFormatOk,
  133.           sompDeleteObjectFromGroup;
  134.  
  135. // Class Modifiers
  136.    majorversion = 2;
  137.    minorversion = 1;
  138.    filestem = iogma;
  139.  
  140. // Method Modifiers
  141.  
  142. };
  143. #endif /* __SOMIDL__ */
  144.  
  145. };
  146.  
  147.  
  148. #endif  /* iogma_idl */
  149.