home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / fsagm.xh < prev    next >
Text File  |  1999-02-22  |  32KB  |  1,071 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: fsagm.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *    COMPONENT_NAME: somp
  12.  * 
  13.  *    ORIGINS: 27
  14.  * 
  15.  * 
  16.  *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996
  17.  *    All Rights Reserved
  18.  *    Licensed Materials - Property of IBM
  19.  *    US Government Users Restricted Rights - Use, duplication or
  20.  *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  21.  * 
  22.  */
  23.  
  24.  
  25. #ifndef SOM_SOMPAscii_xh
  26. #define SOM_SOMPAscii_xh
  27.  
  28. class SOMPAscii;
  29.  
  30. /*
  31.  *  This is an IO Group Manager which stores groups of objects
  32.  *  to the file system using the media interface SOMPAsciiMediaInterface.
  33.  * 
  34.  *  This IO Group Manager stores non-object data (for example the number
  35.  *  of objects in the group) in ASCII format.
  36.  *  The file is readable but should not be editted.
  37.  */
  38.  
  39. #define SOMPAscii_MajorVersion 2
  40. #define SOMPAscii_MinorVersion 1
  41.  
  42. /* C++ SOM defs */
  43. #include <somcls.xh>
  44. #include <somcm.xh>
  45.  
  46. /* C++ parent defs */
  47. #ifndef SOM_SOMPIOGroupMgrAbstract_xh
  48. #include <iogma.xh>
  49. #endif
  50.  
  51. #ifndef SOMPAscii_API
  52. #define SOMPAscii_API
  53. /*
  54.  * -- The Class API
  55.  */
  56.  
  57. /*
  58.  * Start of bindings for IDL types
  59.  */
  60.  
  61. class SOMClass;
  62. class SOMObject;
  63. class SOMPMediaInterfaceAbstract;
  64. class SOMPIOGroup;
  65. class SOMPPersistentId;
  66. class SOMPPersistentObject;
  67. typedef
  68. struct SOMPAscii_stack_contents {
  69. string  fileName;
  70. long  fileOffset;
  71. } SOMPAscii_stack_contents, SOMPAscii_SOMPTStackContents;
  72. /*
  73.  *  Following structure represents Table of Contents meta-data
  74.  */
  75.  
  76. typedef
  77. struct SOMPAscii_TOC_meta {
  78. unsigned long  numObjects;
  79. long  lastOffset;
  80. } SOMPAscii_TOC_meta, SOMPAscii_SOMPTTOCmeta;
  81. /*
  82.  *  Following structure represents Table of Contents entry data
  83.  */
  84.  
  85. typedef
  86. struct SOMPAscii_TOC_entry {
  87. long  podOffset;
  88. unsigned short  flags;
  89. long  podPos;
  90. long  podLen;
  91. } SOMPAscii_TOC_entry, SOMPAscii_SOMPTTOCentry;
  92.  
  93. #ifndef SOM_DONT_USE_SHORT_NAMES
  94. #ifndef SOMTGD_SOMPTStackContents
  95.     #ifdef SOMPTStackContents
  96.         #undef SOMPTStackContents
  97.         #define SOMTGD_SOMPTStackContents 1
  98.     #else
  99.         #define SOMPTStackContents SOMPAscii_SOMPTStackContents
  100.     #endif /* SOMPTStackContents */
  101. #endif /* SOMTGD_SOMPTStackContents */
  102. #endif /* SOM_DONT_USE_SHORT_NAMES */
  103.  
  104. #ifndef SOM_DONT_USE_SHORT_NAMES
  105. #ifndef SOMTGD_SOMPTTOCmeta
  106.     #ifdef SOMPTTOCmeta
  107.         #undef SOMPTTOCmeta
  108.         #define SOMTGD_SOMPTTOCmeta 1
  109.     #else
  110.         #define SOMPTTOCmeta SOMPAscii_SOMPTTOCmeta
  111.     #endif /* SOMPTTOCmeta */
  112. #endif /* SOMTGD_SOMPTTOCmeta */
  113. #endif /* SOM_DONT_USE_SHORT_NAMES */
  114.  
  115. #ifndef SOM_DONT_USE_SHORT_NAMES
  116. #ifndef SOMTGD_SOMPTTOCentry
  117.     #ifdef SOMPTTOCentry
  118.         #undef SOMPTTOCentry
  119.         #define SOMTGD_SOMPTTOCentry 1
  120.     #else
  121.         #define SOMPTTOCentry SOMPAscii_SOMPTTOCentry
  122.     #endif /* SOMPTTOCentry */
  123. #endif /* SOMTGD_SOMPTTOCentry */
  124. #endif /* SOM_DONT_USE_SHORT_NAMES */
  125.  
  126. /*
  127.  * End of bindings for IDL types.
  128.  */
  129.  
  130. /* A procedure to create the SOMPAscii Class */
  131. SOMEXTERN SOMClass * SOMLINK SOMPAsciiNewClass(
  132.         integer4 majorVersion,
  133.         integer4 minorVersion);
  134.  
  135. /* The API to the SOMPAscii class object, and the methods it introduces. */
  136. SOMEXTERN struct SOMPAsciiClassDataStructure {
  137.     SOMClass *classObject;
  138.     somMToken sompWriteAnObject;
  139.     somMToken sompReadAnObject;
  140.     somMToken sompWriteTOC;
  141.     somMToken sompGroupIsDirty;
  142.     somMToken sompObjectIsDirty;
  143.     somMToken sompFindObjectInGroup;
  144.     somMToken sompSetHeaderLength;
  145.     somMToken sompGetHeaderLength;
  146.     somMToken sompReadTOCOffset;
  147.     somMToken sompWriteTOCOffset;
  148.     somMToken sompReadTOCMeta;
  149.     somMToken sompWriteTOCMeta;
  150.     somMToken sompReadTOCEntry;
  151.     somMToken sompWriteTOCEntry;
  152.     somMToken sompCalcTOCEntryPos;
  153.     somMToken sompCopyGroup;
  154.     somMToken sompCopyObjectData;
  155. } SOMDLINK SOMPAsciiClassData;
  156. #define _SOMPAscii SOMPAsciiClassData.classObject
  157.  
  158. /* The API to parentMtabs for SOMPAscii, and the instance data it introduces. */
  159. SOMEXTERN struct SOMPAsciiCClassDataStructure {
  160.     somMethodTabs parentMtab;
  161.     somDToken              instanceDataToken;
  162. } SOMDLINK SOMPAsciiCClassData;
  163.  
  164. /*
  165.  * -- Typedefs for SOMPAscii Method Procedures
  166.  */
  167. SOMEXTERN {
  168.  
  169. /*
  170.  * -- Typedefs for Reintroduced Wrapper Methods
  171.  */
  172. typedef void   SOMLINK somTP_SOMPAscii_sompNewMediaInterface(SOMPAscii *somSelf, Environment *ev, 
  173.         string IOInfo);
  174. typedef somTP_SOMPAscii_sompNewMediaInterface *somTD_SOMPAscii_sompNewMediaInterface;
  175. typedef SOMPMediaInterfaceAbstract*   SOMLINK somTP_SOMPAscii_sompGetMediaInterface(SOMPAscii *somSelf, Environment *ev);
  176. typedef somTP_SOMPAscii_sompGetMediaInterface *somTD_SOMPAscii_sompGetMediaInterface;
  177. typedef void   SOMLINK somTP_SOMPAscii_sompFreeMediaInterface(SOMPAscii *somSelf, Environment *ev);
  178. typedef somTP_SOMPAscii_sompFreeMediaInterface *somTD_SOMPAscii_sompFreeMediaInterface;
  179. typedef SOMPMediaInterfaceAbstract*   SOMLINK somTP_SOMPAscii_sompInstantiateMediaInterface(SOMPAscii *somSelf, Environment *ev);
  180. typedef somTP_SOMPAscii_sompInstantiateMediaInterface *somTD_SOMPAscii_sompInstantiateMediaInterface;
  181. typedef boolean   SOMLINK somTP_SOMPAscii_sompWriteGroup(SOMPAscii *somSelf, Environment *ev, 
  182.         SOMPPersistentObject* thisPo);
  183. typedef somTP_SOMPAscii_sompWriteGroup *somTD_SOMPAscii_sompWriteGroup;
  184. typedef SOMPPersistentObject*   SOMLINK somTP_SOMPAscii_sompReadGroup(SOMPAscii *somSelf, Environment *ev, 
  185.         SOMPPersistentId* objectID);
  186. typedef somTP_SOMPAscii_sompReadGroup *somTD_SOMPAscii_sompReadGroup;
  187. typedef void   SOMLINK somTP_SOMPAscii_sompReadObjectData(SOMPAscii *somSelf, Environment *ev, 
  188.         SOMPPersistentObject* thisPo);
  189. typedef somTP_SOMPAscii_sompReadObjectData *somTD_SOMPAscii_sompReadObjectData;
  190. typedef boolean   SOMLINK somTP_SOMPAscii_sompGroupExists(SOMPAscii *somSelf, Environment *ev, 
  191.         string IOInfo);
  192. typedef somTP_SOMPAscii_sompGroupExists *somTD_SOMPAscii_sompGroupExists;
  193. typedef boolean   SOMLINK somTP_SOMPAscii_sompObjectInGroup(SOMPAscii *somSelf, Environment *ev, 
  194.         SOMPPersistentId* objectID);
  195. typedef somTP_SOMPAscii_sompObjectInGroup *somTD_SOMPAscii_sompObjectInGroup;
  196. typedef boolean   SOMLINK somTP_SOMPAscii_sompMediaFormatOk(SOMPAscii *somSelf, Environment *ev, 
  197.         string mediaFormatName);
  198. typedef somTP_SOMPAscii_sompMediaFormatOk *somTD_SOMPAscii_sompMediaFormatOk;
  199. typedef void   SOMLINK somTP_SOMPAscii_sompDeleteObjectFromGroup(SOMPAscii *somSelf, Environment *ev, 
  200.         SOMPPersistentId* objectID);
  201. typedef somTP_SOMPAscii_sompDeleteObjectFromGroup *somTD_SOMPAscii_sompDeleteObjectFromGroup;
  202. typedef void   SOMLINK somTP_SOMPAscii_somDefaultInit(SOMPAscii *somSelf, 
  203.         som3InitCtrl* ctrl);
  204. typedef somTP_SOMPAscii_somDefaultInit *somTD_SOMPAscii_somDefaultInit;
  205. typedef void   SOMLINK somTP_SOMPAscii_somDestruct(SOMPAscii *somSelf, 
  206.         octet doFree, 
  207.         som3DestructCtrl* ctrl);
  208. typedef somTP_SOMPAscii_somDestruct *somTD_SOMPAscii_somDestruct;
  209. typedef void   SOMLINK somTP_SOMPAscii_somDefaultCopyInit(SOMPAscii *somSelf, 
  210.         som3InitCtrl* ctrl, 
  211.         SOMObject* fromObj);
  212. typedef somTP_SOMPAscii_somDefaultCopyInit *somTD_SOMPAscii_somDefaultCopyInit;
  213. typedef SOMPAscii*   SOMLINK somTP_SOMPAscii_somDefaultAssign(SOMPAscii *somSelf, 
  214.         som3AssignCtrl* ctrl, 
  215.         SOMObject* fromObj);
  216. typedef somTP_SOMPAscii_somDefaultAssign *somTD_SOMPAscii_somDefaultAssign;
  217. typedef void   SOMLINK somTP_SOMPAscii_somDefaultConstCopyInit(SOMPAscii *somSelf, 
  218.         som3InitCtrl* ctrl, 
  219.         SOMObject* fromObj);
  220. typedef somTP_SOMPAscii_somDefaultConstCopyInit *somTD_SOMPAscii_somDefaultConstCopyInit;
  221. typedef void   SOMLINK somTP_SOMPAscii_somDefaultVCopyInit(SOMPAscii *somSelf, 
  222.         som3InitCtrl* ctrl, 
  223.         SOMObject* fromObj);
  224. typedef somTP_SOMPAscii_somDefaultVCopyInit *somTD_SOMPAscii_somDefaultVCopyInit;
  225. typedef void   SOMLINK somTP_SOMPAscii_somDefaultConstVCopyInit(SOMPAscii *somSelf, 
  226.         som3InitCtrl* ctrl, 
  227.         SOMObject* fromObj);
  228. typedef somTP_SOMPAscii_somDefaultConstVCopyInit *somTD_SOMPAscii_somDefaultConstVCopyInit;
  229. typedef SOMPAscii*   SOMLINK somTP_SOMPAscii_somDefaultConstAssign(SOMPAscii *somSelf, 
  230.         som3AssignCtrl* ctrl, 
  231.         SOMObject* fromObj);
  232. typedef somTP_SOMPAscii_somDefaultConstAssign *somTD_SOMPAscii_somDefaultConstAssign;
  233. typedef SOMPAscii*   SOMLINK somTP_SOMPAscii_somDefaultVAssign(SOMPAscii *somSelf, 
  234.         som3AssignCtrl* ctrl, 
  235.         SOMObject* fromObj);
  236. typedef somTP_SOMPAscii_somDefaultVAssign *somTD_SOMPAscii_somDefaultVAssign;
  237. typedef SOMPAscii*   SOMLINK somTP_SOMPAscii_somDefaultConstVAssign(SOMPAscii *somSelf, 
  238.         som3AssignCtrl* ctrl, 
  239.         SOMObject* fromObj);
  240. typedef somTP_SOMPAscii_somDefaultConstVAssign *somTD_SOMPAscii_somDefaultConstVAssign;
  241. typedef void   SOMLINK somTP_SOMPAscii_somInit(SOMPAscii *somSelf);
  242. typedef somTP_SOMPAscii_somInit *somTD_SOMPAscii_somInit;
  243. typedef void   SOMLINK somTP_SOMPAscii_somFree(SOMPAscii *somSelf);
  244. typedef somTP_SOMPAscii_somFree *somTD_SOMPAscii_somFree;
  245. typedef void   SOMLINK somTP_SOMPAscii_somUninit(SOMPAscii *somSelf);
  246. typedef somTP_SOMPAscii_somUninit *somTD_SOMPAscii_somUninit;
  247. typedef SOMClass*   SOMLINK somTP_SOMPAscii_somGetClass(SOMPAscii *somSelf);
  248. typedef somTP_SOMPAscii_somGetClass *somTD_SOMPAscii_somGetClass;
  249. typedef string   SOMLINK somTP_SOMPAscii_somGetClassName(SOMPAscii *somSelf);
  250. typedef somTP_SOMPAscii_somGetClassName *somTD_SOMPAscii_somGetClassName;
  251. typedef long   SOMLINK somTP_SOMPAscii_somGetSize(SOMPAscii *somSelf);
  252. typedef somTP_SOMPAscii_somGetSize *somTD_SOMPAscii_somGetSize;
  253. typedef boolean   SOMLINK somTP_SOMPAscii_somIsA(SOMPAscii *somSelf, 
  254.         SOMClass* aClassObj);
  255. typedef somTP_SOMPAscii_somIsA *somTD_SOMPAscii_somIsA;
  256. typedef boolean   SOMLINK somTP_SOMPAscii_somIsInstanceOf(SOMPAscii *somSelf, 
  257.         SOMClass* aClassObj);
  258. typedef somTP_SOMPAscii_somIsInstanceOf *somTD_SOMPAscii_somIsInstanceOf;
  259. typedef boolean   SOMLINK somTP_SOMPAscii_somRespondsTo(SOMPAscii *somSelf, 
  260.         somId mId);
  261. typedef somTP_SOMPAscii_somRespondsTo *somTD_SOMPAscii_somRespondsTo;
  262. typedef boolean   SOMLINK somTP_SOMPAscii_somDispatch(SOMPAscii *somSelf, 
  263.         somToken* retValue, 
  264.         somId methodId, 
  265.         va_list ap);
  266. typedef somTP_SOMPAscii_somDispatch *somTD_SOMPAscii_somDispatch;
  267. typedef boolean   SOMLINK somTP_SOMPAscii_somClassDispatch(SOMPAscii *somSelf, 
  268.         SOMClass* clsObj, 
  269.         somToken* retValue, 
  270.         somId methodId, 
  271.         va_list ap);
  272. typedef somTP_SOMPAscii_somClassDispatch *somTD_SOMPAscii_somClassDispatch;
  273. typedef boolean   SOMLINK somTP_SOMPAscii_somCastObj(SOMPAscii *somSelf, 
  274.         SOMClass* cls);
  275. typedef somTP_SOMPAscii_somCastObj *somTD_SOMPAscii_somCastObj;
  276. typedef boolean   SOMLINK somTP_SOMPAscii_somResetObj(SOMPAscii *somSelf);
  277. typedef somTP_SOMPAscii_somResetObj *somTD_SOMPAscii_somResetObj;
  278. typedef void   SOMLINK somTP_SOMPAscii_somDispatchV(SOMPAscii *somSelf, 
  279.         somId methodId, 
  280.         somId descriptor, 
  281.         va_list ap);
  282. typedef somTP_SOMPAscii_somDispatchV *somTD_SOMPAscii_somDispatchV;
  283. typedef long   SOMLINK somTP_SOMPAscii_somDispatchL(SOMPAscii *somSelf, 
  284.         somId methodId, 
  285.         somId descriptor, 
  286.         va_list ap);
  287. typedef somTP_SOMPAscii_somDispatchL *somTD_SOMPAscii_somDispatchL;
  288. typedef void*   SOMLINK somTP_SOMPAscii_somDispatchA(SOMPAscii *somSelf, 
  289.         somId methodId, 
  290.         somId descriptor, 
  291.         va_list ap);
  292. typedef somTP_SOMPAscii_somDispatchA *somTD_SOMPAscii_somDispatchA;
  293. typedef double   SOMLINK somTP_SOMPAscii_somDispatchD(SOMPAscii *somSelf, 
  294.         somId methodId, 
  295.         somId descriptor, 
  296.         va_list ap);
  297. typedef somTP_SOMPAscii_somDispatchD *somTD_SOMPAscii_somDispatchD;
  298. typedef SOMObject*   SOMLINK somTP_SOMPAscii_somPrintSelf(SOMPAscii *somSelf);
  299. typedef somTP_SOMPAscii_somPrintSelf *somTD_SOMPAscii_somPrintSelf;
  300. typedef void   SOMLINK somTP_SOMPAscii_somDumpSelf(SOMPAscii *somSelf, 
  301.         long level);
  302. typedef somTP_SOMPAscii_somDumpSelf *somTD_SOMPAscii_somDumpSelf;
  303. typedef void   SOMLINK somTP_SOMPAscii_somDumpSelfInt(SOMPAscii *somSelf, 
  304.         long level);
  305. typedef somTP_SOMPAscii_somDumpSelfInt *somTD_SOMPAscii_somDumpSelfInt;
  306. }
  307.  
  308. #endif /* SOMPAscii_API */
  309.  
  310.  
  311. /*
  312.  * -- This emitter treats Method Tokens as Thunks by default.
  313.  * -- Use the sc modifier "nothunks" to change this default
  314.  */
  315. #undef somresolve_
  316. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  317.  
  318. /*
  319.  * -- The C++ Wrapper Class for SOMPAscii
  320.  */
  321. class SOMPAscii : public SOMPIOGroupMgrAbstract
  322. {
  323. /*
  324.  *  This is an IO Group Manager which stores groups of objects
  325.  *  to the file system using the media interface SOMPAsciiMediaInterface.
  326.  * 
  327.  *  This IO Group Manager stores non-object data (for example the number
  328.  *  of objects in the group) in ASCII format.
  329.  *  The file is readable but should not be editted.
  330.  */
  331. public:
  332.  
  333. // SOMPAscii::new creates the class object if necessary, and then uses somNewNoInit
  334. // to allocate memory and create the object. Initialization is in ctors.
  335. void *operator new(size_t)
  336. {
  337.    if (!_SOMPAscii) SOMPAsciiNewClass(SOMPAscii_MajorVersion,SOMPAscii_MinorVersion);
  338.    return (void*)
  339.       SOM_Resolve(_SOMPAscii,SOMClass,somNewNoInit)
  340.          ((SOMClass *)((void*)_SOMPAscii));
  341. }
  342.  
  343. // SOMPAscii::delete uses somDestruct.
  344. void operator delete(void * obj)
  345. {
  346.    if (obj && *(void**)obj) {
  347.       SOM_Resolve(obj,SOMObject,somFree)
  348.          ((SOMObject*)obj);
  349.    }
  350. }
  351.  
  352. SOMPAscii& operator=(SOMPAscii& fromObj)
  353. {
  354.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  355.    return *this;
  356. }
  357.  
  358. SOMPAscii()
  359. {
  360.    if (*(void**)this != 
  361.        ((somParentMtabStructPtr)
  362.         (SOMPAsciiCClassData.parentMtab))->mtab)
  363.       return;
  364.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  365. }
  366.  
  367. SOMPAscii(SOMPAscii* fromObj)
  368. {
  369.    if (*(void**)this != 
  370.        ((somParentMtabStructPtr)
  371.         (SOMPAsciiCClassData.parentMtab))->mtab)
  372.       return;
  373.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  374. }
  375.  
  376. #ifdef __IBMCPP__
  377. #pragma info(nocnv,nopar)
  378. #endif
  379. SOMPAscii(const SOMPAscii* fromObj)
  380. {
  381.    if (*(void**)this != 
  382.        ((somParentMtabStructPtr)
  383.         (SOMPAsciiCClassData.parentMtab))->mtab)
  384.       return;
  385.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  386. }
  387. #ifdef __IBMCPP__
  388. #pragma info(restore)
  389. #endif
  390.  
  391.  
  392. /*
  393.  * Reintroduce inherited methods
  394.  */
  395.  
  396. /* method: sompNewMediaInterface */
  397. void   sompNewMediaInterface(Environment *ev, 
  398.         string IOInfo)
  399. {
  400. /*
  401.  *  Gets a new Media Interface for this IO Group Mgr and prepares it
  402.  *  for I/O.  This method must be called prior to calling any of the
  403.  *  other methods of this class since other methods rely on the media
  404.  *  interface.
  405.  */
  406.    SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompNewMediaInterface)
  407.     (this, ev,IOInfo);
  408. }
  409.  
  410.  
  411. /* method: sompGetMediaInterface */
  412. SOMPMediaInterfaceAbstract*   sompGetMediaInterface(Environment *ev)
  413. {
  414. /*
  415.  *  Returns this group's media interface. If sompNewMediaInterface
  416.  *  has not been called first, this method returns NULL.
  417.  *  This method also returns NULL after (the last) sompFreeMediaInterface.
  418.  */
  419.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompGetMediaInterface)
  420.     (this, ev);
  421. }
  422.  
  423.  
  424. /* method: sompFreeMediaInterface */
  425. void   sompFreeMediaInterface(Environment *ev)
  426. {
  427. /*
  428.  *  Frees this IOGroup Mgr's media interface.
  429.  */
  430.    SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompFreeMediaInterface)
  431.     (this, ev);
  432. }
  433.  
  434.  
  435. /* method: sompInstantiateMediaInterface */
  436. SOMPMediaInterfaceAbstract*   sompInstantiateMediaInterface(Environment *ev)
  437. {
  438. /*
  439.  *  Override this if you want to change the MediaInterface
  440.  *  this IOGroupMananager uses to write out IO Groups.
  441.  */
  442.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompInstantiateMediaInterface)
  443.     (this, ev);
  444. }
  445.  
  446.  
  447. /* method: sompWriteGroup */
  448. boolean   sompWriteGroup(Environment *ev, 
  449.         SOMPPersistentObject* thisPo)
  450. {
  451. /*
  452.  *  Store the object and everything grouped with it or just store
  453.  *  the object given. It is the choice of the IO Group Mgr implementor.
  454.  * 
  455.  *  To store the object and all the others grouped with,
  456.  *  invoke _sompGetIOGroup(thisPo) to get the group and then
  457.  *  iterate across the group, storing each object. If a group is
  458.  *  stored this method must return TRUE.
  459.  *  Note:
  460.  *  Only objects in the IO Group which have been marked as "dirty"
  461.  *  should be stored. (See po.idl for methods to get the state of a
  462.  *  persistent object.)
  463.  * 
  464.  *  If the IO Group Mgr is written to store only the given object,
  465.  *  this method must return FALSE.
  466.  * 
  467.  *  OLD INTERFACE...
  468.  *  void sompWriteGroup(in SOMPIOGroup thisGroup) raises(SOMPError::sompException);
  469.  */
  470.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompWriteGroup)
  471.     (this, ev,thisPo);
  472. }
  473.  
  474.  
  475. /* method: sompReadGroup */
  476. SOMPPersistentObject*   sompReadGroup(Environment *ev, 
  477.         SOMPPersistentId* objectID)
  478. {
  479. /*
  480.  *  At the very least, this method will instantiate the persistent object which
  481.  *  is specified by the given objectID and return that object. This method
  482.  *  may be implemented to instantiate all the objects stored in the same group
  483.  *  as the specified object. It may restore objects and mark them as
  484.  *  SOMP_STATE_STABLE, however this is typically accomplished via the
  485.  *  sompReadObjectData.
  486.  *  The returned object is NULL if an error is encountered and
  487.  *  an exception is raised.
  488.  *  OLD INTERFACE...
  489.  *  SOMPIOGroup sompReadGroup(in string IOInfo) raises(SOMPError::sompException);
  490.  *  Restores the IO Group with the name given in <IOInfo>.
  491.  *  The instance data of the objects in the IO Group is not read.
  492.  *  The returned IO Group is NULL if an error is encountered and
  493.  *  an exception is raised.
  494.  */
  495.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompReadGroup)
  496.     (this, ev,objectID);
  497. }
  498.  
  499.  
  500. /* method: sompReadObjectData */
  501. void   sompReadObjectData(Environment *ev, 
  502.         SOMPPersistentObject* thisPo)
  503. {
  504. /*
  505.  *  Read the given persistent object's data from storage.
  506.  */
  507.    SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompReadObjectData)
  508.     (this, ev,thisPo);
  509. }
  510.  
  511.  
  512. /* method: sompGroupExists */
  513. boolean   sompGroupExists(Environment *ev, 
  514.         string IOInfo)
  515. {
  516. /*
  517.  *  See if the IO Group with the name given in <IOInfo> exists in persistent
  518.  *  storage. Returns TRUE if group exists, FALSE otherwise.
  519.  */
  520.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompGroupExists)
  521.     (this, ev,IOInfo);
  522. }
  523.  
  524.  
  525. /* method: sompObjectInGroup */
  526. boolean   sompObjectInGroup(Environment *ev, 
  527.         SOMPPersistentId* objectID)
  528. {
  529. /*
  530.  *  See if the persisent object specified by <objectID> is in the group.
  531.  *  If so, return TRUE, otherwise FALSE.
  532.  */
  533.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompObjectInGroup)
  534.     (this, ev,objectID);
  535. }
  536.  
  537.  
  538. /* method: sompMediaFormatOk */
  539. boolean   sompMediaFormatOk(Environment *ev, 
  540.         string mediaFormatName)
  541. {
  542. /*
  543.  *  Check to see if the given mediaFormatName is supported by this
  544.  *  IO Group Manager. If it is, returns TRUE, otherwise returns FALSE.
  545.  */
  546.    return SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompMediaFormatOk)
  547.     (this, ev,mediaFormatName);
  548. }
  549.  
  550.  
  551. /* method: sompDeleteObjectFromGroup */
  552. void   sompDeleteObjectFromGroup(Environment *ev, 
  553.         SOMPPersistentId* objectID)
  554. {
  555. /*
  556.  *  Delete the persisent object specified by <objectID>.
  557.  */
  558.    SOM_ResolveD(this,SOMPAscii,SOMPIOGroupMgrAbstract,sompDeleteObjectFromGroup)
  559.     (this, ev,objectID);
  560. }
  561.  
  562.  
  563. /* initializer method: somDefaultInit */
  564. void   somDefaultInit(som3InitCtrl* ctrl)
  565. {
  566. /*
  567.  *  A default initializer for a SOM object. Passing a null ctrl
  568.  *  indicates to the receiver that its class is the class of the
  569.  *  object being initialized, whereby the initializer will determine
  570.  *  an appropriate control structure.
  571.  */
  572.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultInit)
  573.     (this,ctrl);
  574. }
  575.  
  576.  
  577. /* method: somDestruct */
  578. void   somDestruct(octet doFree, 
  579.         som3DestructCtrl* ctrl)
  580. {
  581. /*
  582.  *  The default destructor for a SOM object. A nonzero <doFree>
  583.  *  indicates that the object storage should be freed by the
  584.  *  object's class (via somDeallocate) after uninitialization.
  585.  *  As with somDefaultInit, a null ctrl can be passed.
  586.  */
  587.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDestruct)
  588.     (this,doFree,ctrl);
  589. }
  590.  
  591.  
  592. /* initializer method: somDefaultCopyInit */
  593. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  594.         SOMObject* fromObj)
  595. {
  596. /*
  597.  *  A default copy constructor. Use this to make copies of objects for
  598.  *  calling methods with "by-value" argument semantics.
  599.  */
  600.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultCopyInit)
  601.     (this,ctrl,fromObj);
  602. }
  603.  
  604.  
  605. /* method: somDefaultAssign */
  606. SOMPAscii*  somDefaultAssign(som3AssignCtrl* ctrl, 
  607.         SOMObject* fromObj)
  608. {
  609. /*
  610.  *  A default assignment operator. Use this to "assign" the state of one
  611.  *  object to another.
  612.  */
  613.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultAssign)
  614.     (this,ctrl,fromObj);
  615. }
  616.  
  617.  
  618. /* initializer method: somDefaultConstCopyInit */
  619. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  620.         SOMObject* fromObj)
  621. {
  622. /*
  623.  *  A default copy constructor that uses a const fromObj.
  624.  */
  625.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultConstCopyInit)
  626.     (this,ctrl,fromObj);
  627. }
  628.  
  629.  
  630. /* initializer method: somDefaultVCopyInit */
  631. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  632.         SOMObject* fromObj)
  633. {
  634. /*
  635.  *  A default copy constructor that uses a volatile fromObj.
  636.  */
  637.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultVCopyInit)
  638.     (this,ctrl,fromObj);
  639. }
  640.  
  641.  
  642. /* initializer method: somDefaultConstVCopyInit */
  643. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  644.         SOMObject* fromObj)
  645. {
  646. /*
  647.  *  A default copy constructor that uses a const volatile fromObj.
  648.  */
  649.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultConstVCopyInit)
  650.     (this,ctrl,fromObj);
  651. }
  652.  
  653.  
  654. /* method: somDefaultConstAssign */
  655. SOMPAscii*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  656.         SOMObject* fromObj)
  657. {
  658. /*
  659.  *  A default assignment operator that uses a const fromObj.
  660.  */
  661.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultConstAssign)
  662.     (this,ctrl,fromObj);
  663. }
  664.  
  665.  
  666. /* method: somDefaultVAssign */
  667. SOMPAscii*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  668.         SOMObject* fromObj)
  669. {
  670. /*
  671.  *  A default assignment operator that uses a volatile fromObj.
  672.  */
  673.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultVAssign)
  674.     (this,ctrl,fromObj);
  675. }
  676.  
  677.  
  678. /* method: somDefaultConstVAssign */
  679. SOMPAscii*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  680.         SOMObject* fromObj)
  681. {
  682. /*
  683.  *  A default assignment operator that uses a const volatile fromObj.
  684.  */
  685.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somDefaultConstVAssign)
  686.     (this,ctrl,fromObj);
  687. }
  688.  
  689.  
  690. /* method: somInit */
  691. void   somInit()
  692. {
  693. /*
  694.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  695.  */
  696.    SOM_ResolveD(this,SOMPAscii,SOMObject,somInit)
  697.     (this);
  698. }
  699.  
  700.  
  701. /* method: somFree */
  702. void   somFree()
  703. {
  704. /*
  705.  *  Use as directed by framework implementations.
  706.  */
  707.    SOM_ResolveD(this,SOMPAscii,SOMObject,somFree)
  708.     (this);
  709. }
  710.  
  711.  
  712. /* method: somUninit */
  713. void   somUninit()
  714. {
  715. /*
  716.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  717.  */
  718.    SOM_ResolveD(this,SOMPAscii,SOMObject,somUninit)
  719.     (this);
  720. }
  721.  
  722.  
  723. /* method: somGetClass */
  724. SOMClass*   somGetClass()
  725. {
  726. /*
  727.  *  Return the receiver's class.
  728.  */
  729.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somGetClass)
  730.     (this);
  731. }
  732.  
  733.  
  734. /* method: somGetClassName */
  735. string   somGetClassName()
  736. {
  737. /*
  738.  *  Return the name of the receiver's class.
  739.  */
  740.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somGetClassName)
  741.     (this);
  742. }
  743.  
  744.  
  745. /* method: somGetSize */
  746. long   somGetSize()
  747. {
  748. /*
  749.  *  Return the size of the receiver.
  750.  */
  751.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somGetSize)
  752.     (this);
  753. }
  754.  
  755.  
  756. /* method: somIsA */
  757. boolean   somIsA(SOMClass* aClassObj)
  758. {
  759. /*
  760.  *  Returns 1 (true) if the receiver responds to methods
  761.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  762.  */
  763.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somIsA)
  764.     (this,aClassObj);
  765. }
  766.  
  767.  
  768. /* method: somIsInstanceOf */
  769. boolean   somIsInstanceOf(SOMClass* aClassObj)
  770. {
  771. /*
  772.  *  Returns 1 (true) if the receiver is an instance of
  773.  *  <aClassObj> and 0 (false) otherwise.
  774.  */
  775.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somIsInstanceOf)
  776.     (this,aClassObj);
  777. }
  778.  
  779.  
  780. /* method: somRespondsTo */
  781. boolean   somRespondsTo(somId mId)
  782. {
  783. /*
  784.  *  Returns 1 (true) if the indicated method can be invoked
  785.  *  on the receiver and 0 (false) otherwise.
  786.  */
  787.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somRespondsTo)
  788.     (this,mId);
  789. }
  790.  
  791.  
  792. /* va_list method: somDispatch */
  793.  
  794. /*
  795.  *  This method provides a generic, class-specific dispatch mechanism.
  796.  *  It accepts as input <retValue> a pointer to the memory area to be
  797.  *  loaded with the result of dispatching the method indicated by
  798.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  799.  *  on which the method is to be invoked as the first argument.
  800.  */
  801. /* the va_list invocation form */
  802. boolean   SOMPAscii_somDispatch(somToken* retValue, 
  803.         somId methodId, 
  804.         va_list ap)
  805. {return SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatch)
  806.     (this,retValue,methodId,ap);
  807. }
  808.  
  809. /* the varargs invocation form */
  810. boolean   somDispatch(somToken* retValue, 
  811.         somId methodId, 
  812.         ...)
  813. {
  814. /*
  815.  *  This method provides a generic, class-specific dispatch mechanism.
  816.  *  It accepts as input <retValue> a pointer to the memory area to be
  817.  *  loaded with the result of dispatching the method indicated by
  818.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  819.  *  on which the method is to be invoked as the first argument.
  820.  */
  821.    va_list ap;
  822.    va_start(ap, methodId);
  823.    boolean __somResult = 
  824.       SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatch)
  825.     (this,retValue,methodId,ap);
  826.    va_end(ap);
  827.    return __somResult;
  828. }
  829.  
  830.  
  831. /* va_list method: somClassDispatch */
  832.  
  833. /*
  834.  *  Like somDispatch, but method resolution for static methods is done
  835.  *  according to the clsObj instance method table.
  836.  */
  837. /* the va_list invocation form */
  838. boolean   SOMPAscii_somClassDispatch(SOMClass* clsObj, 
  839.         somToken* retValue, 
  840.         somId methodId, 
  841.         va_list ap)
  842. {return SOM_ResolveD(this,SOMPAscii,SOMObject,somClassDispatch)
  843.     (this,clsObj,retValue,methodId,ap);
  844. }
  845.  
  846. /* the varargs invocation form */
  847. boolean   somClassDispatch(SOMClass* clsObj, 
  848.         somToken* retValue, 
  849.         somId methodId, 
  850.         ...)
  851. {
  852. /*
  853.  *  Like somDispatch, but method resolution for static methods is done
  854.  *  according to the clsObj instance method table.
  855.  */
  856.    va_list ap;
  857.    va_start(ap, methodId);
  858.    boolean __somResult = 
  859.       SOM_ResolveD(this,SOMPAscii,SOMObject,somClassDispatch)
  860.     (this,clsObj,retValue,methodId,ap);
  861.    va_end(ap);
  862.    return __somResult;
  863. }
  864.  
  865.  
  866. /* method: somCastObj */
  867. boolean   somCastObj(SOMClass* cls)
  868. {
  869. /*
  870.  *  cast the receiving object to cls (which must be an ancestor of the
  871.  *  objects true class. Returns true on success.
  872.  */
  873.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somCastObj)
  874.     (this,cls);
  875. }
  876.  
  877.  
  878. /* method: somResetObj */
  879. boolean   somResetObj()
  880. {
  881. /*
  882.  *  reset an object to its true class. Returns true always.
  883.  */
  884.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somResetObj)
  885.     (this);
  886. }
  887.  
  888.  
  889. /* va_list method: somDispatchV */
  890.  
  891. /*
  892.  *  Obsolete. Use somDispatch instead.
  893.  */
  894. /* the va_list invocation form */
  895. void   SOMPAscii_somDispatchV(somId methodId, 
  896.         somId descriptor, 
  897.         va_list ap)
  898. {   SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchV)
  899.     (this,methodId,descriptor,ap);
  900. }
  901.  
  902. /* the varargs invocation form */
  903. void   somDispatchV(somId methodId, 
  904.         somId descriptor, 
  905.         ...)
  906. {
  907. /*
  908.  *  Obsolete. Use somDispatch instead.
  909.  */
  910.    va_list ap;
  911.    va_start(ap, descriptor);
  912.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchV)
  913.     (this,methodId,descriptor,ap);
  914.    va_end(ap);
  915. }
  916.  
  917.  
  918. /* va_list method: somDispatchL */
  919.  
  920. /*
  921.  *  Obsolete. Use somDispatch instead.
  922.  */
  923. /* the va_list invocation form */
  924. long   SOMPAscii_somDispatchL(somId methodId, 
  925.         somId descriptor, 
  926.         va_list ap)
  927. {return SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchL)
  928.     (this,methodId,descriptor,ap);
  929. }
  930.  
  931. /* the varargs invocation form */
  932. long   somDispatchL(somId methodId, 
  933.         somId descriptor, 
  934.         ...)
  935. {
  936. /*
  937.  *  Obsolete. Use somDispatch instead.
  938.  */
  939.    va_list ap;
  940.    va_start(ap, descriptor);
  941.    long __somResult = 
  942.       SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchL)
  943.     (this,methodId,descriptor,ap);
  944.    va_end(ap);
  945.    return __somResult;
  946. }
  947.  
  948.  
  949. /* va_list method: somDispatchA */
  950.  
  951. /*
  952.  *  Obsolete. Use somDispatch instead.
  953.  */
  954. /* the va_list invocation form */
  955. void*   SOMPAscii_somDispatchA(somId methodId, 
  956.         somId descriptor, 
  957.         va_list ap)
  958. {return SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchA)
  959.     (this,methodId,descriptor,ap);
  960. }
  961.  
  962. /* the varargs invocation form */
  963. void*   somDispatchA(somId methodId, 
  964.         somId descriptor, 
  965.         ...)
  966. {
  967. /*
  968.  *  Obsolete. Use somDispatch instead.
  969.  */
  970.    va_list ap;
  971.    va_start(ap, descriptor);
  972.    void* __somResult = 
  973.       SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchA)
  974.     (this,methodId,descriptor,ap);
  975.    va_end(ap);
  976.    return __somResult;
  977. }
  978.  
  979.  
  980. /* va_list method: somDispatchD */
  981.  
  982. /*
  983.  *  Obsolete. Use somDispatch instead.
  984.  */
  985. /* the va_list invocation form */
  986. double   SOMPAscii_somDispatchD(somId methodId, 
  987.         somId descriptor, 
  988.         va_list ap)
  989. {return SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchD)
  990.     (this,methodId,descriptor,ap);
  991. }
  992.  
  993. /* the varargs invocation form */
  994. double   somDispatchD(somId methodId, 
  995.         somId descriptor, 
  996.         ...)
  997. {
  998. /*
  999.  *  Obsolete. Use somDispatch instead.
  1000.  */
  1001.    va_list ap;
  1002.    va_start(ap, descriptor);
  1003.    double __somResult = 
  1004.       SOM_ResolveD(this,SOMPAscii,SOMObject,somDispatchD)
  1005.     (this,methodId,descriptor,ap);
  1006.    va_end(ap);
  1007.    return __somResult;
  1008. }
  1009.  
  1010.  
  1011. /* method: somPrintSelf */
  1012. SOMObject*   somPrintSelf()
  1013. {
  1014. /*
  1015.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  1016.  *  information about this object.  The default implementation just gives
  1017.  *  the object's class name and its address in memory.
  1018.  *  <self> is returned.
  1019.  */
  1020.    return SOM_ResolveD(this,SOMPAscii,SOMObject,somPrintSelf)
  1021.     (this);
  1022. }
  1023.  
  1024.  
  1025. /* method: somDumpSelf */
  1026. void   somDumpSelf(long level)
  1027. {
  1028. /*
  1029.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  1030.  *  and its current state.
  1031.  * 
  1032.  *  <level> indicates the nesting level for describing compound objects
  1033.  *  it must be greater than or equal to zero.  All lines in the
  1034.  *  description will be preceeded by <2*level> spaces.
  1035.  * 
  1036.  *  This routine only actually writes the data that concerns the object
  1037.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  1038.  *  the object's current state.  This approach allows readable
  1039.  *  descriptions of compound objects to be constructed.
  1040.  * 
  1041.  *  Generally it is not necessary to override this method, if it is
  1042.  *  overriden it generally must be completely replaced.
  1043.  */
  1044.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDumpSelf)
  1045.     (this,level);
  1046. }
  1047.  
  1048.  
  1049. /* method: somDumpSelfInt */
  1050. void   somDumpSelfInt(long level)
  1051. {
  1052. /*
  1053.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  1054.  *  Generally this method will need to be overridden.  When overriding
  1055.  *  it, begin by calling the parent class form of this method and then
  1056.  *  write in a description of your class's instance data. This will
  1057.  *  result in a description of all the object's instance data going
  1058.  *  from its root ancestor class to its specific class.
  1059.  */
  1060.    SOM_ResolveD(this,SOMPAscii,SOMObject,somDumpSelfInt)
  1061.     (this,level);
  1062. }
  1063.  
  1064.  
  1065.  
  1066. };   /* SOMPAscii */
  1067.  
  1068.  
  1069.  
  1070. #endif       /* SOM_SOMPAscii_xh */
  1071.