
/*
 * This file was generated by the SOM Compiler.
 * FileName: somrcls.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_SOMRReplicableObject_xh
#define SOM_SOMRReplicableObject_xh

class SOMRReplicableObject;

#define SOMRReplicableObject_MajorVersion 2
#define SOMRReplicableObject_MinorVersion 1

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

/* C++ parent defs */
#ifndef SOM_SOMRReplicbl_xh
#include <replicbl.xh>
#endif

/*
 * C++ metaclass def
 */
#include <somrmcls.xh>

#ifndef SOMRReplicableObject_API
#define SOMRReplicableObject_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 SOMRReplicableObject Class */
class SOMRReplicable;
SOMEXTERN SOMRReplicable * SOMLINK SOMRReplicableObjectNewClass(
		integer4 majorVersion,
		integer4 minorVersion);

/* The API to the SOMRReplicableObject class object, and the methods it introduces. */
SOMEXTERN struct SOMRReplicableObjectClassDataStructure {
	SOMRReplicable *classObject;
	somMToken somrLoggingType;
	somMToken somrReplicableExemptMethod;
} SOMDLINK SOMRReplicableObjectClassData;
#define _SOMRReplicableObject SOMRReplicableObjectClassData.classObject

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

/*
 * -- Typedefs for SOMRReplicableObject Method Procedures
 */
SOMEXTERN {
typedef char   SOMLINK somTP_SOMRReplicableObject_somrLoggingType(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrLoggingType *somTD_SOMRReplicableObject_somrLoggingType;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somrReplicableExemptMethod(SOMRReplicableObject *somSelf, Environment *ev, 
		somId methodId);
typedef somTP_SOMRReplicableObject_somrReplicableExemptMethod *somTD_SOMRReplicableObject_somrReplicableExemptMethod;

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef void   SOMLINK somTP_SOMRReplicableObject_somrLock(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrLock *somTD_SOMRReplicableObject_somrLock;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrLockNlogOp(SOMRReplicableObject *somSelf, Environment *ev, 
		string ClassName, 
		string MthdName, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somrLockNlogOp *somTD_SOMRReplicableObject_somrLockNlogOp;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrReleaseNPropagateUpdate(SOMRReplicableObject *somSelf, Environment *ev, 
		string clsname, 
		string buf, 
		long len, 
		long intOid);
typedef somTP_SOMRReplicableObject_somrReleaseNPropagateUpdate *somTD_SOMRReplicableObject_somrReleaseNPropagateUpdate;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrReleaseLockNAbortUpdate(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrReleaseLockNAbortUpdate *somTD_SOMRReplicableObject_somrReleaseLockNAbortUpdate;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrReleaseNPropagateOperation(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrReleaseNPropagateOperation *somTD_SOMRReplicableObject_somrReleaseNPropagateOperation;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrReleaseLockNAbortOp(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrReleaseLockNAbortOp *somTD_SOMRReplicableObject_somrReleaseLockNAbortOp;
typedef long   SOMLINK somTP_SOMRReplicableObject_somrRepInit(SOMRReplicableObject *somSelf, Environment *ev, 
		char lType, 
		char mode);
typedef somTP_SOMRReplicableObject_somrRepInit *somTD_SOMRReplicableObject_somrRepInit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrRepUninit(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrRepUninit *somTD_SOMRReplicableObject_somrRepUninit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrApplyUpdates(SOMRReplicableObject *somSelf, Environment *ev, 
		string buf, 
		long len, 
		long ObjIntId);
typedef somTP_SOMRReplicableObject_somrApplyUpdates *somTD_SOMRReplicableObject_somrApplyUpdates;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrDoDirective(SOMRReplicableObject *somSelf, Environment *ev, 
		string str);
typedef somTP_SOMRReplicableObject_somrDoDirective *somTD_SOMRReplicableObject_somrDoDirective;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrPin(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrPin *somTD_SOMRReplicableObject_somrPin;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrUnPin(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrUnPin *somTD_SOMRReplicableObject_somrUnPin;
typedef long   SOMLINK somTP_SOMRReplicableObject_somrGetSecurityPolicy(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrGetSecurityPolicy *somTD_SOMRReplicableObject_somrGetSecurityPolicy;
typedef void   SOMLINK somTP_SOMRReplicableObject_somInit(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somInit *somTD_SOMRReplicableObject_somInit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somUninit(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somUninit *somTD_SOMRReplicableObject_somUninit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrSetObjName(SOMRReplicableObject *somSelf, Environment *ev, 
		string name);
typedef somTP_SOMRReplicableObject_somrSetObjName *somTD_SOMRReplicableObject_somrSetObjName;
typedef string   SOMLINK somTP_SOMRReplicableObject_somrGetObjName(SOMRReplicableObject *somSelf, Environment *ev);
typedef somTP_SOMRReplicableObject_somrGetObjName *somTD_SOMRReplicableObject_somrGetObjName;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDefaultInit(SOMRReplicableObject *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_SOMRReplicableObject_somDefaultInit *somTD_SOMRReplicableObject_somDefaultInit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDestruct(SOMRReplicableObject *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_SOMRReplicableObject_somDestruct *somTD_SOMRReplicableObject_somDestruct;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDefaultCopyInit(SOMRReplicableObject *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultCopyInit *somTD_SOMRReplicableObject_somDefaultCopyInit;
typedef SOMRReplicableObject*   SOMLINK somTP_SOMRReplicableObject_somDefaultAssign(SOMRReplicableObject *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultAssign *somTD_SOMRReplicableObject_somDefaultAssign;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDefaultConstCopyInit(SOMRReplicableObject *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultConstCopyInit *somTD_SOMRReplicableObject_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDefaultVCopyInit(SOMRReplicableObject *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultVCopyInit *somTD_SOMRReplicableObject_somDefaultVCopyInit;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDefaultConstVCopyInit(SOMRReplicableObject *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultConstVCopyInit *somTD_SOMRReplicableObject_somDefaultConstVCopyInit;
typedef SOMRReplicableObject*   SOMLINK somTP_SOMRReplicableObject_somDefaultConstAssign(SOMRReplicableObject *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultConstAssign *somTD_SOMRReplicableObject_somDefaultConstAssign;
typedef SOMRReplicableObject*   SOMLINK somTP_SOMRReplicableObject_somDefaultVAssign(SOMRReplicableObject *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultVAssign *somTD_SOMRReplicableObject_somDefaultVAssign;
typedef SOMRReplicableObject*   SOMLINK somTP_SOMRReplicableObject_somDefaultConstVAssign(SOMRReplicableObject *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMRReplicableObject_somDefaultConstVAssign *somTD_SOMRReplicableObject_somDefaultConstVAssign;
typedef void   SOMLINK somTP_SOMRReplicableObject_somFree(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somFree *somTD_SOMRReplicableObject_somFree;
typedef SOMRReplicable*   SOMLINK somTP_SOMRReplicableObject_somGetClass(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somGetClass *somTD_SOMRReplicableObject_somGetClass;
typedef string   SOMLINK somTP_SOMRReplicableObject_somGetClassName(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somGetClassName *somTD_SOMRReplicableObject_somGetClassName;
typedef long   SOMLINK somTP_SOMRReplicableObject_somGetSize(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somGetSize *somTD_SOMRReplicableObject_somGetSize;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somIsA(SOMRReplicableObject *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMRReplicableObject_somIsA *somTD_SOMRReplicableObject_somIsA;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somIsInstanceOf(SOMRReplicableObject *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMRReplicableObject_somIsInstanceOf *somTD_SOMRReplicableObject_somIsInstanceOf;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somRespondsTo(SOMRReplicableObject *somSelf, 
		somId mId);
typedef somTP_SOMRReplicableObject_somRespondsTo *somTD_SOMRReplicableObject_somRespondsTo;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somDispatch(SOMRReplicableObject *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somDispatch *somTD_SOMRReplicableObject_somDispatch;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somClassDispatch(SOMRReplicableObject *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somClassDispatch *somTD_SOMRReplicableObject_somClassDispatch;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somCastObj(SOMRReplicableObject *somSelf, 
		SOMClass* cls);
typedef somTP_SOMRReplicableObject_somCastObj *somTD_SOMRReplicableObject_somCastObj;
typedef boolean   SOMLINK somTP_SOMRReplicableObject_somResetObj(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somResetObj *somTD_SOMRReplicableObject_somResetObj;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDispatchV(SOMRReplicableObject *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somDispatchV *somTD_SOMRReplicableObject_somDispatchV;
typedef long   SOMLINK somTP_SOMRReplicableObject_somDispatchL(SOMRReplicableObject *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somDispatchL *somTD_SOMRReplicableObject_somDispatchL;
typedef void*   SOMLINK somTP_SOMRReplicableObject_somDispatchA(SOMRReplicableObject *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somDispatchA *somTD_SOMRReplicableObject_somDispatchA;
typedef double   SOMLINK somTP_SOMRReplicableObject_somDispatchD(SOMRReplicableObject *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMRReplicableObject_somDispatchD *somTD_SOMRReplicableObject_somDispatchD;
typedef SOMObject*   SOMLINK somTP_SOMRReplicableObject_somPrintSelf(SOMRReplicableObject *somSelf);
typedef somTP_SOMRReplicableObject_somPrintSelf *somTD_SOMRReplicableObject_somPrintSelf;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDumpSelf(SOMRReplicableObject *somSelf, 
		long level);
typedef somTP_SOMRReplicableObject_somDumpSelf *somTD_SOMRReplicableObject_somDumpSelf;
typedef void   SOMLINK somTP_SOMRReplicableObject_somDumpSelfInt(SOMRReplicableObject *somSelf, 
		long level);
typedef somTP_SOMRReplicableObject_somDumpSelfInt *somTD_SOMRReplicableObject_somDumpSelfInt;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrGetState(SOMRReplicableObject *somSelf, Environment *ev, 
		string* buf);
typedef somTP_SOMRReplicableObject_somrGetState *somTD_SOMRReplicableObject_somrGetState;
typedef void   SOMLINK somTP_SOMRReplicableObject_somrSetState(SOMRReplicableObject *somSelf, Environment *ev, 
		string buf);
typedef somTP_SOMRReplicableObject_somrSetState *somTD_SOMRReplicableObject_somrSetState;
}

#endif /* SOMRReplicableObject_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 SOMRReplicableObject
 */
class SOMRReplicableObject : public SOMRReplicbl
{
public:

// SOMRReplicableObject::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 (!_SOMRReplicableObject) SOMRReplicableObjectNewClass(SOMRReplicableObject_MajorVersion,SOMRReplicableObject_MinorVersion);
   return (void*)
      SOM_Resolve(_SOMRReplicableObject,SOMClass,somNewNoInit)
         ((SOMClass *)((void*)_SOMRReplicableObject));
}

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

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

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

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

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


/* method: somrLoggingType */
char   somrLoggingType(Environment *ev)
{
   return SOM_ResolveD(this,SOMRReplicableObject,SOMRReplicableObject,somrLoggingType)
	(this, ev);
}


/* method: somrReplicableExemptMethod */
boolean   somrReplicableExemptMethod(Environment *ev, 
		somId methodId)
{
   return SOM_ResolveD(this,SOMRReplicableObject,SOMRReplicableObject,somrReplicableExemptMethod)
	(this, ev,methodId);
}


/*
 * Reintroduce inherited methods
 */

/* 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,SOMRReplicableObject,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   SOMRReplicableObject_somrLockNlogOp(Environment *ev, 
		string ClassName, 
		string MthdName, 
		va_list ap)
{   SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,SOMRReplicbl,somrGetSecurityPolicy)
	(this, ev);
}


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


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


/* method: somrSetObjName */
void   somrSetObjName(Environment *ev, 
		string name)
{
   SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,SOMRNameable,somrGetObjName)
	(this, ev);
}


/* 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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,SOMObject,somDefaultCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultAssign */
SOMRReplicableObject*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,SOMObject,somDefaultConstVCopyInit)
	(this,ctrl,fromObj);
}


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


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


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


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


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


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


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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   SOMRReplicableObject_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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   SOMRReplicableObject_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,SOMObject,somCastObj)
	(this,cls);
}


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


/* va_list method: somDispatchV */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void   SOMRReplicableObject_somDispatchV(somId methodId, 
		somId descriptor, 
		va_list ap)
{   SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
   va_end(ap);
}


/* va_list method: somDispatchL */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
long   SOMRReplicableObject_somDispatchL(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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*   SOMRReplicableObject_somDispatchA(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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   SOMRReplicableObject_somDispatchD(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,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,SOMRReplicableObject,SOMRLinearizable,somrSetState)
	(this, ev,buf);
}



};   /* SOMRReplicableObject */



#endif       /* SOM_SOMRReplicableObject_xh */
