
/*
 * This file was generated by the SOM Compiler.
 * FileName: replicbl.xh.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.17
 *     SOM Emitter emitxh: 2.47
 */

/*
 *    COMPONENT_NAME: somr
 * 
 *    ORIGINS: 27
 * 
 * 
 *    10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
 *    All Rights Reserved
 *    Licensed Materials - Property of IBM
 *    US Government Users Restricted Rights - Use, duplication or
 *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 * 
 */


#ifndef SOM_SOMRReplicbl_xh
#define SOM_SOMRReplicbl_xh

class SOMRReplicbl;

/*
 *  This class provides a link to the Replication Framework. Any class derived
 *  from this class can have instances that are replicated in other address
 *  spaces.  To get the ability to replicate, the derived
 *  class has to abide by the following rules (these rules are binding on
 *  further derivations and contained (constituent) subobjects as well):
 * 
 *     1. It must obtain a replica lock before updating its data and must
 *        release the same after the update. (i.e., The update methods
 *        must bracket their code in a (somrLock, somrReleaseNPropagateUpdate)
 *        pair or a (somrLockNLogOp, somrReleaseNPropagateOperation) pair.)
 *     2. If after obtaining the replica lock, if the object decides to abort
 *        an update operation, it must call the appropriate abort method.
 *        (somrReleaseLockNAbortOp or somrReleaseLockNAbortUpdate)
 *     3. In case value logging is used, it must have an update language in which
 *        changes in the state of the object can be described.
 *     4. In case value logging is used, it must provide a method to receive and
 *        interpret update messages propagated by other replicas. (i.e., Must implement
 *        somrApplyUpdates method. When there are subobjects, this implementation
 *        should call them to interpret the updates appropriate to them.)
 *     5. It must have methods to get and set the complete state of the object (including
 *        any subobjects). (i.e., Must provide implementations for somrGetState
 *        and somrSetState.)
 *     6. It should be able to receive and interpret data replication
 *        directives (e.g., "LOST_CONNECTION", "BECOME_STAND_ALONE", etc. )
 */

#define SOMRReplicbl_MajorVersion 2
#define SOMRReplicbl_MinorVersion 1

/*
 * Passthru lines: File: "C.xh", "before"
 */
#include <somrerrd.xh>

/* C++ SOM defs */
#include <somcls.xh>
#include <somcm.xh>

/* C++ parent defs */
#ifndef SOM_SOMRNameable_xh
#include <nameable.xh>
#endif
#ifndef SOM_SOMRLinearizable_xh
#include <linear.xh>
#endif

#ifndef SOMRReplicbl_API
#define SOMRReplicbl_API
/*
 * -- The Class API
 */

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;
class SOFTRepmgrAB;
class Set;

/*
 * End of bindings for IDL types.
 */

/* A procedure to create the SOMRReplicbl Class */
SOMEXTERN SOMClass * SOMLINK SOMRReplicblNewClass(
		integer4 majorVersion,
		integer4 minorVersion);

/* The API to the SOMRReplicbl class object, and the methods it introduces. */
SOMEXTERN struct SOMRReplicblClassDataStructure {
	SOMClass *classObject;
	somMToken somrLock;
	somMToken somrLockNlogOp;
	somMToken somrReleaseNPropagateUpdate;
	somMToken somrReleaseLockNAbortUpdate;
	somMToken somrReleaseNPropagateOperation;
	somMToken somrReleaseLockNAbortOp;
	somMToken somrSendDirective;
	somMToken somrGetSavePermit;
	somMToken somrRepInit;
	somMToken somrRepUninit;
	somMToken somrApplyUpdates;
	somMToken somrDoDirective;
	somMToken somrPin;
	somMToken somrUnPin;
	somMToken somrGetSecurityPolicy;
} SOMDLINK SOMRReplicblClassData;
#define _SOMRReplicbl SOMRReplicblClassData.classObject

/* The API to parentMtabs for SOMRReplicbl, and the instance data it introduces. */
SOMEXTERN struct SOMRReplicblCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOMRReplicblCClassData;

/*
 * -- Typedefs for SOMRReplicbl Method Procedures
 */
SOMEXTERN {
typedef void   SOMLINK somTP_SOMRReplicbl_somrLock(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrLock *somTD_SOMRReplicbl_somrLock;
typedef void   SOMLINK somTP_SOMRReplicbl_somrLockNlogOp(SOMRReplicbl *somSelf, Environment *ev, 
		string ClassName, 
		string MthdName, 
		va_list ap);
typedef somTP_SOMRReplicbl_somrLockNlogOp *somTD_SOMRReplicbl_somrLockNlogOp;
typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseNPropagateUpdate(SOMRReplicbl *somSelf, Environment *ev, 
		string clsname, 
		string buf, 
		long len, 
		long intOid);
typedef somTP_SOMRReplicbl_somrReleaseNPropagateUpdate *somTD_SOMRReplicbl_somrReleaseNPropagateUpdate;
typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseLockNAbortUpdate(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrReleaseLockNAbortUpdate *somTD_SOMRReplicbl_somrReleaseLockNAbortUpdate;
typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseNPropagateOperation(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrReleaseNPropagateOperation *somTD_SOMRReplicbl_somrReleaseNPropagateOperation;
typedef void   SOMLINK somTP_SOMRReplicbl_somrReleaseLockNAbortOp(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrReleaseLockNAbortOp *somTD_SOMRReplicbl_somrReleaseLockNAbortOp;
typedef long   SOMLINK somTP_SOMRReplicbl_somrRepInit(SOMRReplicbl *somSelf, Environment *ev, 
		char lType, 
		char mode);
typedef somTP_SOMRReplicbl_somrRepInit *somTD_SOMRReplicbl_somrRepInit;
typedef void   SOMLINK somTP_SOMRReplicbl_somrRepUninit(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrRepUninit *somTD_SOMRReplicbl_somrRepUninit;
typedef void   SOMLINK somTP_SOMRReplicbl_somrApplyUpdates(SOMRReplicbl *somSelf, Environment *ev, 
		string buf, 
		long len, 
		long ObjIntId);
typedef somTP_SOMRReplicbl_somrApplyUpdates *somTD_SOMRReplicbl_somrApplyUpdates;
typedef void   SOMLINK somTP_SOMRReplicbl_somrDoDirective(SOMRReplicbl *somSelf, Environment *ev, 
		string str);
typedef somTP_SOMRReplicbl_somrDoDirective *somTD_SOMRReplicbl_somrDoDirective;
typedef void   SOMLINK somTP_SOMRReplicbl_somrPin(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrPin *somTD_SOMRReplicbl_somrPin;
typedef void   SOMLINK somTP_SOMRReplicbl_somrUnPin(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrUnPin *somTD_SOMRReplicbl_somrUnPin;
typedef long   SOMLINK somTP_SOMRReplicbl_somrGetSecurityPolicy(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrGetSecurityPolicy *somTD_SOMRReplicbl_somrGetSecurityPolicy;

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef void   SOMLINK somTP_SOMRReplicbl_somrSetObjName(SOMRReplicbl *somSelf, Environment *ev, 
		string name);
typedef somTP_SOMRReplicbl_somrSetObjName *somTD_SOMRReplicbl_somrSetObjName;
typedef string   SOMLINK somTP_SOMRReplicbl_somrGetObjName(SOMRReplicbl *somSelf, Environment *ev);
typedef somTP_SOMRReplicbl_somrGetObjName *somTD_SOMRReplicbl_somrGetObjName;
typedef void   SOMLINK somTP_SOMRReplicbl_somInit(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somInit *somTD_SOMRReplicbl_somInit;
typedef void   SOMLINK somTP_SOMRReplicbl_somUninit(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somUninit *somTD_SOMRReplicbl_somUninit;
typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultInit(SOMRReplicbl *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_SOMRReplicbl_somDefaultInit *somTD_SOMRReplicbl_somDefaultInit;
typedef void   SOMLINK somTP_SOMRReplicbl_somDestruct(SOMRReplicbl *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_SOMRReplicbl_somDestruct *somTD_SOMRReplicbl_somDestruct;
typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultCopyInit(SOMRReplicbl *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultCopyInit *somTD_SOMRReplicbl_somDefaultCopyInit;
typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultAssign(SOMRReplicbl *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultAssign *somTD_SOMRReplicbl_somDefaultAssign;
typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultConstCopyInit(SOMRReplicbl *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultConstCopyInit *somTD_SOMRReplicbl_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultVCopyInit(SOMRReplicbl *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultVCopyInit *somTD_SOMRReplicbl_somDefaultVCopyInit;
typedef void   SOMLINK somTP_SOMRReplicbl_somDefaultConstVCopyInit(SOMRReplicbl *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultConstVCopyInit *somTD_SOMRReplicbl_somDefaultConstVCopyInit;
typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultConstAssign(SOMRReplicbl *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultConstAssign *somTD_SOMRReplicbl_somDefaultConstAssign;
typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultVAssign(SOMRReplicbl *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultVAssign *somTD_SOMRReplicbl_somDefaultVAssign;
typedef SOMRReplicbl*   SOMLINK somTP_SOMRReplicbl_somDefaultConstVAssign(SOMRReplicbl *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicbl_somDefaultConstVAssign *somTD_SOMRReplicbl_somDefaultConstVAssign;
typedef void   SOMLINK somTP_SOMRReplicbl_somFree(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somFree *somTD_SOMRReplicbl_somFree;
typedef SOMClass*   SOMLINK somTP_SOMRReplicbl_somGetClass(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somGetClass *somTD_SOMRReplicbl_somGetClass;
typedef string   SOMLINK somTP_SOMRReplicbl_somGetClassName(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somGetClassName *somTD_SOMRReplicbl_somGetClassName;
typedef long   SOMLINK somTP_SOMRReplicbl_somGetSize(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somGetSize *somTD_SOMRReplicbl_somGetSize;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somIsA(SOMRReplicbl *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMRReplicbl_somIsA *somTD_SOMRReplicbl_somIsA;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somIsInstanceOf(SOMRReplicbl *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMRReplicbl_somIsInstanceOf *somTD_SOMRReplicbl_somIsInstanceOf;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somRespondsTo(SOMRReplicbl *somSelf, 
		somId mId);
typedef somTP_SOMRReplicbl_somRespondsTo *somTD_SOMRReplicbl_somRespondsTo;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somDispatch(SOMRReplicbl *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMRReplicbl_somDispatch *somTD_SOMRReplicbl_somDispatch;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somClassDispatch(SOMRReplicbl *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMRReplicbl_somClassDispatch *somTD_SOMRReplicbl_somClassDispatch;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somCastObj(SOMRReplicbl *somSelf, 
		SOMClass* cls);
typedef somTP_SOMRReplicbl_somCastObj *somTD_SOMRReplicbl_somCastObj;
typedef boolean   SOMLINK somTP_SOMRReplicbl_somResetObj(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somResetObj *somTD_SOMRReplicbl_somResetObj;
typedef void   SOMLINK somTP_SOMRReplicbl_somDispatchV(SOMRReplicbl *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicbl_somDispatchV *somTD_SOMRReplicbl_somDispatchV;
typedef long   SOMLINK somTP_SOMRReplicbl_somDispatchL(SOMRReplicbl *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicbl_somDispatchL *somTD_SOMRReplicbl_somDispatchL;
typedef void*   SOMLINK somTP_SOMRReplicbl_somDispatchA(SOMRReplicbl *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicbl_somDispatchA *somTD_SOMRReplicbl_somDispatchA;
typedef double   SOMLINK somTP_SOMRReplicbl_somDispatchD(SOMRReplicbl *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicbl_somDispatchD *somTD_SOMRReplicbl_somDispatchD;
typedef SOMObject*   SOMLINK somTP_SOMRReplicbl_somPrintSelf(SOMRReplicbl *somSelf);
typedef somTP_SOMRReplicbl_somPrintSelf *somTD_SOMRReplicbl_somPrintSelf;
typedef void   SOMLINK somTP_SOMRReplicbl_somDumpSelf(SOMRReplicbl *somSelf, 
		long level);
typedef somTP_SOMRReplicbl_somDumpSelf *somTD_SOMRReplicbl_somDumpSelf;
typedef void   SOMLINK somTP_SOMRReplicbl_somDumpSelfInt(SOMRReplicbl *somSelf, 
		long level);
typedef somTP_SOMRReplicbl_somDumpSelfInt *somTD_SOMRReplicbl_somDumpSelfInt;
typedef void   SOMLINK somTP_SOMRReplicbl_somrGetState(SOMRReplicbl *somSelf, Environment *ev, 
		string* buf);
typedef somTP_SOMRReplicbl_somrGetState *somTD_SOMRReplicbl_somrGetState;
typedef void   SOMLINK somTP_SOMRReplicbl_somrSetState(SOMRReplicbl *somSelf, Environment *ev, 
		string buf);
typedef somTP_SOMRReplicbl_somrSetState *somTD_SOMRReplicbl_somrSetState;
}

#endif /* SOMRReplicbl_API */


/*
 * -- This emitter treats Method Tokens as Thunks by default.
 * -- Use the sc modifier "nothunks" to change this default
 */
#undef somresolve_
#define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))

/*
 * -- The C++ Wrapper Class for SOMRReplicbl
 */
class SOMRReplicbl : public SOMRNameable, public SOMRLinearizable
{
/*
 *  This class provides a link to the Replication Framework. Any class derived
 *  from this class can have instances that are replicated in other address
 *  spaces.  To get the ability to replicate, the derived
 *  class has to abide by the following rules (these rules are binding on
 *  further derivations and contained (constituent) subobjects as well):
 * 
 *     1. It must obtain a replica lock before updating its data and must
 *        release the same after the update. (i.e., The update methods
 *        must bracket their code in a (somrLock, somrReleaseNPropagateUpdate)
 *        pair or a (somrLockNLogOp, somrReleaseNPropagateOperation) pair.)
 *     2. If after obtaining the replica lock, if the object decides to abort
 *        an update operation, it must call the appropriate abort method.
 *        (somrReleaseLockNAbortOp or somrReleaseLockNAbortUpdate)
 *     3. In case value logging is used, it must have an update language in which
 *        changes in the state of the object can be described.
 *     4. In case value logging is used, it must provide a method to receive and
 *        interpret update messages propagated by other replicas. (i.e., Must implement
 *        somrApplyUpdates method. When there are subobjects, this implementation
 *        should call them to interpret the updates appropriate to them.)
 *     5. It must have methods to get and set the complete state of the object (including
 *        any subobjects). (i.e., Must provide implementations for somrGetState
 *        and somrSetState.)
 *     6. It should be able to receive and interpret data replication
 *        directives (e.g., "LOST_CONNECTION", "BECOME_STAND_ALONE", etc. )
 */
public:

// SOMRReplicbl::new creates the class object if necessary, and then uses somNewNoInit
// to allocate memory and create the object. Initialization is in ctors.
void *operator new(size_t)
{
   if (!_SOMRReplicbl) SOMRReplicblNewClass(SOMRReplicbl_MajorVersion,SOMRReplicbl_MinorVersion);
   return (void*)
      SOM_Resolve(_SOMRReplicbl,SOMClass,somNewNoInit)
         ((SOMClass *)((void*)_SOMRReplicbl));
}

// SOMRReplicbl::delete uses somDestruct.
void operator delete(void * obj)
{
   if (obj && *(void**)obj) {
      SOM_Resolve(obj,SOMObject,somFree)
         ((SOMObject*)obj);
   }
}

SOMRReplicbl& operator=(SOMRReplicbl& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

SOMRReplicbl()
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (SOMRReplicblCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

SOMRReplicbl(SOMRReplicbl* fromObj)
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (SOMRReplicblCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}

#ifdef __IBMCPP__
#pragma info(nocnv,nopar)
#endif
SOMRReplicbl(const SOMRReplicbl* fromObj)
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (SOMRReplicblCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
}
#ifdef __IBMCPP__
#pragma info(restore)
#endif


/* method: somrLock */
void   somrLock(Environment *ev)
{
/*
 *  Get a lock on this replica of the object. An exception is raised if the
 *  lock is not obtained.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrLock)
	(this, ev);
}


/* va_list method: somrLockNlogOp */

/*
 *  Similar to somrLock, but it also logs the method (i.e., MthdName) that is
 *  requesting the lock.
 *  The va_list parameter is for specifying the actual arguments with which "MthdName" is
 *  being called.
 */
/* the va_list invocation form */
void   SOMRReplicbl_somrLockNlogOp(Environment *ev, 
		string ClassName, 
		string MthdName, 
		va_list ap)
{   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrLockNlogOp)
	(this, ev,ClassName,MthdName,ap);
}

/* the varargs invocation form */
void   somrLockNlogOp(Environment *ev, 
		string ClassName, 
		string MthdName, 
		...)
{
/*
 *  Similar to somrLock, but it also logs the method (i.e., MthdName) that is
 *  requesting the lock.
 *  The va_list parameter is for specifying the actual arguments with which "MthdName" is
 *  being called.
 */
   va_list ap;
   va_start(ap, MthdName);
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrLockNlogOp)
	(this, ev,ClassName,MthdName,ap);
   va_end(ap);
}


/* method: somrReleaseNPropagateUpdate */
void   somrReleaseNPropagateUpdate(Environment *ev, 
		string clsname, 
		string buf, 
		long len, 
		long intOid)
{
/*
 *  Release the lock locally and propagate the local updates to master and or
 *  other shadows by calling the local replica manager. This propagates
 *  "value log" of state changes. The parameter intOid is used to indicate
 *  a subobject id to which this update is to be applied. If there are no
 *  subobjects, this argument is to be set to 0.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseNPropagateUpdate)
	(this, ev,clsname,buf,len,intOid);
}


/* method: somrReleaseLockNAbortUpdate */
void   somrReleaseLockNAbortUpdate(Environment *ev)
{
/*
 *  Lets the data replication framework know that the user decided to abort
 *  the operation he/she began by calling somrLock. Once a lock is
 *  obtained, either this method or somrReleaseNPropagateUpdate must
 *  be called.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseLockNAbortUpdate)
	(this, ev);
}


/* method: somrReleaseNPropagateOperation */
void   somrReleaseNPropagateOperation(Environment *ev)
{
/*
 *  Similar to Propagate update, except now propagate the "operation log"
 *  instead of the value log  prepared by the subclass implementation.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseNPropagateOperation)
	(this, ev);
}


/* method: somrReleaseLockNAbortOp */
void   somrReleaseLockNAbortOp(Environment *ev)
{
/*
 *  Lets the data replication framework know that the user decided to abort
 *  the operation that he/she began by calling somrLockNLogOp. Once a lock
 *  is obtained, either this method or somrReleaseNPropagateOperation must
 *  be called
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrReleaseLockNAbortOp)
	(this, ev);
}


/* method: somrRepInit */
long   somrRepInit(Environment *ev, 
		char lType, 
		char mode)
{
/*
 *  Makes the object ready for replication. A derived object
 *  MUST call this method for activating replica control.  The parameter
 *  lType indicates the type of logging used: 'v' for value logging and 'o'
 *  for operation logging.  The parameter mode indicates whether the
 *  object is opened for reading("r") or writing ("w").
 * 
 *  If no errors occur, a return value of 1 indicates that this is the first
 *  replica to be activated (i.e., the Master), and 0 indicates it is a shadow.
 * 
 *  If an error occurs, an exception is raised, and the return value is
 *  indeterminate (and should be ignored).
 * 
 *  If the object is already initialized, no action is taken, and a return
 *  code of 0 is returned.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrRepInit)
	(this, ev,lType,mode);
}


/* method: somrRepUninit */
void   somrRepUninit(Environment *ev)
{
/*
 *  Destroys the set up for replication.
 *  If the object is not initialized for replication, no action is taken.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrRepUninit)
	(this, ev);
}


/* method: somrApplyUpdates */
void   somrApplyUpdates(Environment *ev, 
		string buf, 
		long len, 
		long ObjIntId)
{
/*
 *  This method interprets the buffer received as an update to its state.
 *  The format of this update is exactly the same as the one used by the
 *  subclass implementor for the update buffer passed to ReleaseNPropagateUpdate
 *  method. The ObjIntId parameter indicates the internal subobject id to which
 *  this update should be applied. If it is 0, then the update is to be applied
 *  to self.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrApplyUpdates)
	(this, ev,buf,len,ObjIntId);
}


/* method: somrDoDirective */
void   somrDoDirective(Environment *ev, 
		string str)
{
/*
 *  The string gives a directive to the object to implement. The directive usually
 *  indications a condition that warrants user intervention/awareness.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrDoDirective)
	(this, ev,str);
}


/* method: somrPin */
void   somrPin(Environment *ev)
{
/*
 *  Makes the replica lock obtained by this replica stay with it until a call
 *  to UnPin is made.  That is, it makes the replica lock un-preemptible.
 *  Raises an Exception if the lock is denied (SOMR_DENIED).
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrPin)
	(this, ev);
}


/* method: somrUnPin */
void   somrUnPin(Environment *ev)
{
/*
 *  Declares the replica lock preemptible. That is, other shadows can grab the
 *  replica lock from this shadow.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrUnPin)
	(this, ev);
}


/* method: somrGetSecurityPolicy */
long   somrGetSecurityPolicy(Environment *ev)
{
/*
 *   Returns the security policy for replicated objects that are either
 *   non-persistent or persistent but haven't been created yet.
 *   Caveat: Meaningful only on AIX. Ignored for OS/2.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMRReplicbl,somrGetSecurityPolicy)
	(this, ev);
}


/*
 * Reintroduce inherited methods
 */

/* method: somrSetObjName */
void   somrSetObjName(Environment *ev, 
		string name)
{
/*
 *  Sets the internal pointer to "name" .
 *            The OWNERSHIP of the string is transferred to this object.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRNameable,somrSetObjName)
	(this, ev,name);
}


/* method: somrGetObjName */
string   somrGetObjName(Environment *ev)
{
/*
 *  Returns a pointer to the name string.
 *           The OWNERSHIP of the string stays with this object.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMRNameable,somrGetObjName)
	(this, ev);
}


/* method: somInit */
void   somInit()
{
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somInit)
	(this);
}


/* method: somUninit */
void   somUninit()
{
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somUninit)
	(this);
}


/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
/*
 *  A default initializer for a SOM object. Passing a null ctrl
 *  indicates to the receiver that its class is the class of the
 *  object being initialized, whereby the initializer will determine
 *  an appropriate control structure.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultInit)
	(this,ctrl);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
/*
 *  The default destructor for a SOM object. A nonzero <doFree>
 *  indicates that the object storage should be freed by the
 *  object's class (via somDeallocate) after uninitialization.
 *  As with somDefaultInit, a null ctrl can be passed.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDestruct)
	(this,doFree,ctrl);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultAssign */
SOMRReplicbl*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultAssign)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstCopyInit)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultVCopyInit)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstVCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultConstAssign */
SOMRReplicbl*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstAssign)
	(this,ctrl,fromObj);
}


/* method: somDefaultVAssign */
SOMRReplicbl*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultVAssign)
	(this,ctrl,fromObj);
}


/* method: somDefaultConstVAssign */
SOMRReplicbl*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDefaultConstVAssign)
	(this,ctrl,fromObj);
}


/* method: somFree */
void   somFree()
{
/*
 *  Use as directed by framework implementations.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somFree)
	(this);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somGetClass)
	(this);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somGetClassName)
	(this);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somGetSize)
	(this);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somIsA)
	(this,aClassObj);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somIsInstanceOf)
	(this,aClassObj);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somRespondsTo)
	(this,mId);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 */
/* the va_list invocation form */
boolean   SOMRReplicbl_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatch)
	(this,retValue,methodId,ap);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatch)
	(this,retValue,methodId,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   SOMRReplicbl_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somClassDispatch)
	(this,clsObj,retValue,methodId,ap);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      SOM_ResolveD(this,SOMRReplicbl,SOMObject,somClassDispatch)
	(this,clsObj,retValue,methodId,ap);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* cls)
{
/*
 *  cast the receiving object to cls (which must be an ancestor of the
 *  objects true class. Returns true on success.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somCastObj)
	(this,cls);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somResetObj)
	(this);
}


/* va_list method: somDispatchV */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void   SOMRReplicbl_somDispatchV(somId methodId, 
		somId descriptor, 
		va_list ap)
{   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
void   somDispatchV(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
   va_end(ap);
}


/* va_list method: somDispatchL */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
long   SOMRReplicbl_somDispatchL(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchL)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
long   somDispatchL(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   long __somResult = 
      SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchL)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somDispatchA */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void*   SOMRReplicbl_somDispatchA(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchA)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
void*   somDispatchA(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   void* __somResult = 
      SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchA)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somDispatchD */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
double   SOMRReplicbl_somDispatchD(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchD)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
double   somDispatchD(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   double __somResult = 
      SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDispatchD)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* method: somPrintSelf */
SOMObject*   somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return SOM_ResolveD(this,SOMRReplicbl,SOMObject,somPrintSelf)
	(this);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDumpSelf)
	(this,level);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMObject,somDumpSelfInt)
	(this,level);
}


/* method: somrGetState */
void   somrGetState(Environment *ev, 
		string* buf)
{
/*
 *  Converts its internal state into a linear string and returns a
 *  pointer to the string (the length of the string is in the
 *  first sizeof(int) bytes of this string).   The implementer of this
 *  method should allocate the necessary memory for the string.
 *  The OWNERSHIP of this string is transferred to the caller of this method.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRLinearizable,somrGetState)
	(this, ev,buf);
}


/* method: somrSetState */
void   somrSetState(Environment *ev, 
		string buf)
{
/*
 *  The reverse of Get State. It converts the given linear string into
 *  its internal state.  The ownership of buf stays with the caller.
 */
   SOM_ResolveD(this,SOMRReplicbl,SOMRLinearizable,somrSetState)
	(this, ev,buf);
}



};   /* SOMRReplicbl */



#endif       /* SOM_SOMRReplicbl_xh */
