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

/*
 *    @(#) 2.9.1.43 src/somd/somoa.idl, somd, som3.0 9/26/96 14:02:23 [12/22/96 21:11:58]
 * 
 *    COMPONENT_NAME: somd
 * 
 *    ORIGINS: 27
 * 
 *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996
 *    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.
 * 
 * 
 *   SOMOA is DSOM's primary Object Adapter.  It implements and extends the
 *   BOA interface.  SOMOA is the main interface between the server
 *   applications and the DSOM run time.  SOMOA handles all communications
 *   and interpretation of inbound requests and outbound results.  SOMOA
 *   works together with the SOMDServer (or subclass) to create and resolve
 *   DSOM references to local objects and to dispatch methods on objects.
 */


#ifndef SOM_SOMOA_xh
#define SOM_SOMOA_xh


#define SOMOA_MajorVersion 2
#define SOMOA_MinorVersion 2
class SOMOA;

/* Parents */
#ifndef SOM_BOA_xh
#ifdef SOMLOCALINCLUDES
#include "boa.xh"
#else
#include <boa.xh>
#endif
#endif

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

#ifndef SOMOA_API
#define SOMOA_API
/*
 * -- The Class API
 */
#ifndef SOM_IMPORTEXPORT_somd_somoa
#ifdef SOM_DLL_somd
	/* export semantics */
	#if defined(SOM_DEFFILE_somd)\
	||(defined(SOM_DEFFILE_BY_DEFAULT)&&!defined(SOM_NODEFFILE_somd))\
	|| !defined(SOM_Module_somoa_Source)
	#define SOM_IMPORTEXPORT_somd_somoa
	#else
	#define SOM_IMPORTEXPORT_somd_somoa SOMDLLEXPORT
	#endif
#else
	#define SOM_IMPORTEXPORT_somd_somoa SOMDLLIMPORT
#endif
#endif

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;
class Container;
class Principal;
class SOMDObject;
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;
#ifndef SOM_IMPORTEXPORT_somd
#if defined(_WIN32) && !defined(SOM_DLL_somd)
#define SOM_IMPORTEXPORT_somd SOMDLLIMPORT
#else
#define SOM_IMPORTEXPORT_somd
#endif
#endif
SOMEXTERN SOM_IMPORTEXPORT_somd SOMOA * SOMDLINK SOMD_SOMOAObject;


/*
 * A function to create the SOMOA class object...
 */
SOMEXTERN SOM_IMPORTEXPORT_somd_somoa SOMClass * SOMLINK SOMOANewClass(
		integer4 majorVersion,
		integer4 minorVersion);


/*
 * The API 2 ClassData Structures...
 */
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;
	somMToken private1;
	somMToken get_service_contexts;
	somMToken private2;
	somMToken private3;
} SOMDLINK SOM_IMPORTEXPORT_somd_somoa SOMOAClassData;
SOMEXTERN struct SOMOACClassDataStructure {
	som3ClassDetailsPtr    parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOM_IMPORTEXPORT_somd_somoa SOMOACClassData;


/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_SOMOA (SOMOAClassData.classObject)
#ifndef SOMGD_SOMOA
    #if (defined(_SOMOA) || defined(__SOMOA))
        #undef _SOMOA
        #undef __SOMOA
        #define SOMGD_SOMOA 1
    #else
        #define _SOMOA _SOMCLASS_SOMOA
    #endif /* _SOMOA */
#endif /* SOMGD_SOMOA */
#define SOMOA_classObj _SOMCLASS_SOMOA
#define _SOMMTOKEN_SOMOA(method) ((somMToken)SOMOAClassData.method)

/*
 * -- 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;
typedef IIOP_SOMDServiceContextList   SOMLINK somTP_SOMOA_get_service_contexts(SOMOA *somSelf, Environment *ev, 
		SOMDObject* obj);
typedef somTP_SOMOA_get_service_contexts *somTD_SOMOA_get_service_contexts;

/*
 * -- 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_somUninit(SOMOA *somSelf);
typedef somTP_SOMOA_somUninit *somTD_SOMOA_somUninit;
typedef void   SOMLINK somTP_SOMOA_somFree(SOMOA *somSelf);
typedef somTP_SOMOA_somFree *somTD_SOMOA_somFree;
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* castedCls);
typedef somTP_SOMOA_somCastObj *somTD_SOMOA_somCastObj;
typedef boolean   SOMLINK somTP_SOMOA_somResetObj(SOMOA *somSelf);
typedef somTP_SOMOA_somResetObj *somTD_SOMOA_somResetObj;
typedef SOMOA*   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 */


/*
 * -- 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*)
   (((somTD_SOMClass_somNewNoInit)(SOMClassClassData.somNewNoInit))
         ((SOMClass *)((void*)_SOMOA)));
}

// SOMOA::delete uses somFree.
void operator delete(void * obj)
{
   if (obj && *(void**)obj)
      ((SOMObject*)obj)->somFree();
}

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

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

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


/* 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_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_execute_next_request)(SOMOAClassData.execute_next_request))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_execute_request_loop)(SOMOAClassData.execute_request_loop))(((SOMOA *)((void *)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
 *  Object Registry 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_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_change_id)(SOMOAClassData.change_id))(((SOMOA *)((void *)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
 *  Object Registry.
 * 
 *  This method would be used whenever the application prefers not to
 *  maintain an object's ReferenceData in the Object Registry.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_create_constant)(SOMOAClassData.create_constant))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_create_SOM_ref)(SOMOAClassData.create_SOM_ref))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_get_SOM_object)(SOMOAClassData.get_SOM_object))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_activate_impl_failed)(SOMOAClassData.activate_impl_failed))(((SOMOA *)((void *)this)), ev,impl,rc)
	);
}


/* method: interrupt_server */
void   interrupt_server(Environment *ev)
{
/*
 *  Wakes up a server waiting for a request message.  Responsibility
 *  of caller to ensure that the server is finished processing requests
 *  before invoking this method.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_interrupt_server)(SOMOAClassData.interrupt_server))(((SOMOA *)((void *)this)), ev)
	);
}


/* method: get_service_contexts */
IIOP_SOMDServiceContextList   get_service_contexts(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Returns the sequence of service contexts associated with a request.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMOA),
	 ((somTD_SOMOA_get_service_contexts)(SOMOAClassData.get_service_contexts))(((SOMOA *)((void *)this)), ev,obj)
	);
}


/*
 * Reintroduce inherited methods
 */

/* method: create */
SOMDObject*   create(Environment *ev, 
		ReferenceData* id, 
		InterfaceDef* intf, 
		ImplementationDef* impl)
{
/*
 *  Creates a SOMDObject which is used as as "reference" to a local
 *  application object.  An object reference is simply an object
 *  which is used to refer to another target object.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_create)(BOAClassData.create))(((SOMOA *)((void *)this)), ev,id,intf,impl)
	);
}


/* method: dispose */
void   dispose(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Destroys an object reference.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_dispose)(BOAClassData.dispose))(((SOMOA *)((void *)this)), ev,obj)
	);
}


/* method: get_id */
ReferenceData   get_id(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Returns ReferenceData associated with referenced object.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_get_id)(BOAClassData.get_id))(((SOMOA *)((void *)this)), ev,obj)
	);
}


/* method: get_principal */
Principal*   get_principal(Environment *ev, 
		SOMDObject* obj, 
		Environment* req_ev)
{
/*
 *  Returns the ID of the principal that issued the request.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_get_principal)(BOAClassData.get_principal))(((SOMOA *)((void *)this)), ev,obj,req_ev)
	);
}


/* method: set_exception */
void   set_exception(Environment *ev, 
		exception_type major, 
		string userid, 
		void* param)
{
/*
 *  Returns an exception to the client.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_set_exception)(BOAClassData.set_exception))(((SOMOA *)((void *)this)), ev,major,userid,param)
	);
}


/* method: impl_is_ready */
void   impl_is_ready(Environment *ev, 
		ImplementationDef* impl)
{
/*
 *  Indicates that the implementation is now ready to process requests.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_impl_is_ready)(BOAClassData.impl_is_ready))(((SOMOA *)((void *)this)), ev,impl)
	);
}


/* method: deactivate_impl */
void   deactivate_impl(Environment *ev, 
		ImplementationDef* impl)
{
/*
 *  Indicates that the implementation is no longer ready to process reqs.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_deactivate_impl)(BOAClassData.deactivate_impl))(((SOMOA *)((void *)this)), ev,impl)
	);
}


/* method: change_implementation */
void   change_implementation(Environment *ev, 
		SOMDObject* obj, 
		ImplementationDef* impl)
{
/*
 *  Changes the implementation associated with the referenced object.
 *  Change is seen for all copies of the object reference.
 *  (NOTE: Null implementation in this release of DSOM.)
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_change_implementation)(BOAClassData.change_implementation))(((SOMOA *)((void *)this)), ev,obj,impl)
	);
}


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


/* method: deactivate_obj */
void   deactivate_obj(Environment *ev, 
		SOMDObject* obj)
{
/*
 *  Indicates that the object is no longer ready to process requests.
 *  (NOTE: Null implementation in this release of DSOM.)
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_BOA),
	 ((somTD_SOMOA_deactivate_obj)(BOAClassData.deactivate_obj))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDefaultInit)(SOMObjectClassData.somDefaultInit))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDestruct)(SOMObjectClassData.somDestruct))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDefaultCopyInit)(SOMObjectClassData.somDefaultCopyInit))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDefaultAssign)(SOMObjectClassData.somDefaultAssign))(((SOMOA *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDefaultConstCopyInit)(SOMObjectClassData.somDefaultConstCopyInit))(((SOMOA *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDefaultVCopyInit)(SOMObjectClassData.somDefaultVCopyInit))(((SOMOA *)((void *)this)),ctrl,fromObj)
	);
}


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


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


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


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


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somInit)(SOMObjectClassData.somInit))(((SOMOA *)((void *)this)))
	);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somUninit)(SOMObjectClassData.somUninit))(((SOMOA *)((void *)this)))
	);
}


/* method: somFree */
void   somFree()
{
/*
 *  The default implementation just calls somDestruct.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somFree)(SOMObjectClassData.somFree))(((SOMOA *)((void *)this)))
	);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somGetClass)(SOMObjectClassData.somGetClass))(((SOMOA *)((void *)this)))
	);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somGetClassName)(SOMObjectClassData.somGetClassName))(((SOMOA *)((void *)this)))
	);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somGetSize)(SOMObjectClassData.somGetSize))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somIsA)(SOMObjectClassData.somIsA))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somIsInstanceOf)(SOMObjectClassData.somIsInstanceOf))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somRespondsTo)(SOMObjectClassData.somRespondsTo))(((SOMOA *)((void *)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.
 * 
 *  Default redispatch stubs invoke this method.
 */
/* the va_list invocation form */
boolean   SOMObject_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDispatch)(SOMObjectClassData.somDispatch))(((SOMOA *)((void *)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.
 * 
 *  Default redispatch stubs invoke this method.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDispatch)(SOMObjectClassData.somDispatch))(((SOMOA *)((void *)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   SOMObject_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((SOMOA *)((void *)this)),clsObj,retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* castedCls)
{
/*
 *  Changes the behavior of the target object to that implemented
 *  by castedCls. This is possible when all concrete data in castedCls
 *  is also concrete in the true class of the target object.
 *  Returns true (1) on success, and false (0) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somCastObj)(SOMObjectClassData.somCastObj))(((SOMOA *)((void *)this)),castedCls)
	);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somResetObj)(SOMObjectClassData.somResetObj))(((SOMOA *)((void *)this)))
	);
}


/* method: somPrintSelf */
SOMOA*  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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somPrintSelf)(SOMObjectClassData.somPrintSelf))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDumpSelf)(SOMObjectClassData.somDumpSelf))(((SOMOA *)((void *)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_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_SOMOA_somDumpSelfInt)(SOMObjectClassData.somDumpSelfInt))(((SOMOA *)((void *)this)),level)
	);
}



};   /* SOMOA */



#endif       /* SOM_SOMOA_xh */
