
/*
 * This file was generated by the SOM Compiler.
 * FileName: somoa.h.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.19
 *     SOM Emitter emith.dll: 2.31.1.64
 */

/*
 *    @(#) 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_h
#define SOM_SOMOA_h


/*
 * The SOM_STRICT_IDL macro means that we can ignore stars
 * in our declarations of objects.
 */
#define SOM_STRICT_IDL 1


#include <som.h>
#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

/*
 * -- 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))

/*
 * Define the class name as an object type
 */
#ifndef SOMOA
#define SOMOA SOMObject
#endif

/*
 * Include Parent Bindings
 */
#ifndef SOM_BOA_h
#ifdef SOMLOCALINCLUDES
#include "boa.h"
#else
#include <boa.h>
#endif
#endif

/*
 * Start of bindings for IDL types
 */

#ifndef SOMClass
    #define SOMClass SOMObject
#endif /* SOMClass */
#ifndef Container
    #define Container SOMObject
#endif /* Container */
#ifndef Principal
    #define Principal SOMObject
#endif /* Principal */
#ifndef SOMDObject
    #define SOMDObject SOMObject
#endif /* SOMDObject */
#ifndef ImplementationDef
    #define ImplementationDef SOMObject
#endif /* ImplementationDef */
#ifndef InterfaceDef
    #define InterfaceDef SOMObject
#endif /* InterfaceDef */
#ifndef Context
    #define Context SOMObject
#endif /* Context */

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

/*
 * Passthru lines: File: "C.h", "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

#ifndef SOM_IMPORTEXPORT_somd
#if defined(_WIN32) && !defined(SOM_DLL_somd)
#define SOM_IMPORTEXPORT_somd SOMDLLIMPORT
#else
#define SOM_IMPORTEXPORT_somd
#endif
#endif
#ifdef SOM_STRICT_IDL
SOMEXTERN SOM_IMPORTEXPORT_somd SOMOA   SOMDLINK SOMD_SOMOAObject;
#else
SOMEXTERN SOM_IMPORTEXPORT_somd SOMOA *  SOMDLINK SOMD_SOMOAObject;
#endif


#define SOMOA_MajorVersion 2
#define SOMOA_MinorVersion 2

/*
 * Declare the class creation procedure
 */
SOMEXTERN SOM_IMPORTEXPORT_somd_somoa SOMClass  SOMLINK SOMOANewClass(integer4 somtmajorVersion,
		integer4 somtminorVersion);

/*
 * Declare the ABI 2 ClassData structure
 */
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;
} SOM_IMPORTEXPORT_somd_somoa SOMDLINK SOMOAClassData;

/*
 * Declare the ABI 2 CClassData structure
 */
SOMEXTERN struct SOMOACClassDataStructure {
	somMethodTabs parentMtab;
	somDToken instanceDataToken;
} SOM_IMPORTEXPORT_somd_somoa SOMDLINK 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)

/*
 * New and Renew macros for SOMOA
 */
#define SOMOANew() \
   ( _SOMOA ? \
	_somNew(_SOMOA) \
	: ( SOMOANewClass(\
		SOMOA_MajorVersion, \
		SOMOA_MinorVersion),\
	   _somNew(_SOMOA)))
#define SOMOARenew(buf) \
   ( _SOMOA ? \
	_somRenew(_SOMOA, buf) \
	: ( SOMOANewClass(\
		SOMOA_MajorVersion, \
		SOMOA_MinorVersion),\
	   _somRenew(_SOMOA, buf)))

/*
 * New Method: execute_next_request
 */
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;
/*
 *  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.)
 */
#define somMD_SOMOA_execute_next_request "::SOMOA::execute_next_request"
#define SOMOA_execute_next_request(somSelf,ev,waitFlag) \
    (SOM_Resolve(somSelf, SOMOA, execute_next_request) \
	(somSelf,ev,waitFlag))
#ifndef SOMGD_execute_next_request
    #if (defined(_execute_next_request) || defined(__execute_next_request))
        #undef _execute_next_request
        #undef __execute_next_request
        #define SOMGD_execute_next_request 1
    #else
        #define _execute_next_request SOMOA_execute_next_request
    #endif /* _execute_next_request */
#endif /* SOMGD_execute_next_request */

/*
 * New Method: execute_request_loop
 */
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;
/*
 *  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.)
 */
#define somMD_SOMOA_execute_request_loop "::SOMOA::execute_request_loop"
#define SOMOA_execute_request_loop(somSelf,ev,waitFlag) \
    (SOM_Resolve(somSelf, SOMOA, execute_request_loop) \
	(somSelf,ev,waitFlag))
#ifndef SOMGD_execute_request_loop
    #if (defined(_execute_request_loop) || defined(__execute_request_loop))
        #undef _execute_request_loop
        #undef __execute_request_loop
        #define SOMGD_execute_request_loop 1
    #else
        #define _execute_request_loop SOMOA_execute_request_loop
    #endif /* _execute_request_loop */
#endif /* SOMGD_execute_request_loop */

/*
 * New Method: change_id
 */
typedef void   SOMLINK somTP_SOMOA_change_id(SOMOA somSelf, Environment *ev, 
		SOMDObject objref, 
		ReferenceData* id);
typedef somTP_SOMOA_change_id *somTD_SOMOA_change_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).
 */
#define somMD_SOMOA_change_id "::SOMOA::change_id"
#define SOMOA_change_id(somSelf,ev,objref,id) \
    (SOM_Resolve(somSelf, SOMOA, change_id) \
	(somSelf,ev,objref,id))
#ifndef SOMGD_change_id
    #if (defined(_change_id) || defined(__change_id))
        #undef _change_id
        #undef __change_id
        #define SOMGD_change_id 1
    #else
        #define _change_id SOMOA_change_id
    #endif /* _change_id */
#endif /* SOMGD_change_id */

/*
 * New Method: create_constant
 */
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;
/*
 *  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.
 */
#define somMD_SOMOA_create_constant "::SOMOA::create_constant"
#define SOMOA_create_constant(somSelf,ev,id,intf,impl) \
    (SOM_Resolve(somSelf, SOMOA, create_constant) \
	(somSelf,ev,id,intf,impl))
#ifndef SOMGD_create_constant
    #if (defined(_create_constant) || defined(__create_constant))
        #undef _create_constant
        #undef __create_constant
        #define SOMGD_create_constant 1
    #else
        #define _create_constant SOMOA_create_constant
    #endif /* _create_constant */
#endif /* SOMGD_create_constant */

/*
 * New Method: create_SOM_ref
 */
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;
/*
 *  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.
 */
#define somMD_SOMOA_create_SOM_ref "::SOMOA::create_SOM_ref"
#define SOMOA_create_SOM_ref(somSelf,ev,somobj,impl) \
    (SOM_Resolve(somSelf, SOMOA, create_SOM_ref) \
	(somSelf,ev,somobj,impl))
#ifndef SOMGD_create_SOM_ref
    #if (defined(_create_SOM_ref) || defined(__create_SOM_ref))
        #undef _create_SOM_ref
        #undef __create_SOM_ref
        #define SOMGD_create_SOM_ref 1
    #else
        #define _create_SOM_ref SOMOA_create_SOM_ref
    #endif /* _create_SOM_ref */
#endif /* SOMGD_create_SOM_ref */

/*
 * New Method: get_SOM_object
 */
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;
/*
 *  This method returns the SOM object associated with a SOMDObject
 *  reference created by the create_SOM_ref method.
 */
#define somMD_SOMOA_get_SOM_object "::SOMOA::get_SOM_object"
#define SOMOA_get_SOM_object(somSelf,ev,somref) \
    (SOM_Resolve(somSelf, SOMOA, get_SOM_object) \
	(somSelf,ev,somref))
#ifndef SOMGD_get_SOM_object
    #if (defined(_get_SOM_object) || defined(__get_SOM_object))
        #undef _get_SOM_object
        #undef __get_SOM_object
        #define SOMGD_get_SOM_object 1
    #else
        #define _get_SOM_object SOMOA_get_SOM_object
    #endif /* _get_SOM_object */
#endif /* SOMGD_get_SOM_object */

/*
 * New Method: activate_impl_failed
 */
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;
/*
 *  Indicates there was an error when activating this implementation.
 *  Called by a server program.  ORBStatus code is returned to the client
 *  in an exception.
 */
#define somMD_SOMOA_activate_impl_failed "::SOMOA::activate_impl_failed"
#define SOMOA_activate_impl_failed(somSelf,ev,impl,rc) \
    (SOM_Resolve(somSelf, SOMOA, activate_impl_failed) \
	(somSelf,ev,impl,rc))
#ifndef SOMGD_activate_impl_failed
    #if (defined(_activate_impl_failed) || defined(__activate_impl_failed))
        #undef _activate_impl_failed
        #undef __activate_impl_failed
        #define SOMGD_activate_impl_failed 1
    #else
        #define _activate_impl_failed SOMOA_activate_impl_failed
    #endif /* _activate_impl_failed */
#endif /* SOMGD_activate_impl_failed */

/*
 * New Method: interrupt_server
 */
typedef void   SOMLINK somTP_SOMOA_interrupt_server(SOMOA somSelf, Environment *ev);
typedef somTP_SOMOA_interrupt_server *somTD_SOMOA_interrupt_server;
/*
 *  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.
 */
#define somMD_SOMOA_interrupt_server "::SOMOA::interrupt_server"
#define SOMOA_interrupt_server(somSelf,ev) \
    (SOM_Resolve(somSelf, SOMOA, interrupt_server) \
	(somSelf,ev))
#ifndef SOMGD_interrupt_server
    #if (defined(_interrupt_server) || defined(__interrupt_server))
        #undef _interrupt_server
        #undef __interrupt_server
        #define SOMGD_interrupt_server 1
    #else
        #define _interrupt_server SOMOA_interrupt_server
    #endif /* _interrupt_server */
#endif /* SOMGD_interrupt_server */

/*
 * New Method: get_service_contexts
 */
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;
/*
 *  Returns the sequence of service contexts associated with a request.
 */
#define somMD_SOMOA_get_service_contexts "::SOMOA::get_service_contexts"
#define SOMOA_get_service_contexts(somSelf,ev,obj) \
    (SOM_Resolve(somSelf, SOMOA, get_service_contexts) \
	(somSelf,ev,obj))
#ifndef SOMGD_get_service_contexts
    #if (defined(_get_service_contexts) || defined(__get_service_contexts))
        #undef _get_service_contexts
        #undef __get_service_contexts
        #define SOMGD_get_service_contexts 1
    #else
        #define _get_service_contexts SOMOA_get_service_contexts
    #endif /* _get_service_contexts */
#endif /* SOMGD_get_service_contexts */

/*
 * Full Names for Inherited Methods
 */
/* overridden methods */
#define SOMOA_create BOA_create
#define SOMOA_dispose BOA_dispose
#define SOMOA_get_id BOA_get_id
#define SOMOA_get_principal BOA_get_principal
#define SOMOA_set_exception BOA_set_exception
#define SOMOA_impl_is_ready BOA_impl_is_ready
#define SOMOA_deactivate_impl BOA_deactivate_impl
#define SOMOA_change_implementation BOA_change_implementation
#define SOMOA_obj_is_ready BOA_obj_is_ready
#define SOMOA_deactivate_obj BOA_deactivate_obj
#define SOMOA_somDefaultInit SOMObject_somDefaultInit
#define SOMOA_somDestruct SOMObject_somDestruct

#ifndef SOM_DONT_USE_INHERITED_MACROS
#define SOMOA_somDefaultCopyInit SOMObject_somDefaultCopyInit
#define SOMOA_somDefaultAssign SOMObject_somDefaultAssign
#define SOMOA_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
#define SOMOA_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
#define SOMOA_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
#define SOMOA_somDefaultConstAssign SOMObject_somDefaultConstAssign
#define SOMOA_somDefaultVAssign SOMObject_somDefaultVAssign
#define SOMOA_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
#define SOMOA_somInit SOMObject_somInit
#define SOMOA_somUninit SOMObject_somUninit
#define SOMOA_somFree SOMObject_somFree
#define SOMOA_somGetClass SOMObject_somGetClass
#define SOMOA_somGetClassName SOMObject_somGetClassName
#define SOMOA_somGetSize SOMObject_somGetSize
#define SOMOA_somIsA SOMObject_somIsA
#define SOMOA_somIsInstanceOf SOMObject_somIsInstanceOf
#define SOMOA_somRespondsTo SOMObject_somRespondsTo
#define SOMOA_somDispatch SOMObject_somDispatch
#define SOMOA_somClassDispatch SOMObject_somClassDispatch
#define SOMOA_somCastObj SOMObject_somCastObj
#define SOMOA_somResetObj SOMObject_somResetObj
#define SOMOA_somPrintSelf SOMObject_somPrintSelf
#define SOMOA_somDumpSelf SOMObject_somDumpSelf
#define SOMOA_somDumpSelfInt SOMObject_somDumpSelfInt
#endif /* SOM_DONT_USE_INHERITED_MACROS */

#endif       /* SOM_SOMOA_h */
