/*
 *    @(#) 2.17 src/somd/somd.xh, somd, som3.0 5/30/96 14:09:22 [12/22/96 21:11:51]
 */
/*
 *   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.
 */

/*
 *  somd.xh - global C++ include file for DSOM definitions
 */

/*
 *   04/17/96  mbc  D21197 Avoid name collisions with WIN32.
 */

#ifndef somd_xh
#define somd_xh
#define somd_h

/*  --- base SOM and DSOM types ---  */

#define CORBA_FUNCTION_NAMES
#include <som.xh>
#include <somtcnst.xh>
#include <somir.xh>

#include <somdtype.xh>

/*  --- DSOM error codes ---  */

#include <somderr.h>

/*  --- DSOM externals ---  */

#include <somdext.h>

/* For DSOM users, CORBA's exception_free should be mapped to 
 * somdExceptionFree rather than somExceptionFree, as in somcorba.h.
 */
#ifdef exception_free
 #undef exception_free
#endif
#define exception_free somdExceptionFree

/*  --- DSOM global variables ---
 *
 *  Several global variables point to DSOM objects that are always or often
 *  used by DSOM applications.
 *
 *  SOMD_ObjectMgr, SOMD_ORBObject, and SOMD_ImplRepObject are initialized
 *  by SOMD_Init().
 *  
 *  SOMD_ImplDefObject is initially NULL.   DSOM servers *MUST* set this to
 *  an ImplementationDef object which describes the server implementation.
 *  DSOM clients *MUST* leave this variable NULL.
 *
 *  SOMD_SOMOAObject is initially NULL.  DSOM servers should use the SOM
 *  Object Adapter can use this variable to refer to the instantiated SOMOA.
 *  It is not used by client processes.
 *
 *  The external references to these global variables are defined in the
 *  .xh files for their respective classes.
 */

#include <somdom.xh>		/* SOMD_ObjectMgr (incl. Factory) */
#include <orb.xh>		/* SOMD_ORBObject */
#include <implrep.xh>		/* SOMD_ImplRepObject */
#include <impldef.xh>		/* SOMD_ImplDefObject */
#include <somoa.xh>		/* SOMD_SOMOAObject */

/*  --- DSOM interfaces ---
 *
 *  Include the interfaces for other commonly used DSOM classes.
 */

#include <somdobj.xh>		/* SOMDObject */
#include <somdcprx.xh>		/* SOMDClientProxy */
#include <cntxt.xh>		/* Context */
#include <nvlist.xh>		/* NVList */
#include <request.xh>		/* Request */

/* ----------------------- WIN32 includes --------------- */
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif                                 /* WIN32 */

#include <stexcep.xh>		/* standard exceptions */
#include <principl.xh>

#ifndef OBJECT_NIL
#define OBJECT_NIL ((SOMObject *) NULL)
#endif

/* This define gives applications compiled with DSOM 3.0 the
 * new, improved semantics for somFree when invoked on a proxy --
 * both the remote object and the proxy are destroyed.  It also
 * gives string_to_object the 3.0 semantics, returning a local
 * SOMObject.
 */
#define SOMD_Init(ev) \
    { SOMD_Init(ev); \
    if (SOMD_ObjectMgr != NULL) SOMD_ObjectMgr->_set_somd21somFree(ev,TRUE); \
    if (SOMD_ORBObject != NULL) SOMD_ORBObject->_set_stringToObject30(ev, TRUE); }

#endif /* somd_xh */
