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

/*
 *    IDL interface spec for SOM Object Adapter (derived from BOA)
 * 
 *    This is DSOM's primary Object Adapter.  It implements the BOA interface.
 */


#ifndef SOM_SOMOA_xh
#define SOM_SOMOA_xh

class SOMOA;

#define SOMOA_MajorVersion 2
#define SOMOA_MinorVersion 1

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

/* C++ parent defs */
#ifndef SOM_BOA_xh
#include <boa.xh>
#endif

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

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;
class Container;
class SOMDObject;
class Principal;
class ImplementationDef;
class InterfaceDef;
class Context;

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

/*
 * Passthru lines: File: "C.xh", "after"
 */

#define SOMD_WAIT     1
#define SOMD_NO_WAIT  0
#define SOMD_IMPL_NOT_INITIALIZED          0
#define SOMD_IMPL_NOT_ACTIVE               1
#define SOMD_IMPL_ACTIVE                   2

class SOMOA;
SOMEXTERN SOMOA * SOMDLINK SOMD_SOMOAObject;


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

/* The API to the SOMOA class object, and the methods it introduces. */
SOMEXTERN struct SOMOAClassDataStructure {
	SOMClass *classObject;
	somMToken execute_next_request;
	somMToken execute_request_loop;
	somMToken create_constant;
	somMToken change_id;
	somMToken create_SOM_ref;
	somMToken get_SOM_object;
	somMToken activate_impl_failed;
	somMToken interrupt_server;
} SOMDLINK SOMOAClassData;
#define _SOMOA SOMOAClassData.classObject

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

/*
 * -- Typedefs for SOMOA Method Procedures
 */
SOMEXTERN {
typedef ORBStatus   SOMLINK somTP_SOMOA_execute_next_request(SOMOA *somSelf, Environment *ev, 
		Flags waitFlag);
typedef somTP_SOMOA_execute_next_request *somTD_SOMOA_execute_next_request;
typedef ORBStatus   SOMLINK somTP_SOMOA_execute_request_loop(SOMOA *somSelf, Environment *ev, 
		Flags waitFlag);
typedef somTP_SOMOA_execute_request_loop *somTD_SOMOA_execute_request_loop;
typedef void   SOMLINK somTP_SOMOA_change_id(SOMOA *somSelf, Environment *ev, 
		SOMDObject* objref, 
		ReferenceData* id);
typedef somTP_SOMOA_change_id *somTD_SOMOA_change_id;
typedef SOMDObject*   SOMLINK somTP_SOMOA_create_constant(SOMOA *somSelf, Environment *ev, 
		ReferenceData* id, 
		InterfaceDef* intf, 
		ImplementationDef* impl);
typedef somTP_SOMOA_create_constant *somTD_SOMOA_create_constant;
typedef SOMDObject*   SOMLINK somTP_SOMOA_create_SOM_ref(SOMOA *somSelf, Environment *ev, 
		SOMObject* somobj, 
		ImplementationDef* impl);
typedef somTP_SOMOA_create_SOM_ref *somTD_SOMOA_create_SOM_ref;
typedef SOMObject*   SOMLINK somTP_SOMOA_get_SOM_object(SOMOA *somSelf, Environment *ev, 
		SOMDObject* somref);
typedef somTP_SOMOA_get_SOM_object *somTD_SOMOA_get_SOM_object;
typedef void   SOMLINK somTP_SOMOA_activate_impl_failed(SOMOA *somSelf, Environment *ev, 
		ImplementationDef* impl, 
		ORBStatus rc);
typedef somTP_SOMOA_activate_impl_failed *somTD_SOMOA_activate_impl_failed;
typedef void   SOMLINK somTP_SOMOA_interrupt_server(SOMOA *somSelf, Environment *ev);
typedef somTP_SOMOA_interrupt_server *somTD_SOMOA_interrupt_server;

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef SOMDObject*   SOMLINK somTP_SOMOA_create(SOMOA *somSelf, Environment *ev, 
		ReferenceData* id, 
		InterfaceDef* intf, 
		ImplementationDef* impl);
typedef somTP_SOMOA_create *somTD_SOMOA_create;
typedef void   SOMLINK somTP_SOMOA_dispose(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj);
typedef somTP_SOMOA_dispose *somTD_SOMOA_dispose;
typedef ReferenceData   SOMLINK somTP_SOMOA_get_id(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj);
typedef somTP_SOMOA_get_id *somTD_SOMOA_get_id;
typedef Principal*   SOMLINK somTP_SOMOA_get_principal(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj, 
		Environment* req_ev);
typedef somTP_SOMOA_get_principal *somTD_SOMOA_get_principal;
typedef void   SOMLINK somTP_SOMOA_set_exception(SOMOA *somSelf, Environment *ev, 
		exception_type major, 
		string userid, 
		void* param);
typedef somTP_SOMOA_set_exception *somTD_SOMOA_set_exception;
typedef void   SOMLINK somTP_SOMOA_impl_is_ready(SOMOA *somSelf, Environment *ev, 
		ImplementationDef* impl);
typedef somTP_SOMOA_impl_is_ready *somTD_SOMOA_impl_is_ready;
typedef void   SOMLINK somTP_SOMOA_deactivate_impl(SOMOA *somSelf, Environment *ev, 
		ImplementationDef* impl);
typedef somTP_SOMOA_deactivate_impl *somTD_SOMOA_deactivate_impl;
typedef void   SOMLINK somTP_SOMOA_change_implementation(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj, 
		ImplementationDef* impl);
typedef somTP_SOMOA_change_implementation *somTD_SOMOA_change_implementation;
typedef void   SOMLINK somTP_SOMOA_obj_is_ready(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj, 
		ImplementationDef* impl);
typedef somTP_SOMOA_obj_is_ready *somTD_SOMOA_obj_is_ready;
typedef void   SOMLINK somTP_SOMOA_deactivate_obj(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj);
typedef somTP_SOMOA_deactivate_obj *somTD_SOMOA_deactivate_obj;
typedef void   SOMLINK somTP_SOMOA_somDefaultInit(SOMOA *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_SOMOA_somDefaultInit *somTD_SOMOA_somDefaultInit;
typedef void   SOMLINK somTP_SOMOA_somDestruct(SOMOA *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_SOMOA_somDestruct *somTD_SOMOA_somDestruct;
typedef void   SOMLINK somTP_SOMOA_somDefaultCopyInit(SOMOA *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultCopyInit *somTD_SOMOA_somDefaultCopyInit;
typedef SOMOA*   SOMLINK somTP_SOMOA_somDefaultAssign(SOMOA *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultAssign *somTD_SOMOA_somDefaultAssign;
typedef void   SOMLINK somTP_SOMOA_somDefaultConstCopyInit(SOMOA *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultConstCopyInit *somTD_SOMOA_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_SOMOA_somDefaultVCopyInit(SOMOA *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultVCopyInit *somTD_SOMOA_somDefaultVCopyInit;
typedef void   SOMLINK somTP_SOMOA_somDefaultConstVCopyInit(SOMOA *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultConstVCopyInit *somTD_SOMOA_somDefaultConstVCopyInit;
typedef SOMOA*   SOMLINK somTP_SOMOA_somDefaultConstAssign(SOMOA *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultConstAssign *somTD_SOMOA_somDefaultConstAssign;
typedef SOMOA*   SOMLINK somTP_SOMOA_somDefaultVAssign(SOMOA *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultVAssign *somTD_SOMOA_somDefaultVAssign;
typedef SOMOA*   SOMLINK somTP_SOMOA_somDefaultConstVAssign(SOMOA *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_SOMOA_somDefaultConstVAssign *somTD_SOMOA_somDefaultConstVAssign;
typedef void   SOMLINK somTP_SOMOA_somInit(SOMOA *somSelf);
typedef somTP_SOMOA_somInit *somTD_SOMOA_somInit;
typedef void   SOMLINK somTP_SOMOA_somFree(SOMOA *somSelf);
typedef somTP_SOMOA_somFree *somTD_SOMOA_somFree;
typedef void   SOMLINK somTP_SOMOA_somUninit(SOMOA *somSelf);
typedef somTP_SOMOA_somUninit *somTD_SOMOA_somUninit;
typedef SOMClass*   SOMLINK somTP_SOMOA_somGetClass(SOMOA *somSelf);
typedef somTP_SOMOA_somGetClass *somTD_SOMOA_somGetClass;
typedef string   SOMLINK somTP_SOMOA_somGetClassName(SOMOA *somSelf);
typedef somTP_SOMOA_somGetClassName *somTD_SOMOA_somGetClassName;
typedef long   SOMLINK somTP_SOMOA_somGetSize(SOMOA *somSelf);
typedef somTP_SOMOA_somGetSize *somTD_SOMOA_somGetSize;
typedef boolean   SOMLINK somTP_SOMOA_somIsA(SOMOA *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMOA_somIsA *somTD_SOMOA_somIsA;
typedef boolean   SOMLINK somTP_SOMOA_somIsInstanceOf(SOMOA *somSelf, 
		SOMClass* aClassObj);
typedef somTP_SOMOA_somIsInstanceOf *somTD_SOMOA_somIsInstanceOf;
typedef boolean   SOMLINK somTP_SOMOA_somRespondsTo(SOMOA *somSelf, 
		somId mId);
typedef somTP_SOMOA_somRespondsTo *somTD_SOMOA_somRespondsTo;
typedef boolean   SOMLINK somTP_SOMOA_somDispatch(SOMOA *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMOA_somDispatch *somTD_SOMOA_somDispatch;
typedef boolean   SOMLINK somTP_SOMOA_somClassDispatch(SOMOA *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMOA_somClassDispatch *somTD_SOMOA_somClassDispatch;
typedef boolean   SOMLINK somTP_SOMOA_somCastObj(SOMOA *somSelf, 
		SOMClass* cls);
typedef somTP_SOMOA_somCastObj *somTD_SOMOA_somCastObj;
typedef boolean   SOMLINK somTP_SOMOA_somResetObj(SOMOA *somSelf);
typedef somTP_SOMOA_somResetObj *somTD_SOMOA_somResetObj;
typedef void   SOMLINK somTP_SOMOA_somDispatchV(SOMOA *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMOA_somDispatchV *somTD_SOMOA_somDispatchV;
typedef long   SOMLINK somTP_SOMOA_somDispatchL(SOMOA *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMOA_somDispatchL *somTD_SOMOA_somDispatchL;
typedef void*   SOMLINK somTP_SOMOA_somDispatchA(SOMOA *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMOA_somDispatchA *somTD_SOMOA_somDispatchA;
typedef double   SOMLINK somTP_SOMOA_somDispatchD(SOMOA *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_SOMOA_somDispatchD *somTD_SOMOA_somDispatchD;
typedef SOMObject*   SOMLINK somTP_SOMOA_somPrintSelf(SOMOA *somSelf);
typedef somTP_SOMOA_somPrintSelf *somTD_SOMOA_somPrintSelf;
typedef void   SOMLINK somTP_SOMOA_somDumpSelf(SOMOA *somSelf, 
		long level);
typedef somTP_SOMOA_somDumpSelf *somTD_SOMOA_somDumpSelf;
typedef void   SOMLINK somTP_SOMOA_somDumpSelfInt(SOMOA *somSelf, 
		long level);
typedef somTP_SOMOA_somDumpSelfInt *somTD_SOMOA_somDumpSelfInt;
}

#endif /* SOMOA_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 SOMOA
 */
class SOMOA : public BOA
{
public:

// SOMOA::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 (!_SOMOA) SOMOANewClass(SOMOA_MajorVersion,SOMOA_MinorVersion);
   return (void*)
      SOM_Resolve(_SOMOA,SOMClass,somNewNoInit)
         ((SOMClass *)((void*)_SOMOA));
}

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

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

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

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

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


/* method: execute_next_request */
ORBStatus   execute_next_request(Environment *ev, 
		Flags waitFlag)
{
/*
 *  This method receives a single request message, executes it, and
 *  sends the result to the calling client.  If waitFlag is SOMD_WAIT,
 *  the call will block if there is no message pending.  If waitFlag
 *  is SOMD_NO_WAIT, the call will immediately return "SOMDERROR_NoMessages"
 *  if there is no message pending.
 * 
 *  ("SOMDERROR_NoMessage" is only returned as a status code, not as an
 *  exception structure.)
 */
   return SOM_ResolveD(this,SOMOA,SOMOA,execute_next_request)
	(this, ev,waitFlag);
}


/* method: execute_request_loop */
ORBStatus   execute_request_loop(Environment *ev, 
		Flags waitFlag)
{
/*
 *  Repeatedly calls execute_next_request.  If waitFlag is SOMD_WAIT,
 *  the call will continue to wait for messages when there is no message
 *  pending.  If waitFlag is SOMD_NO_WAIT, the call will process any
 *  messages that are present, and return "SOMD_NoMessages" as soon as there
 *  are no more messages pending.
 * 
 *  ("SOMDERROR_NoMessage" is only returned as a status code, not as an
 *  exception structure.)
 */
   return SOM_ResolveD(this,SOMOA,SOMOA,execute_request_loop)
	(this, ev,waitFlag);
}


/* method: change_id */
void   change_id(Environment *ev, 
		SOMDObject* objref, 
		ReferenceData* id)
{
/*
 *  This method changes the ReferenceData associated with the object
 *  identified by "objref".  The ReferenceData previously stored in the
 *  SOMOA's reference data table is replaced with the value of "id".
 *  The new id value cannot be larger than the maximum size of the
 *  original ReferenceData (usually specified as 1024 bytes).
 */
   SOM_ResolveD(this,SOMOA,SOMOA,change_id)
	(this, ev,objref,id);
}


/* method: create_constant */
SOMDObject*   create_constant(Environment *ev, 
		ReferenceData* id, 
		InterfaceDef* intf, 
		ImplementationDef* impl)
{
/*
 *  This method is a variant of the "create" method.  Like "create", it
 *  creates an object reference for an object (with the specified interface)
 *  and associates the supplied ReferenceData with the object reference.
 *  The ReferenceData can later be retrieved using the "get_id" method.
 *  Unlike "create", this method creates a "contant" reference whose id
 *  value cannot be changed.  (See "change_id" below.)  This is because
 *  the id is part of the object reference state, versus stored in the
 *  SOMOA reference data table.
 * 
 *  This method would be used whenever the application prefers not to
 *  maintain an object's ReferenceData in the SOMOA reference data table.
 */
   return SOM_ResolveD(this,SOMOA,SOMOA,create_constant)
	(this, ev,id,intf,impl);
}


/* method: create_SOM_ref */
SOMDObject*   create_SOM_ref(Environment *ev, 
		SOMObject* somobj, 
		ImplementationDef* impl)
{
/*
 *  This methods creates a simple DSOM reference (SOMDObject) for a local
 *  SOM object.  The reference is "special" in that there is no explicit
 *  ReferenceData associated with the object.  Also, the reference is
 *  only valid while the SOM object exists.
 * 
 *  The SOMObject can be retrieved via the get_SOM_object method.
 *  The SOMDObject::is_SOM_ref method can be used to tell if the
 *  reference was created using create_SOM_ref or not.
 */
   return SOM_ResolveD(this,SOMOA,SOMOA,create_SOM_ref)
	(this, ev,somobj,impl);
}


/* method: get_SOM_object */
SOMObject*   get_SOM_object(Environment *ev, 
		SOMDObject* somref)
{
/*
 *  This method returns the SOM object associated with a SOMDObject
 *  reference created by the create_SOM_ref method.
 */
   return SOM_ResolveD(this,SOMOA,SOMOA,get_SOM_object)
	(this, ev,somref);
}


/* method: activate_impl_failed */
void   activate_impl_failed(Environment *ev, 
		ImplementationDef* impl, 
		ORBStatus rc)
{
/*
 *  Indicates there was an error when activating this implementation.
 *  Called by a server program.  ORBStatus code is returned to the client
 *  in an exception.
 */
   SOM_ResolveD(this,SOMOA,SOMOA,activate_impl_failed)
	(this, ev,impl,rc);
}


/* method: interrupt_server */
void   interrupt_server(Environment *ev)
{
/*
 *  Wakes up a server waiting for a request message.
 */
   SOM_ResolveD(this,SOMOA,SOMOA,interrupt_server)
	(this, ev);
}


/*
 * Reintroduce inherited methods
 */

/* method: create */
SOMDObject*   create(Environment *ev, 
		ReferenceData* id, 
		InterfaceDef* intf, 
		ImplementationDef* impl)
{
/*
 *  Create an object reference.
 */
   return SOM_ResolveD(this,SOMOA,BOA,create)
	(this, ev,id,intf,impl);
}


/* method: dispose */
void   dispose(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Destroy an object reference.
 */
   SOM_ResolveD(this,SOMOA,BOA,dispose)
	(this, ev,obj);
}


/* method: get_id */
ReferenceData   get_id(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Return ReferenceData associated with referenced object.
 */
   return SOM_ResolveD(this,SOMOA,BOA,get_id)
	(this, ev,obj);
}


/* method: get_principal */
Principal*   get_principal(Environment *ev, 
		SOMDObject* obj, 
		Environment* req_ev)
{
/*
 *  Return a Principal object, which describes who issued a request on
 *  the specified object.  The "req_ev" parameter is the Environment
 *  which was passed as part of the request.
 */
   return SOM_ResolveD(this,SOMOA,BOA,get_principal)
	(this, ev,obj,req_ev);
}


/* method: set_exception */
void   set_exception(Environment *ev, 
		exception_type major, 
		string userid, 
		void* param)
{
/*
 *  Return an exception to the client.
 */
   SOM_ResolveD(this,SOMOA,BOA,set_exception)
	(this, ev,major,userid,param);
}


/* method: impl_is_ready */
void   impl_is_ready(Environment *ev, 
		ImplementationDef* impl)
{
/*
 *  Indicate that the implementation is now ready to process requests.
 */
   SOM_ResolveD(this,SOMOA,BOA,impl_is_ready)
	(this, ev,impl);
}


/* method: deactivate_impl */
void   deactivate_impl(Environment *ev, 
		ImplementationDef* impl)
{
/*
 *  Indicate that the implementation is no longer ready to process reqs.
 */
   SOM_ResolveD(this,SOMOA,BOA,deactivate_impl)
	(this, ev,impl);
}


/* method: change_implementation */
void   change_implementation(Environment *ev, 
		SOMDObject* obj, 
		ImplementationDef* impl)
{
/*
 *  Change the implementation associated with the referenced object.
 *  (NOTE: Null implementation in this release of DSOM.)
 */
   SOM_ResolveD(this,SOMOA,BOA,change_implementation)
	(this, ev,obj,impl);
}


/* method: obj_is_ready */
void   obj_is_ready(Environment *ev, 
		SOMDObject* obj, 
		ImplementationDef* impl)
{
/*
 *  Indicate that the object is ready to process requests.
 *  (NOTE: Null implementation in this release of DSOM.)
 */
   SOM_ResolveD(this,SOMOA,BOA,obj_is_ready)
	(this, ev,obj,impl);
}


/* method: deactivate_obj */
void   deactivate_obj(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Indicate that the object is no longer ready to process requests.
 *  (NOTE: Null implementation in this release of DSOM.)
 */
   SOM_ResolveD(this,SOMOA,BOA,deactivate_obj)
	(this, ev,obj);
}


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


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


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


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


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


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   SOM_ResolveD(this,SOMOA,SOMObject,somInit)
	(this);
}


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


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   SOM_ResolveD(this,SOMOA,SOMObject,somUninit)
	(this);
}


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


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


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


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


/* va_list method: somDispatchV */

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


/* va_list method: somDispatchL */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
long   SOMOA_somDispatchL(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMOA,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,SOMOA,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*   SOMOA_somDispatchA(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMOA,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,SOMOA,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   SOMOA_somDispatchD(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,SOMOA,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,SOMOA,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,SOMOA,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,SOMOA,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,SOMOA,SOMObject,somDumpSelfInt)
	(this,level);
}



};   /* SOMOA */



#endif       /* SOM_SOMOA_xh */
