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

/*
 *    @(#) 2.28 src/somd/request.idl, somd, som3.0 9/26/96 14:02:11 [12/22/96 21:11:50]
 * 
 *    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.
 * 
 * 
 *   The Request class implements the CORBA Request object.  The Request
 *   object is used by the Dynamic Invocation Interface to dynamically
 *   create and issue a request to a remote object.  Request objects are
 *   created by the create_request method in SOMObject.
 */


#ifndef SOM_Request_h
#define SOM_Request_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_request
#ifdef SOM_DLL_somd
	/* export semantics */
	#if defined(SOM_DEFFILE_somd)\
	||(defined(SOM_DEFFILE_BY_DEFAULT)&&!defined(SOM_NODEFFILE_somd))\
	|| !defined(SOM_Module_request_Source)
	#define SOM_IMPORTEXPORT_somd_request
	#else
	#define SOM_IMPORTEXPORT_somd_request SOMDLLEXPORT
	#endif
#else
	#define SOM_IMPORTEXPORT_somd_request 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 Request
#define Request SOMObject
#endif

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

/*
 * Start of bindings for IDL types
 */

#ifndef SOMClass
    #define SOMClass SOMObject
#endif /* SOMClass */
#ifndef Container
    #define Container SOMObject
#endif /* Container */

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

/*
 * Passthru lines: File: "C.h", "after"
 */
/*
 *  Flags defined on requests
 */

#define ARG_IN		0x00000001  	/* defined in somir.h */
#define ARG_OUT		0x00000002	/* defined in somir.h */
#define ARG_INOUT	0x00000004	/* defined in somir.h */
#define IN_COPY_VALUE	0x00000008	/* add_arg flag */
#define DEPENDENT_LIST	0x00000010	/* add_item flag */
#define OUT_LIST_MEMORY	0x00000020	/* req flag */
#define INV_NO_RESPONSE	0x00000040	/* invoke flag */
#define INV_TERM_ON_ERR	0x00000080	/* invoke flag */
#define RESP_NO_WAIT	0x00000100	/* response flag */
/* Internal Use Flags */
#define AUTH_IN_MSG      0x00010000      /* msg includes auth info */
#define ACKONEWAY        0x00020000      /* ack oneway messages */
#define ENV_IN_MSG       0x00040000      /* msg includes env info */
#define CTX_IN_MSG       0x00080000      /* msg includes ctx info */
#define OBJ_OWNED        0x00100000	/* arg. mem. is obj. owned */
#define CALLER_OWNED     0x00200000	/* arg mem is caller owned */
#define RESULT_OUT       0x00400000	/* method result, not arg  */
#define CLIENT_SIDE      0x00800000	/* client side of request */
#define SERVER_SIDE      0x01000000	/* server side of request */
#define TXCTX_IN_MSG     0x02000000      /* msg includes trans info */
#define ARG_IS_PTRARG    0x10000000      /* ptr to arg, !aggregate */
#define ARG_IS_COMPONENT 0x20000000      /* comp of aggregate type */
#define ROOT_NOT_PTRARG  0x40000000      /* root struct not ptr */
#define RESERVED_FLAGS	0x8c00fe00	/* future/internal use */

/*
 *  Functions for multiple deferred-synchronous requests.
 */
#if defined(__IBMC__) && defined(_OS2)
  #pragma linkage(send_multiple_requests, system)
  #pragma linkage(get_next_response, system)
#endif
#ifdef SOM_STRICT_IDL
ORBStatus SOMLINK send_multiple_requests (
	IN	Request		reqs[],		/* array of Requests */
	IN	Environment	*env,
	IN	long		count,		/* number of Requests */
	IN	Flags		invoke_flags
    );

ORBStatus SOMLINK get_next_response (
	INOUT	Environment	*env,
	IN	Flags		response_flags,
	OUT	Request		*req
);
#else /* SOM_STRICT_IDL */
ORBStatus SOMLINK send_multiple_requests (
	IN	Request*	reqs[],		/* array of Requests */
	IN	Environment	*env,
	IN	long		count,		/* number of Requests */
	IN	Flags		invoke_flags
    );

ORBStatus SOMLINK get_next_response (
	INOUT	Environment	*env,
	IN	Flags		response_flags,
	OUT	Request*	*req
);
#endif /* SOM_STRICT_IDL */

/* define alias for CORBA compatibility */
#ifndef Request_delete
#define Request_delete Request_destroy
#endif


#define Request_MajorVersion 2
#define Request_MinorVersion 2

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

/*
 * Declare the ABI 2 ClassData structure
 */
SOMEXTERN struct RequestClassDataStructure {
	SOMClass classObject;
	somMToken add_arg;
	somMToken invoke;
	somMToken send;
	somMToken get_response;
	somMToken destroy;
	somMToken private1;
	somMToken private2;
	somMToken private3;
	somMToken private4;
	somMToken private5;
	somMToken private6;
	somMToken private7;
	somMToken private8;
	somMToken private9;
	somMToken private10;
	somMToken private11;
	somMToken private12;
	somMToken private13;
	somMToken private14;
} SOM_IMPORTEXPORT_somd_request SOMDLINK RequestClassData;

/*
 * Declare the ABI 2 CClassData structure
 */
SOMEXTERN struct RequestCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken instanceDataToken;
} SOM_IMPORTEXPORT_somd_request SOMDLINK RequestCClassData;

/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_Request (RequestClassData.classObject)
#ifndef SOMGD_Request
    #if (defined(_Request) || defined(__Request))
        #undef _Request
        #undef __Request
        #define SOMGD_Request 1
    #else
        #define _Request _SOMCLASS_Request
    #endif /* _Request */
#endif /* SOMGD_Request */
#define Request_classObj _SOMCLASS_Request
#define _SOMMTOKEN_Request(method) ((somMToken)RequestClassData.method)

/*
 * New and Renew macros for Request
 */
#define RequestNew() \
   ( _Request ? \
	_somNew(_Request) \
	: ( RequestNewClass(\
		Request_MajorVersion, \
		Request_MinorVersion),\
	   _somNew(_Request)))
#define RequestRenew(buf) \
   ( _Request ? \
	_somRenew(_Request, buf) \
	: ( RequestNewClass(\
		Request_MajorVersion, \
		Request_MinorVersion),\
	   _somRenew(_Request, buf)))

/*
 * New Method: add_arg
 */
typedef ORBStatus   SOMLINK somTP_Request_add_arg(Request somSelf, Environment *ev, 
		Identifier name, 
		TypeCode arg_type, 
		void* value, 
		long len, 
		Flags arg_flags);
typedef somTP_Request_add_arg *somTD_Request_add_arg;
/*
 *  Incrementally adds an arg to the Request.
 *  The Request must have been created using the "create_request"
 *  method, with an empty argument list.  (We can't add args to a
 *  list that was passed in to the create_request call. [pg. 109])
 */
#define somMD_Request_add_arg "::Request::add_arg"
#define Request_add_arg(somSelf,ev,name,arg_type,value,len,arg_flags) \
    (SOM_Resolve(somSelf, Request, add_arg) \
	(somSelf,ev,name,arg_type,value,len,arg_flags))
#ifndef SOMGD_add_arg
    #if (defined(_add_arg) || defined(__add_arg))
        #undef _add_arg
        #undef __add_arg
        #define SOMGD_add_arg 1
    #else
        #define _add_arg Request_add_arg
    #endif /* _add_arg */
#endif /* SOMGD_add_arg */

/*
 * New Method: invoke
 */
typedef ORBStatus   SOMLINK somTP_Request_invoke(Request somSelf, Environment *ev, 
		Flags invoke_flags);
typedef somTP_Request_invoke *somTD_Request_invoke;
/*
 *  Invokes the Request synchronously, waiting for the response.
 */
#define somMD_Request_invoke "::Request::invoke"
#define Request_invoke(somSelf,ev,invoke_flags) \
    (SOM_Resolve(somSelf, Request, invoke) \
	(somSelf,ev,invoke_flags))
#ifndef SOMGD_invoke
    #if (defined(_invoke) || defined(__invoke))
        #undef _invoke
        #undef __invoke
        #define SOMGD_invoke 1
    #else
        #define _invoke Request_invoke
    #endif /* _invoke */
#endif /* SOMGD_invoke */

/*
 * New Method: send
 */
typedef ORBStatus   SOMLINK somTP_Request_send(Request somSelf, Environment *ev, 
		Flags invoke_flags);
typedef somTP_Request_send *somTD_Request_send;
/*
 *  Invokes the Request asynchronously.  The response must eventually
 *  be checked by invoking get_response or get_next_response.
 */
#define somMD_Request_send "::Request::send"
#define Request_send(somSelf,ev,invoke_flags) \
    (SOM_Resolve(somSelf, Request, send) \
	(somSelf,ev,invoke_flags))
#ifndef SOMGD_send
    #if (defined(_send) || defined(__send))
        #undef _send
        #undef __send
        #define SOMGD_send 1
    #else
        #define _send Request_send
    #endif /* _send */
#endif /* SOMGD_send */

/*
 * New Method: get_response
 */
typedef ORBStatus   SOMLINK somTP_Request_get_response(Request somSelf, Environment *ev, 
		Flags response_flags);
typedef somTP_Request_get_response *somTD_Request_get_response;
/*
 *  Determines whether an asynchronous Request has completed.
 */
#define somMD_Request_get_response "::Request::get_response"
#define Request_get_response(somSelf,ev,response_flags) \
    (SOM_Resolve(somSelf, Request, get_response) \
	(somSelf,ev,response_flags))
#ifndef SOMGD_get_response
    #if (defined(_get_response) || defined(__get_response))
        #undef _get_response
        #undef __get_response
        #define SOMGD_get_response 1
    #else
        #define _get_response Request_get_response
    #endif /* _get_response */
#endif /* SOMGD_get_response */

/*
 * New Method: destroy
 */
typedef ORBStatus   SOMLINK somTP_Request_destroy(Request somSelf, Environment *ev);
typedef somTP_Request_destroy *somTD_Request_destroy;
/*
 *  Deletes the memory allocated by the ORB for the Request.
 */
#define somMD_Request_destroy "::Request::destroy"
#define Request_destroy(somSelf,ev) \
    (SOM_Resolve(somSelf, Request, destroy) \
	(somSelf,ev))
#ifndef SOMGD_destroy
    #if (defined(_destroy) || defined(__destroy))
        #undef _destroy
        #undef __destroy
        #define SOMGD_destroy 1
    #else
        #define _destroy Request_destroy
    #endif /* _destroy */
#endif /* SOMGD_destroy */

/*
 * Full Names for Inherited Methods
 */
/* overridden methods */
#define Request_somDefaultInit SOMObject_somDefaultInit
#define Request_somDestruct SOMObject_somDestruct

#ifndef SOM_DONT_USE_INHERITED_MACROS
#define Request_somDefaultCopyInit SOMObject_somDefaultCopyInit
#define Request_somDefaultAssign SOMObject_somDefaultAssign
#define Request_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
#define Request_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
#define Request_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
#define Request_somDefaultConstAssign SOMObject_somDefaultConstAssign
#define Request_somDefaultVAssign SOMObject_somDefaultVAssign
#define Request_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
#define Request_somInit SOMObject_somInit
#define Request_somUninit SOMObject_somUninit
#define Request_somFree SOMObject_somFree
#define Request_somGetClass SOMObject_somGetClass
#define Request_somGetClassName SOMObject_somGetClassName
#define Request_somGetSize SOMObject_somGetSize
#define Request_somIsA SOMObject_somIsA
#define Request_somIsInstanceOf SOMObject_somIsInstanceOf
#define Request_somRespondsTo SOMObject_somRespondsTo
#define Request_somDispatch SOMObject_somDispatch
#define Request_somClassDispatch SOMObject_somClassDispatch
#define Request_somCastObj SOMObject_somCastObj
#define Request_somResetObj SOMObject_somResetObj
#define Request_somPrintSelf SOMObject_somPrintSelf
#define Request_somDumpSelf SOMObject_somDumpSelf
#define Request_somDumpSelfInt SOMObject_somDumpSelfInt
#endif /* SOM_DONT_USE_INHERITED_MACROS */

#endif       /* SOM_Request_h */
