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

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: replicbl.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *    COMPONENT_NAME: somr
  12.  * 
  13.  *    ORIGINS: 27
  14.  * 
  15.  * 
  16.  *    10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  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_SOMRReplicbl_xh
  26. #define SOM_SOMRReplicbl_xh
  27.  
  28. class SOMRReplicbl;
  29.  
  30. /*
  31.  *  This class provides a link to the Replication Framework. Any class derived
  32.  *  from this class can have instances that are replicated in other address
  33.  *  spaces.  To get the ability to replicate, the derived
  34.  *  class has to abide by the following rules (these rules are binding on
  35.  *  further derivations and contained (constituent) subobjects as well):
  36.  * 
  37.  *     1. It must obtain a replica lock before updating its data and must
  38.  *        release the same after the update. (i.e., The update methods
  39.  *        must bracket their code in a (somrLock, somrReleaseNPropagateUpdate)
  40.  *        pair or a (somrLockNLogOp, somrReleaseNPropagateOperation) pair.)
  41.  *     2. If after obtaining the replica lock, if the object decides to abort
  42.  *        an update operation, it must call the appropriate abort method.
  43.  *        (somrReleaseLockNAbortOp or somrReleaseLockNAbortUpdate)
  44.  *     3. In case value logging is used, it must have an update language in which
  45.  *        changes in the state of the object can be described.
  46.  *     4. In case value logging is used, it must provide a method to receive and
  47.  *        interpret update messages propagated by other replicas. (i.e., Must implement
  48.  *        somrApplyUpdates method. When there are subobjects, this implementation
  49.  *        should call them to interpret the updates appropriate to them.)
  50.  *     5. It must have methods to get and set the complete state of the object (including
  51.  *        any subobjects). (i.e., Must provide implementations for somrGetState
  52.  *        and somrSetState.)
  53.  *     6. It should be able to receive and interpret data replication
  54.  *        directives (e.g., "LOST_CONNECTION", "BECOME_STAND_ALONE", etc. )
  55.  */
  56.  
  57. #define SOMRReplicbl_MajorVersion 2
  58. #define SOMRReplicbl_MinorVersion 1
  59.  
  60. /*
  61.  * Passthru lines: File: "C.xh", "before"
  62.  */
  63. #include <somrerrd.xh>
  64.  
  65. /* C++ SOM defs */
  66. #include <somcls.xh>
  67. #include <somcm.xh>
  68.  
  69. /* C++ parent defs */
  70. #ifndef SOM_SOMRNameable_xh
  71. #include <nameable.xh>
  72. #endif
  73. #ifndef SOM_SOMRLinearizable_xh
  74. #include <linear.xh>
  75. #endif
  76.  
  77. #ifndef SOMRReplicbl_API
  78. #define SOMRReplicbl_API
  79. /*
  80.  * -- The Class API
  81.  */
  82.  
  83. /*
  84.  * Start of bindings for IDL types
  85.  */
  86.  
  87. class SOMClass;
  88. class SOMObject;
  89. class SOFTRepmgrAB;
  90. class Set;
  91.  
  92. /*
  93.  * End of bindings for IDL types.
  94.  */
  95.  
  96. /* A procedure to create the SOMRReplicbl Class */
  97. SOMEXTERN SOMClass * SOMLINK SOMRReplicblNewClass(
  98.         integer4 majorVersion,
  99.         integer4 minorVersion);
  100.  
  101. /* The API to the SOMRReplicbl class object, and the methods it introduces. */
  102. SOMEXTERN struct SOMRReplicblClassDataStructure {
  103.     SOMClass *classObject;
  104.     somMToken somrLock;
  105.     somMToken somrLockNlogOp;
  106.     somMToken somrReleaseNPropagateUpdate;
  107.     somMToken somrReleaseLockNAbortUpdate;
  108.     somMToken somrReleaseNPropagateOperation;
  109.     somMToken somrReleaseLockNAbortOp;
  110.     somMToken somrSendDirective;
  111.     somMToken somrGetSavePermit;
  112.     somMToken somrRepInit;
  113.     somMToken somrRepUninit;
  114.     somMToken somrApplyUpdates;
  115.     somMToken somrDoDirective;
  116.     somMToken somrPin;
  117.     somMToken somrUnPin;
  118.     somMToken somrGetSecurityPolicy;
  119. } SOMDLINK SOMRReplicblClassData;
  120. #define _SOMRReplicbl SOMRReplicblClassData.classObject
  121.  
  122. /* The API to parentMtabs for SOMRReplicbl, and the instance data it introduces. */
  123. SOMEXTERN struct SOMRReplicblCClassDataStructure {
  124.     somMethodTabs parentMtab;
  125.     somDToken              instanceDataToken;
  126. } SOMDLINK SOMRReplicblCClassData;
  127.  
  128. /*
  129.  * -- Typedefs for SOMRReplicbl Method Procedures
  130.  */
  131. SOMEXTERN {
  132. typedef void   SOMLINK somTP_SOMRReplicbl_somrLock(SOMRReplicbl *somSelf, Environment *ev);
  133. typedef somTP_SOMRReplicbl_somrLock *somTD_SOMRReplicbl_somrLock;
  134. typedef void   SOMLINK somTP_SOMRReplicbl_somrLockNlogOp(SOMRReplicbl *somSelf, Environment *ev, 
  135.         string ClassName, 
  136.         string MthdName, 
  137.         va_list ap);
  138. typedef somTP_SOMRReplicbl_somrLockNlogOp *somTD_SOMRReplicbl_somrLockNlogOp;
  139. typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseNPropagateUpdate(SOMRReplicbl *somSelf, Environment *ev, 
  140.         string clsname, 
  141.         string buf, 
  142.         long len, 
  143.         long intOid);
  144. typedef somTP_SOMRReplicbl_somrReleaseNPropagateUpdate *somTD_SOMRReplicbl_somrReleaseNPropagateUpdate;
  145. typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseLockNAbortUpdate(SOMRReplicbl *somSelf, Environment *ev);
  146. typedef somTP_SOMRReplicbl_somrReleaseLockNAbortUpdate *somTD_SOMRReplicbl_somrReleaseLockNAbortUpdate;
  147. typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseNPropagateOperation(SOMRReplicbl *somSelf, Environment *ev);
  148. typedef somTP_SOMRReplicbl_somrReleaseNPropagateOperation *somTD_SOMRReplicbl_somrReleaseNPropagateOperation;
  149. typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseLockNAbortOp(SOMRReplicbl *somSelf, Environment *ev);
  150. typedef somTP_SOMRReplicbl_somrReleaseLockNAbortOp *somTD_SOMRReplicbl_somrReleaseLockNAbortOp;
  151. typedef long   SOMLINK somTP_SOMRReplicbl_somrRepInit(SOMRReplicbl *somSelf, Environment *ev, 
  152.         char lType, 
  153.         char mode);
  154. typedef somTP_SOMRReplicbl_somrRepInit *somTD_SOMRReplicbl_somrRepInit;
  155. typedef void   SOMLINK somTP_SOMRReplicbl_somrRepUninit(SOMRReplicbl *somSelf, Environment *ev);
  156. typedef somTP_SOMRReplicbl_somrRepUninit *somTD_SOMRReplicbl_somrRepUninit;
  157. typedef void   SOMLINK somTP_SOMRReplicbl_somrApplyUpdates(SOMRReplicbl *somSelf, Environment *ev, 
  158.         string buf, 
  159.         long len, 
  160.         long ObjIntId);
  161. typedef somTP_SOMRReplicbl_somrApplyUpdates *somTD_SOMRReplicbl_somrApplyUpdates;
  162. typedef void   SOMLINK somTP_SOMRReplicbl_somrDoDirective(SOMRReplicbl *somSelf, Environment *ev, 
  163.         string str);
  164. typedef somTP_SOMRReplicbl_somrDoDirective *somTD_SOMRReplicbl_somrDoDirective;
  165. typedef void   SOMLINK somTP_SOMRReplicbl_somrPin(SOMRReplicbl *somSelf, Environment *ev);
  166. typedef somTP_SOMRReplicbl_somrPin *somTD_SOMRReplicbl_somrPin;
  167. typedef void   SOMLINK somTP_SOMRReplicbl_somrUnPin(SOMRReplicbl *somSelf, Environment *ev);
  168. typedef somTP_SOMRReplicbl_somrUnPin *somTD_SOMRReplicbl_somrUnPin;
  169. typedef long   SOMLINK somTP_SOMRReplicbl_somrGetSecurityPolicy(SOMRReplicbl *somSelf, Environment *ev);
  170. typedef somTP_SOMRReplicbl_somrGetSecurityPolicy *somTD_SOMRReplicbl_somrGetSecurityPolicy;
  171.  
  172. /*
  173.  * -- Typedefs for Reintroduced Wrapper Methods
  174.  */
  175. typedef void   SOMLINK somTP_SOMRReplicbl_somrSetObjName(SOMRReplicbl *somSelf, Environment *ev, 
  176.         string name);
  177. typedef somTP_SOMRReplicbl_somrSetObjName *somTD_SOMRReplicbl_somrSetObjName;
  178. typedef string   SOMLINK somTP_SOMRReplicbl_somrGetObjName(SOMRReplicbl *somSelf, Environment *ev);
  179. typedef somTP_SOMRReplicbl_somrGetObjName *somTD_SOMRReplicbl_somrGetObjName;
  180. typedef void   SOMLINK somTP_SOMRReplicbl_somInit(SOMRReplicbl *somSelf);
  181. typedef somTP_SOMRReplicbl_somInit *somTD_SOMRReplicbl_somInit;
  182. typedef void   SOMLINK somTP_SOMRReplicbl_somUninit(SOMRReplicbl *somSelf);
  183. typedef somTP_SOMRReplicbl_somUninit *somTD_SOMRReplicbl_somUninit;
  184. typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultInit(SOMRReplicbl *somSelf, 
  185.         som3InitCtrl* ctrl);
  186. typedef somTP_SOMRReplicbl_somDefaultInit *somTD_SOMRReplicbl_somDefaultInit;
  187. typedef void   SOMLINK somTP_SOMRReplicbl_somDestruct(SOMRReplicbl *somSelf, 
  188.         octet doFree, 
  189.         som3DestructCtrl* ctrl);
  190. typedef somTP_SOMRReplicbl_somDestruct *somTD_SOMRReplicbl_somDestruct;
  191. typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultCopyInit(SOMRReplicbl *somSelf, 
  192.         som3InitCtrl* ctrl, 
  193.         SOMObject* fromObj);
  194. typedef somTP_SOMRReplicbl_somDefaultCopyInit *somTD_SOMRReplicbl_somDefaultCopyInit;
  195. typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultAssign(SOMRReplicbl *somSelf, 
  196.         som3AssignCtrl* ctrl, 
  197.         SOMObject* fromObj);
  198. typedef somTP_SOMRReplicbl_somDefaultAssign *somTD_SOMRReplicbl_somDefaultAssign;
  199. typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultConstCopyInit(SOMRReplicbl *somSelf, 
  200.         som3InitCtrl* ctrl, 
  201.         SOMObject* fromObj);
  202. typedef somTP_SOMRReplicbl_somDefaultConstCopyInit *somTD_SOMRReplicbl_somDefaultConstCopyInit;
  203. typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultVCopyInit(SOMRReplicbl *somSelf, 
  204.         som3InitCtrl* ctrl, 
  205.         SOMObject* fromObj);
  206. typedef somTP_SOMRReplicbl_somDefaultVCopyInit *somTD_SOMRReplicbl_somDefaultVCopyInit;
  207. typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultConstVCopyInit(SOMRReplicbl *somSelf, 
  208.         som3InitCtrl* ctrl, 
  209.         SOMObject* fromObj);
  210. typedef somTP_SOMRReplicbl_somDefaultConstVCopyInit *somTD_SOMRReplicbl_somDefaultConstVCopyInit;
  211. typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultConstAssign(SOMRReplicbl *somSelf, 
  212.         som3AssignCtrl* ctrl, 
  213.         SOMObject* fromObj);
  214. typedef somTP_SOMRReplicbl_somDefaultConstAssign *somTD_SOMRReplicbl_somDefaultConstAssign;
  215. typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultVAssign(SOMRReplicbl *somSelf, 
  216.         som3AssignCtrl* ctrl, 
  217.         SOMObject* fromObj);
  218. typedef somTP_SOMRReplicbl_somDefaultVAssign *somTD_SOMRReplicbl_somDefaultVAssign;
  219. typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultConstVAssign(SOMRReplicbl *somSelf, 
  220.         som3AssignCtrl* ctrl, 
  221.         SOMObject* fromObj);
  222. typedef somTP_SOMRReplicbl_somDefaultConstVAssign *somTD_SOMRReplicbl_somDefaultConstVAssign;
  223. typedef void   SOMLINK somTP_SOMRReplicbl_somFree(SOMRReplicbl *somSelf);
  224. typedef somTP_SOMRReplicbl_somFree *somTD_SOMRReplicbl_somFree;
  225. typedef SOMClass*   SOMLINK somTP_SOMRReplicbl_somGetClass(SOMRReplicbl *somSelf);
  226. typedef somTP_SOMRReplicbl_somGetClass *somTD_SOMRReplicbl_somGetClass;
  227. typedef string   SOMLINK somTP_SOMRReplicbl_somGetClassName(SOMRReplicbl *somSelf);
  228. typedef somTP_SOMRReplicbl_somGetClassName *somTD_SOMRReplicbl_somGetClassName;
  229. typedef long   SOMLINK somTP_SOMRReplicbl_somGetSize(SOMRReplicbl *somSelf);
  230. typedef somTP_SOMRReplicbl_somGetSize *somTD_SOMRReplicbl_somGetSize;
  231. typedef boolean   SOMLINK somTP_SOMRReplicbl_somIsA(SOMRReplicbl *somSelf, 
  232.         SOMClass* aClassObj);
  233. typedef somTP_SOMRReplicbl_somIsA *somTD_SOMRReplicbl_somIsA;
  234. typedef boolean   SOMLINK somTP_SOMRReplicbl_somIsInstanceOf(SOMRReplicbl *somSelf, 
  235.         SOMClass* aClassObj);
  236. typedef somTP_SOMRReplicbl_somIsInstanceOf *somTD_SOMRReplicbl_somIsInstanceOf;
  237. typedef boolean   SOMLINK somTP_SOMRReplicbl_somRespondsTo(SOMRReplicbl *somSelf, 
  238.         somId mId);
  239. typedef somTP_SOMRReplicbl_somRespondsTo *somTD_SOMRReplicbl_somRespondsTo;
  240. typedef boolean   SOMLINK somTP_SOMRReplicbl_somDispatch(SOMRReplicbl *somSelf, 
  241.         somToken* retValue, 
  242.         somId methodId, 
  243.         va_list ap);
  244. typedef somTP_SOMRReplicbl_somDispatch *somTD_SOMRReplicbl_somDispatch;
  245. typedef boolean   SOMLINK somTP_SOMRReplicbl_somClassDispatch(SOMRReplicbl *somSelf, 
  246.         SOMClass* clsObj, 
  247.         somToken* retValue, 
  248.         somId methodId, 
  249.         va_list ap);
  250. typedef somTP_SOMRReplicbl_somClassDispatch *somTD_SOMRReplicbl_somClassDispatch;
  251. typedef boolean   SOMLINK somTP_SOMRReplicbl_somCastObj(SOMRReplicbl *somSelf, 
  252.         SOMClass* cls);
  253. typedef somTP_SOMRReplicbl_somCastObj *somTD_SOMRReplicbl_somCastObj;
  254. typedef boolean   SOMLINK somTP_SOMRReplicbl_somResetObj(SOMRReplicbl *somSelf);
  255. typedef somTP_SOMRReplicbl_somResetObj *somTD_SOMRReplicbl_somResetObj;
  256. typedef void   SOMLINK somTP_SOMRReplicbl_somDispatchV(SOMRReplicbl *somSelf, 
  257.         somId methodId, 
  258.         somId descriptor, 
  259.         va_list ap);
  260. typedef somTP_SOMRReplicbl_somDispatchV *somTD_SOMRReplicbl_somDispatchV;
  261. typedef long   SOMLINK somTP_SOMRReplicbl_somDispatchL(SOMRReplicbl *somSelf, 
  262.         somId methodId, 
  263.         somId descriptor, 
  264.         va_list ap);
  265. typedef somTP_SOMRReplicbl_somDispatchL *somTD_SOMRReplicbl_somDispatchL;
  266. typedef void*   SOMLINK somTP_SOMRReplicbl_somDispatchA(SOMRReplicbl *somSelf, 
  267.         somId methodId, 
  268.         somId descriptor, 
  269.         va_list ap);
  270. typedef somTP_SOMRReplicbl_somDispatchA *somTD_SOMRReplicbl_somDispatchA;
  271. typedef double   SOMLINK somTP_SOMRReplicbl_somDispatchD(SOMRReplicbl *somSelf, 
  272.         somId methodId, 
  273.         somId descriptor, 
  274.         va_list ap);
  275. typedef somTP_SOMRReplicbl_somDispatchD *somTD_SOMRReplicbl_somDispatchD;
  276. typedef SOMObject*   SOMLINK somTP_SOMRReplicbl_somPrintSelf(SOMRReplicbl *somSelf);
  277. typedef somTP_SOMRReplicbl_somPrintSelf *somTD_SOMRReplicbl_somPrintSelf;
  278. typedef void   SOMLINK somTP_SOMRReplicbl_somDumpSelf(SOMRReplicbl *somSelf, 
  279.         long level);
  280. typedef somTP_SOMRReplicbl_somDumpSelf *somTD_SOMRReplicbl_somDumpSelf;
  281. typedef void   SOMLINK somTP_SOMRReplicbl_somDumpSelfInt(SOMRReplicbl *somSelf, 
  282.         long level);
  283. typedef somTP_SOMRReplicbl_somDumpSelfInt *somTD_SOMRReplicbl_somDumpSelfInt;
  284. typedef void   SOMLINK somTP_SOMRReplicbl_somrGetState(SOMRReplicbl *somSelf, Environment *ev, 
  285.         string* buf);
  286. typedef somTP_SOMRReplicbl_somrGetState *somTD_SOMRReplicbl_somrGetState;
  287. typedef void   SOMLINK somTP_SOMRReplicbl_somrSetState(SOMRReplicbl *somSelf, Environment *ev, 
  288.         string buf);
  289. typedef somTP_SOMRReplicbl_somrSetState *somTD_SOMRReplicbl_somrSetState;
  290. }
  291.  
  292. #endif /* SOMRReplicbl_API */
  293.  
  294.  
  295. /*
  296.  * -- This emitter treats Method Tokens as Thunks by default.
  297.  * -- Use the sc modifier "nothunks" to change this default
  298.  */
  299. #undef somresolve_
  300. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  301.  
  302. /*
  303.  * -- The C++ Wrapper Class for SOMRReplicbl
  304.  */
  305. class SOMRReplicbl : public SOMRNameable, public SOMRLinearizable
  306. {
  307. /*
  308.  *  This class provides a link to the Replication Framework. Any class derived
  309.  *  from this class can have instances that are replicated in other address
  310.  *  spaces.  To get the ability to replicate, the derived
  311.  *  class has to abide by the following rules (these rules are binding on
  312.  *  further derivations and contained (constituent) subobjects as well):
  313.  * 
  314.  *     1. It must obtain a replica lock before updating its data and must
  315.  *        release the same after the update. (i.e., The update methods
  316.  *        must bracket their code in a (somrLock, somrReleaseNPropagateUpdate)
  317.  *        pair or a (somrLockNLogOp, somrReleaseNPropagateOperation) pair.)
  318.  *     2. If after obtaining the replica lock, if the object decides to abort
  319.  *        an update operation, it must call the appropriate abort method.
  320.  *        (somrReleaseLockNAbortOp or somrReleaseLockNAbortUpdate)
  321.  *     3. In case value logging is used, it must have an update language in which
  322.  *        changes in the state of the object can be described.
  323.  *     4. In case value logging is used, it must provide a method to receive and
  324.  *        interpret update messages propagated by other replicas. (i.e., Must implement
  325.  *        somrApplyUpdates method. When there are subobjects, this implementation
  326.  *        should call them to interpret the updates appropriate to them.)
  327.  *     5. It must have methods to get and set the complete state of the object (including
  328.  *        any subobjects). (i.e., Must provide implementations for somrGetState
  329.  *        and somrSetState.)
  330.  *     6. It should be able to receive and interpret data replication
  331.  *        directives (e.g., "LOST_CONNECTION", "BECOME_STAND_ALONE", etc. )
  332.  */
  333. public:
  334.  
  335. // SOMRReplicbl::new creates the class object if necessary, and then uses somNewNoInit
  336. // to allocate memory and create the object. Initialization is in ctors.
  337. void *operator new(size_t)
  338. {
  339.    if (!_SOMRReplicbl) SOMRReplicblNewClass(SOMRReplicbl_MajorVersion,SOMRReplicbl_MinorVersion);
  340.    return (void*)
  341.       SOM_Resolve(_SOMRReplicbl,SOMClass,somNewNoInit)
  342.          ((SOMClass *)((void*)_SOMRReplicbl));
  343. }
  344.  
  345. // SOMRReplicbl::delete uses somDestruct.
  346. void operator delete(void * obj)
  347. {
  348.    if (obj && *(void**)obj) {
  349.       SOM_Resolve(obj,SOMObject,somFree)
  350.          ((SOMObject*)obj);
  351.    }
  352. }
  353.  
  354. SOMRReplicbl& operator=(SOMRReplicbl& fromObj)
  355. {
  356.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  357.    return *this;
  358. }
  359.  
  360. SOMRReplicbl()
  361. {
  362.    if (*(void**)this != 
  363.        ((somParentMtabStructPtr)
  364.         (SOMRReplicblCClassData.parentMtab))->mtab)
  365.       return;
  366.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  367. }
  368.  
  369. SOMRReplicbl(SOMRReplicbl* fromObj)
  370. {
  371.    if (*(void**)this != 
  372.        ((somParentMtabStructPtr)
  373.         (SOMRReplicblCClassData.parentMtab))->mtab)
  374.       return;
  375.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  376. }
  377.  
  378. #ifdef __IBMCPP__
  379. #pragma info(nocnv,nopar)
  380. #endif
  381. SOMRReplicbl(const SOMRReplicbl* fromObj)
  382. {
  383.    if (*(void**)this != 
  384.        ((somParentMtabStructPtr)
  385.         (SOMRReplicblCClassData.parentMtab))->mtab)
  386.       return;
  387.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  388. }
  389. #ifdef __IBMCPP__
  390. #pragma info(restore)
  391. #endif
  392.  
  393.  
  394. /* method: somrLock */
  395. void   somrLock(Environment *ev)
  396. {
  397. /*
  398.  *  Get a lock on this replica of the object. An exception is raised if the
  399.  *  lock is not obtained.
  400.  */
  401.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrLock)
  402.     (this, ev);
  403. }
  404.  
  405.  
  406. /* va_list method: somrLockNlogOp */
  407.  
  408. /*
  409.  *  Similar to somrLock, but it also logs the method (i.e., MthdName) that is
  410.  *  requesting the lock.
  411.  *  The va_list parameter is for specifying the actual arguments with which "MthdName" is
  412.  *  being called.
  413.  */
  414. /* the va_list invocation form */
  415. void   SOMRReplicbl_somrLockNlogOp(Environment *ev, 
  416.         string ClassName, 
  417.         string MthdName, 
  418.         va_list ap)
  419. {   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrLockNlogOp)
  420.     (this, ev,ClassName,MthdName,ap);
  421. }
  422.  
  423. /* the varargs invocation form */
  424. void   somrLockNlogOp(Environment *ev, 
  425.         string ClassName, 
  426.         string MthdName, 
  427.         ...)
  428. {
  429. /*
  430.  *  Similar to somrLock, but it also logs the method (i.e., MthdName) that is
  431.  *  requesting the lock.
  432.  *  The va_list parameter is for specifying the actual arguments with which "MthdName" is
  433.  *  being called.
  434.  */
  435.    va_list ap;
  436.    va_start(ap, MthdName);
  437.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrLockNlogOp)
  438.     (this, ev,ClassName,MthdName,ap);
  439.    va_end(ap);
  440. }
  441.  
  442.  
  443. /* method: somrReleaseNPropagateUpdate */
  444. void   somrReleaseNPropagateUpdate(Environment *ev, 
  445.         string clsname, 
  446.         string buf, 
  447.         long len, 
  448.         long intOid)
  449. {
  450. /*
  451.  *  Release the lock locally and propagate the local updates to master and or
  452.  *  other shadows by calling the local replica manager. This propagates
  453.  *  "value log" of state changes. The parameter intOid is used to indicate
  454.  *  a subobject id to which this update is to be applied. If there are no
  455.  *  subobjects, this argument is to be set to 0.
  456.  */
  457.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseNPropagateUpdate)
  458.     (this, ev,clsname,buf,len,intOid);
  459. }
  460.  
  461.  
  462. /* method: somrReleaseLockNAbortUpdate */
  463. void   somrReleaseLockNAbortUpdate(Environment *ev)
  464. {
  465. /*
  466.  *  Lets the data replication framework know that the user decided to abort
  467.  *  the operation he/she began by calling somrLock. Once a lock is
  468.  *  obtained, either this method or somrReleaseNPropagateUpdate must
  469.  *  be called.
  470.  */
  471.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseLockNAbortUpdate)
  472.     (this, ev);
  473. }
  474.  
  475.  
  476. /* method: somrReleaseNPropagateOperation */
  477. void   somrReleaseNPropagateOperation(Environment *ev)
  478. {
  479. /*
  480.  *  Similar to Propagate update, except now propagate the "operation log"
  481.  *  instead of the value log  prepared by the subclass implementation.
  482.  */
  483.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseNPropagateOperation)
  484.     (this, ev);
  485. }
  486.  
  487.  
  488. /* method: somrReleaseLockNAbortOp */
  489. void   somrReleaseLockNAbortOp(Environment *ev)
  490. {
  491. /*
  492.  *  Lets the data replication framework know that the user decided to abort
  493.  *  the operation that he/she began by calling somrLockNLogOp. Once a lock
  494.  *  is obtained, either this method or somrReleaseNPropagateOperation must
  495.  *  be called
  496.  */
  497.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseLockNAbortOp)
  498.     (this, ev);
  499. }
  500.  
  501.  
  502. /* method: somrRepInit */
  503. long   somrRepInit(Environment *ev, 
  504.         char lType, 
  505.         char mode)
  506. {
  507. /*
  508.  *  Makes the object ready for replication. A derived object
  509.  *  MUST call this method for activating replica control.  The parameter
  510.  *  lType indicates the type of logging used: 'v' for value logging and 'o'
  511.  *  for operation logging.  The parameter mode indicates whether the
  512.  *  object is opened for reading("r") or writing ("w").
  513.  * 
  514.  *  If no errors occur, a return value of 1 indicates that this is the first
  515.  *  replica to be activated (i.e., the Master), and 0 indicates it is a shadow.
  516.  * 
  517.  *  If an error occurs, an exception is raised, and the return value is
  518.  *  indeterminate (and should be ignored).
  519.  * 
  520.  *  If the object is already initialized, no action is taken, and a return
  521.  *  code of 0 is returned.
  522.  */
  523.    return SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrRepInit)
  524.     (this, ev,lType,mode);
  525. }
  526.  
  527.  
  528. /* method: somrRepUninit */
  529. void   somrRepUninit(Environment *ev)
  530. {
  531. /*
  532.  *  Destroys the set up for replication.
  533.  *  If the object is not initialized for replication, no action is taken.
  534.  */
  535.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrRepUninit)
  536.     (this, ev);
  537. }
  538.  
  539.  
  540. /* method: somrApplyUpdates */
  541. void   somrApplyUpdates(Environment *ev, 
  542.         string buf, 
  543.         long len, 
  544.         long ObjIntId)
  545. {
  546. /*
  547.  *  This method interprets the buffer received as an update to its state.
  548.  *  The format of this update is exactly the same as the one used by the
  549.  *  subclass implementor for the update buffer passed to ReleaseNPropagateUpdate
  550.  *  method. The ObjIntId parameter indicates the internal subobject id to which
  551.  *  this update should be applied. If it is 0, then the update is to be applied
  552.  *  to self.
  553.  */
  554.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrApplyUpdates)
  555.     (this, ev,buf,len,ObjIntId);
  556. }
  557.  
  558.  
  559. /* method: somrDoDirective */
  560. void   somrDoDirective(Environment *ev, 
  561.         string str)
  562. {
  563. /*
  564.  *  The string gives a directive to the object to implement. The directive usually
  565.  *  indications a condition that warrants user intervention/awareness.
  566.  */
  567.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrDoDirective)
  568.     (this, ev,str);
  569. }
  570.  
  571.  
  572. /* method: somrPin */
  573. void   somrPin(Environment *ev)
  574. {
  575. /*
  576.  *  Makes the replica lock obtained by this replica stay with it until a call
  577.  *  to UnPin is made.  That is, it makes the replica lock un-preemptible.
  578.  *  Raises an Exception if the lock is denied (SOMR_DENIED).
  579.  */
  580.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrPin)
  581.     (this, ev);
  582. }
  583.  
  584.  
  585. /* method: somrUnPin */
  586. void   somrUnPin(Environment *ev)
  587. {
  588. /*
  589.  *  Declares the replica lock preemptible. That is, other shadows can grab the
  590.  *  replica lock from this shadow.
  591.  */
  592.    SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrUnPin)
  593.     (this, ev);
  594. }
  595.  
  596.  
  597. /* method: somrGetSecurityPolicy */
  598. long   somrGetSecurityPolicy(Environment *ev)
  599. {
  600. /*
  601.  *   Returns the security policy for replicated objects that are either
  602.  *   non-persistent or persistent but haven't been created yet.
  603.  *   Caveat: Meaningful only on AIX. Ignored for OS/2.
  604.  */
  605.    return SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrGetSecurityPolicy)
  606.     (this, ev);
  607. }
  608.  
  609.  
  610. /*
  611.  * Reintroduce inherited methods
  612.  */
  613.  
  614. /* method: somrSetObjName */
  615. void   somrSetObjName(Environment *ev, 
  616.         string name)
  617. {
  618. /*
  619.  *  Sets the internal pointer to "name" .
  620.  *            The OWNERSHIP of the string is transferred to this object.
  621.  */
  622.    SOM_ResolveD(this,SOMRReplicbl,SOMRNameable,somrSetObjName)
  623.     (this, ev,name);
  624. }
  625.  
  626.  
  627. /* method: somrGetObjName */
  628. string   somrGetObjName(Environment *ev)
  629. {
  630. /*
  631.  *  Returns a pointer to the name string.
  632.  *           The OWNERSHIP of the string stays with this object.
  633.  */
  634.    return SOM_ResolveD(this,SOMRReplicbl,SOMRNameable,somrGetObjName)
  635.     (this, ev);
  636. }
  637.  
  638.  
  639. /* method: somInit */
  640. void   somInit()
  641. {
  642.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somInit)
  643.     (this);
  644. }
  645.  
  646.  
  647. /* method: somUninit */
  648. void   somUninit()
  649. {
  650.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somUninit)
  651.     (this);
  652. }
  653.  
  654.  
  655. /* initializer method: somDefaultInit */
  656. void   somDefaultInit(som3InitCtrl* ctrl)
  657. {
  658. /*
  659.  *  A default initializer for a SOM object. Passing a null ctrl
  660.  *  indicates to the receiver that its class is the class of the
  661.  *  object being initialized, whereby the initializer will determine
  662.  *  an appropriate control structure.
  663.  */
  664.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultInit)
  665.     (this,ctrl);
  666. }
  667.  
  668.  
  669. /* method: somDestruct */
  670. void   somDestruct(octet doFree, 
  671.         som3DestructCtrl* ctrl)
  672. {
  673. /*
  674.  *  The default destructor for a SOM object. A nonzero <doFree>
  675.  *  indicates that the object storage should be freed by the
  676.  *  object's class (via somDeallocate) after uninitialization.
  677.  *  As with somDefaultInit, a null ctrl can be passed.
  678.  */
  679.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDestruct)
  680.     (this,doFree,ctrl);
  681. }
  682.  
  683.  
  684. /* initializer method: somDefaultCopyInit */
  685. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  686.         SOMObject* fromObj)
  687. {
  688. /*
  689.  *  A default copy constructor. Use this to make copies of objects for
  690.  *  calling methods with "by-value" argument semantics.
  691.  */
  692.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultCopyInit)
  693.     (this,ctrl,fromObj);
  694. }
  695.  
  696.  
  697. /* method: somDefaultAssign */
  698. SOMRReplicbl*  somDefaultAssign(som3AssignCtrl* ctrl, 
  699.         SOMObject* fromObj)
  700. {
  701. /*
  702.  *  A default assignment operator. Use this to "assign" the state of one
  703.  *  object to another.
  704.  */
  705.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultAssign)
  706.     (this,ctrl,fromObj);
  707. }
  708.  
  709.  
  710. /* initializer method: somDefaultConstCopyInit */
  711. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  712.         SOMObject* fromObj)
  713. {
  714. /*
  715.  *  A default copy constructor that uses a const fromObj.
  716.  */
  717.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstCopyInit)
  718.     (this,ctrl,fromObj);
  719. }
  720.  
  721.  
  722. /* initializer method: somDefaultVCopyInit */
  723. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  724.         SOMObject* fromObj)
  725. {
  726. /*
  727.  *  A default copy constructor that uses a volatile fromObj.
  728.  */
  729.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultVCopyInit)
  730.     (this,ctrl,fromObj);
  731. }
  732.  
  733.  
  734. /* initializer method: somDefaultConstVCopyInit */
  735. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  736.         SOMObject* fromObj)
  737. {
  738. /*
  739.  *  A default copy constructor that uses a const volatile fromObj.
  740.  */
  741.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstVCopyInit)
  742.     (this,ctrl,fromObj);
  743. }
  744.  
  745.  
  746. /* method: somDefaultConstAssign */
  747. SOMRReplicbl*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  748.         SOMObject* fromObj)
  749. {
  750. /*
  751.  *  A default assignment operator that uses a const fromObj.
  752.  */
  753.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstAssign)
  754.     (this,ctrl,fromObj);
  755. }
  756.  
  757.  
  758. /* method: somDefaultVAssign */
  759. SOMRReplicbl*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  760.         SOMObject* fromObj)
  761. {
  762. /*
  763.  *  A default assignment operator that uses a volatile fromObj.
  764.  */
  765.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultVAssign)
  766.     (this,ctrl,fromObj);
  767. }
  768.  
  769.  
  770. /* method: somDefaultConstVAssign */
  771. SOMRReplicbl*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  772.         SOMObject* fromObj)
  773. {
  774. /*
  775.  *  A default assignment operator that uses a const volatile fromObj.
  776.  */
  777.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstVAssign)
  778.     (this,ctrl,fromObj);
  779. }
  780.  
  781.  
  782. /* method: somFree */
  783. void   somFree()
  784. {
  785. /*
  786.  *  Use as directed by framework implementations.
  787.  */
  788.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somFree)
  789.     (this);
  790. }
  791.  
  792.  
  793. /* method: somGetClass */
  794. SOMClass*   somGetClass()
  795. {
  796. /*
  797.  *  Return the receiver's class.
  798.  */
  799.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somGetClass)
  800.     (this);
  801. }
  802.  
  803.  
  804. /* method: somGetClassName */
  805. string   somGetClassName()
  806. {
  807. /*
  808.  *  Return the name of the receiver's class.
  809.  */
  810.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somGetClassName)
  811.     (this);
  812. }
  813.  
  814.  
  815. /* method: somGetSize */
  816. long   somGetSize()
  817. {
  818. /*
  819.  *  Return the size of the receiver.
  820.  */
  821.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somGetSize)
  822.     (this);
  823. }
  824.  
  825.  
  826. /* method: somIsA */
  827. boolean   somIsA(SOMClass* aClassObj)
  828. {
  829. /*
  830.  *  Returns 1 (true) if the receiver responds to methods
  831.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  832.  */
  833.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somIsA)
  834.     (this,aClassObj);
  835. }
  836.  
  837.  
  838. /* method: somIsInstanceOf */
  839. boolean   somIsInstanceOf(SOMClass* aClassObj)
  840. {
  841. /*
  842.  *  Returns 1 (true) if the receiver is an instance of
  843.  *  <aClassObj> and 0 (false) otherwise.
  844.  */
  845.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somIsInstanceOf)
  846.     (this,aClassObj);
  847. }
  848.  
  849.  
  850. /* method: somRespondsTo */
  851. boolean   somRespondsTo(somId mId)
  852. {
  853. /*
  854.  *  Returns 1 (true) if the indicated method can be invoked
  855.  *  on the receiver and 0 (false) otherwise.
  856.  */
  857.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somRespondsTo)
  858.     (this,mId);
  859. }
  860.  
  861.  
  862. /* va_list method: somDispatch */
  863.  
  864. /*
  865.  *  This method provides a generic, class-specific dispatch mechanism.
  866.  *  It accepts as input <retValue> a pointer to the memory area to be
  867.  *  loaded with the result of dispatching the method indicated by
  868.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  869.  *  on which the method is to be invoked as the first argument.
  870.  */
  871. /* the va_list invocation form */
  872. boolean   SOMRReplicbl_somDispatch(somToken* retValue, 
  873.         somId methodId, 
  874.         va_list ap)
  875. {return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatch)
  876.     (this,retValue,methodId,ap);
  877. }
  878.  
  879. /* the varargs invocation form */
  880. boolean   somDispatch(somToken* retValue, 
  881.         somId methodId, 
  882.         ...)
  883. {
  884. /*
  885.  *  This method provides a generic, class-specific dispatch mechanism.
  886.  *  It accepts as input <retValue> a pointer to the memory area to be
  887.  *  loaded with the result of dispatching the method indicated by
  888.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  889.  *  on which the method is to be invoked as the first argument.
  890.  */
  891.    va_list ap;
  892.    va_start(ap, methodId);
  893.    boolean __somResult = 
  894.       SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatch)
  895.     (this,retValue,methodId,ap);
  896.    va_end(ap);
  897.    return __somResult;
  898. }
  899.  
  900.  
  901. /* va_list method: somClassDispatch */
  902.  
  903. /*
  904.  *  Like somDispatch, but method resolution for static methods is done
  905.  *  according to the clsObj instance method table.
  906.  */
  907. /* the va_list invocation form */
  908. boolean   SOMRReplicbl_somClassDispatch(SOMClass* clsObj, 
  909.         somToken* retValue, 
  910.         somId methodId, 
  911.         va_list ap)
  912. {return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somClassDispatch)
  913.     (this,clsObj,retValue,methodId,ap);
  914. }
  915.  
  916. /* the varargs invocation form */
  917. boolean   somClassDispatch(SOMClass* clsObj, 
  918.         somToken* retValue, 
  919.         somId methodId, 
  920.         ...)
  921. {
  922. /*
  923.  *  Like somDispatch, but method resolution for static methods is done
  924.  *  according to the clsObj instance method table.
  925.  */
  926.    va_list ap;
  927.    va_start(ap, methodId);
  928.    boolean __somResult = 
  929.       SOM_ResolveD(this,SOMRReplicbl,SOMObject,somClassDispatch)
  930.     (this,clsObj,retValue,methodId,ap);
  931.    va_end(ap);
  932.    return __somResult;
  933. }
  934.  
  935.  
  936. /* method: somCastObj */
  937. boolean   somCastObj(SOMClass* cls)
  938. {
  939. /*
  940.  *  cast the receiving object to cls (which must be an ancestor of the
  941.  *  objects true class. Returns true on success.
  942.  */
  943.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somCastObj)
  944.     (this,cls);
  945. }
  946.  
  947.  
  948. /* method: somResetObj */
  949. boolean   somResetObj()
  950. {
  951. /*
  952.  *  reset an object to its true class. Returns true always.
  953.  */
  954.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somResetObj)
  955.     (this);
  956. }
  957.  
  958.  
  959. /* va_list method: somDispatchV */
  960.  
  961. /*
  962.  *  Obsolete. Use somDispatch instead.
  963.  */
  964. /* the va_list invocation form */
  965. void   SOMRReplicbl_somDispatchV(somId methodId, 
  966.         somId descriptor, 
  967.         va_list ap)
  968. {   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchV)
  969.     (this,methodId,descriptor,ap);
  970. }
  971.  
  972. /* the varargs invocation form */
  973. void   somDispatchV(somId methodId, 
  974.         somId descriptor, 
  975.         ...)
  976. {
  977. /*
  978.  *  Obsolete. Use somDispatch instead.
  979.  */
  980.    va_list ap;
  981.    va_start(ap, descriptor);
  982.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchV)
  983.     (this,methodId,descriptor,ap);
  984.    va_end(ap);
  985. }
  986.  
  987.  
  988. /* va_list method: somDispatchL */
  989.  
  990. /*
  991.  *  Obsolete. Use somDispatch instead.
  992.  */
  993. /* the va_list invocation form */
  994. long   SOMRReplicbl_somDispatchL(somId methodId, 
  995.         somId descriptor, 
  996.         va_list ap)
  997. {return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchL)
  998.     (this,methodId,descriptor,ap);
  999. }
  1000.  
  1001. /* the varargs invocation form */
  1002. long   somDispatchL(somId methodId, 
  1003.         somId descriptor, 
  1004.         ...)
  1005. {
  1006. /*
  1007.  *  Obsolete. Use somDispatch instead.
  1008.  */
  1009.    va_list ap;
  1010.    va_start(ap, descriptor);
  1011.    long __somResult = 
  1012.       SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchL)
  1013.     (this,methodId,descriptor,ap);
  1014.    va_end(ap);
  1015.    return __somResult;
  1016. }
  1017.  
  1018.  
  1019. /* va_list method: somDispatchA */
  1020.  
  1021. /*
  1022.  *  Obsolete. Use somDispatch instead.
  1023.  */
  1024. /* the va_list invocation form */
  1025. void*   SOMRReplicbl_somDispatchA(somId methodId, 
  1026.         somId descriptor, 
  1027.         va_list ap)
  1028. {return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchA)
  1029.     (this,methodId,descriptor,ap);
  1030. }
  1031.  
  1032. /* the varargs invocation form */
  1033. void*   somDispatchA(somId methodId, 
  1034.         somId descriptor, 
  1035.         ...)
  1036. {
  1037. /*
  1038.  *  Obsolete. Use somDispatch instead.
  1039.  */
  1040.    va_list ap;
  1041.    va_start(ap, descriptor);
  1042.    void* __somResult = 
  1043.       SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchA)
  1044.     (this,methodId,descriptor,ap);
  1045.    va_end(ap);
  1046.    return __somResult;
  1047. }
  1048.  
  1049.  
  1050. /* va_list method: somDispatchD */
  1051.  
  1052. /*
  1053.  *  Obsolete. Use somDispatch instead.
  1054.  */
  1055. /* the va_list invocation form */
  1056. double   SOMRReplicbl_somDispatchD(somId methodId, 
  1057.         somId descriptor, 
  1058.         va_list ap)
  1059. {return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchD)
  1060.     (this,methodId,descriptor,ap);
  1061. }
  1062.  
  1063. /* the varargs invocation form */
  1064. double   somDispatchD(somId methodId, 
  1065.         somId descriptor, 
  1066.         ...)
  1067. {
  1068. /*
  1069.  *  Obsolete. Use somDispatch instead.
  1070.  */
  1071.    va_list ap;
  1072.    va_start(ap, descriptor);
  1073.    double __somResult = 
  1074.       SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchD)
  1075.     (this,methodId,descriptor,ap);
  1076.    va_end(ap);
  1077.    return __somResult;
  1078. }
  1079.  
  1080.  
  1081. /* method: somPrintSelf */
  1082. SOMObject*   somPrintSelf()
  1083. {
  1084. /*
  1085.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  1086.  *  information about this object.  The default implementation just gives
  1087.  *  the object's class name and its address in memory.
  1088.  *  <self> is returned.
  1089.  */
  1090.    return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somPrintSelf)
  1091.     (this);
  1092. }
  1093.  
  1094.  
  1095. /* method: somDumpSelf */
  1096. void   somDumpSelf(long level)
  1097. {
  1098. /*
  1099.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  1100.  *  and its current state.
  1101.  * 
  1102.  *  <level> indicates the nesting level for describing compound objects
  1103.  *  it must be greater than or equal to zero.  All lines in the
  1104.  *  description will be preceeded by <2*level> spaces.
  1105.  * 
  1106.  *  This routine only actually writes the data that concerns the object
  1107.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  1108.  *  the object's current state.  This approach allows readable
  1109.  *  descriptions of compound objects to be constructed.
  1110.  * 
  1111.  *  Generally it is not necessary to override this method, if it is
  1112.  *  overriden it generally must be completely replaced.
  1113.  */
  1114.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDumpSelf)
  1115.     (this,level);
  1116. }
  1117.  
  1118.  
  1119. /* method: somDumpSelfInt */
  1120. void   somDumpSelfInt(long level)
  1121. {
  1122. /*
  1123.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  1124.  *  Generally this method will need to be overridden.  When overriding
  1125.  *  it, begin by calling the parent class form of this method and then
  1126.  *  write in a description of your class's instance data. This will
  1127.  *  result in a description of all the object's instance data going
  1128.  *  from its root ancestor class to its specific class.
  1129.  */
  1130.    SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDumpSelfInt)
  1131.     (this,level);
  1132. }
  1133.  
  1134.  
  1135. /* method: somrGetState */
  1136. void   somrGetState(Environment *ev, 
  1137.         string* buf)
  1138. {
  1139. /*
  1140.  *  Converts its internal state into a linear string and returns a
  1141.  *  pointer to the string (the length of the string is in the
  1142.  *  first sizeof(int) bytes of this string).   The implementer of this
  1143.  *  method should allocate the necessary memory for the string.
  1144.  *  The OWNERSHIP of this string is transferred to the caller of this method.
  1145.  */
  1146.    SOM_ResolveD(this,SOMRReplicbl,SOMRLinearizable,somrGetState)
  1147.     (this, ev,buf);
  1148. }
  1149.  
  1150.  
  1151. /* method: somrSetState */
  1152. void   somrSetState(Environment *ev, 
  1153.         string buf)
  1154. {
  1155. /*
  1156.  *  The reverse of Get State. It converts the given linear string into
  1157.  *  its internal state.  The ownership of buf stays with the caller.
  1158.  */
  1159.    SOM_ResolveD(this,SOMRReplicbl,SOMRLinearizable,somrSetState)
  1160.     (this, ev,buf);
  1161. }
  1162.  
  1163.  
  1164.  
  1165. };   /* SOMRReplicbl */
  1166.  
  1167.  
  1168.  
  1169. #endif       /* SOM_SOMRReplicbl_xh */
  1170.