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

/*
 *    COMPONENT_NAME: somd
 * 
 *    ORIGINS: 27
 * 
 * 
 *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1995,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.
 * 
 * 
 *   Each DSOM server process is defined to have a (single instance)
 *   SOMDServer object.  The SOMDServer object performs the following
 *   functions:
 * 
 *       1) creation of SOMObject factories
 *       2) mapping between SOMObjects and SOMDObjects
 *       3) method dispatching
 *       4) any application-specific server methods
 * 
 *   A particular SOMDServer subclass is specified in the ImplementationDef
 *   for each server process.  SOMOA will instantiate one instance of the
 *   specified SOMDServer subclass during server process initialization
 *   (in SOMOA::impl_is_ready).
 */


#ifndef SOM_SOMDServer_h
#define SOM_SOMDServer_h


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


/*
 * Passthru lines: File: "C.h", "before"
 */
#include <naming.h>
#include <xnaming.h>

#include <som.h>
#ifndef SOM_IMPORTEXPORT_somd_somdserv
#ifdef SOM_DLL_somd
	/* export semantics */
	#if defined(SOM_DEFFILE_somd)\
	||(defined(SOM_DEFFILE_BY_DEFAULT)&&!defined(SOM_NODEFFILE_somd))\
	|| !defined(SOM_Module_somdserv_Source)
	#define SOM_IMPORTEXPORT_somd_somdserv
	#else
	#define SOM_IMPORTEXPORT_somd_somdserv SOMDLLEXPORT
	#endif
#else
	#define SOM_IMPORTEXPORT_somd_somdserv 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 SOMDServer
#define SOMDServer 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 */
#ifndef ExtendedNaming_PropertyBindingIterator
    #define ExtendedNaming_PropertyBindingIterator SOMObject
#endif /* ExtendedNaming_PropertyBindingIterator */
#ifndef ExtendedNaming_PropertyIterator
    #define ExtendedNaming_PropertyIterator SOMObject
#endif /* ExtendedNaming_PropertyIterator */
#ifndef ExtendedNaming_IndexIterator
    #define ExtendedNaming_IndexIterator SOMObject
#endif /* ExtendedNaming_IndexIterator */
#ifndef SOMDObject
    #define SOMDObject SOMObject
#endif /* SOMDObject */

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

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

#include <somdtype.h>
#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 SOMDServer  SOMDLINK SOMD_ServerObject;
#else
SOMEXTERN SOM_IMPORTEXPORT_somd SOMDServer * SOMDLINK SOMD_ServerObject;
#endif /* SOM_STRICT_IDL */


#define SOMDServer_MajorVersion 2
#define SOMDServer_MinorVersion 2

/*
 * Include the metaclass file
 */
#ifndef SOM_SOMMSingleInstance_h
#ifdef SOMLOCALINCLUDES
#include "snglicls.h"
#else
#include <snglicls.h>
#endif
#endif

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

/*
 * Declare the ABI 2 ClassData structure
 */
SOMEXTERN struct SOMDServerClassDataStructure {
	SOMClass classObject;
	somMToken somdSOMObjFromRef;
	somMToken somdRefFromSOMObj;
	somMToken somdCreateObj;
	somMToken somdDeleteObj;
	somMToken somdGetClassObj;
	somMToken somdDispatchMethod;
	somMToken somdObjReferencesCached;
	somMToken private1;
	somMToken private2;
	somMToken somdCreateFactory;
} SOM_IMPORTEXPORT_somd_somdserv SOMDLINK SOMDServerClassData;

/*
 * Declare the ABI 2 CClassData structure
 */
SOMEXTERN struct SOMDServerCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken instanceDataToken;
	somMethodProc *somdDispatchMethod;
} SOM_IMPORTEXPORT_somd_somdserv SOMDLINK SOMDServerCClassData;

/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_SOMDServer (SOMDServerClassData.classObject)
#ifndef SOMGD_SOMDServer
    #if (defined(_SOMDServer) || defined(__SOMDServer))
        #undef _SOMDServer
        #undef __SOMDServer
        #define SOMGD_SOMDServer 1
    #else
        #define _SOMDServer _SOMCLASS_SOMDServer
    #endif /* _SOMDServer */
#endif /* SOMGD_SOMDServer */
#define SOMDServer_classObj _SOMCLASS_SOMDServer
#define _SOMMTOKEN_SOMDServer(method) ((somMToken)SOMDServerClassData.method)

/*
 * New and Renew macros for SOMDServer
 */
#define SOMDServerNew() \
   ( _SOMDServer ? \
	_somNew(_SOMDServer) \
	: ( SOMDServerNewClass(\
		SOMDServer_MajorVersion, \
		SOMDServer_MinorVersion),\
	   _somNew(_SOMDServer)))
#define SOMDServerRenew(buf) \
   ( _SOMDServer ? \
	_somRenew(_SOMDServer, buf) \
	: ( SOMDServerNewClass(\
		SOMDServer_MajorVersion, \
		SOMDServer_MinorVersion),\
	   _somRenew(_SOMDServer, buf)))

/*
 * New Method: somdRefFromSOMObj
 */
typedef SOMDObject   SOMLINK somTP_SOMDServer_somdRefFromSOMObj(SOMDServer somSelf, Environment *ev, 
		SOMObject somobj);
typedef somTP_SOMDServer_somdRefFromSOMObj *somTD_SOMDServer_somdRefFromSOMObj;
/*
 *  This method returns a DSOM object reference for a SOM object in this server
 *  process.  SOMOA will call this method whenever it returns a result from a
 *  method call which includes a pointer to a SOMObject (versus a pointer to a
 *  SOMDObject).  OWNERSHIP of the returned object reference is passed to the
 *  caller EXCEPT when the somdObjReferencesCached method returns TRUE.  When the
 *  input (somobj) is already an object reference, the default implementation
 *  simply returns somobj, rather than creating a new reference.  (Subclasses
 *  might override this method to duplicate the input reference, however.)
 *  Hence, callers should note when the returned value is the same as
 *  the input (somobj) when determining whether or not to free the result.
 */
#define somMD_SOMDServer_somdRefFromSOMObj "::SOMDServer::somdRefFromSOMObj"
#define SOMDServer_somdRefFromSOMObj(somSelf,ev,somobj) \
    (SOM_Resolve(somSelf, SOMDServer, somdRefFromSOMObj) \
	(somSelf,ev,somobj))
#ifndef SOMGD_somdRefFromSOMObj
    #if (defined(_somdRefFromSOMObj) || defined(__somdRefFromSOMObj))
        #undef _somdRefFromSOMObj
        #undef __somdRefFromSOMObj
        #define SOMGD_somdRefFromSOMObj 1
    #else
        #define _somdRefFromSOMObj SOMDServer_somdRefFromSOMObj
    #endif /* _somdRefFromSOMObj */
#endif /* SOMGD_somdRefFromSOMObj */

/*
 * New Method: somdSOMObjFromRef
 */
typedef SOMObject   SOMLINK somTP_SOMDServer_somdSOMObjFromRef(SOMDServer somSelf, Environment *ev, 
		SOMDObject objref);
typedef somTP_SOMDServer_somdSOMObjFromRef *somTD_SOMDServer_somdSOMObjFromRef;
/*
 *  This method maps a DSOM object reference into a SOM object.
 *  This can be done in whatever way is appropriate for the application.
 *  This method is called by SOMOA in order to translate any method call
 *  parameters which are object references (created from somdRefFromSOMObj
 *  above) into SOM objects.
 */
#define somMD_SOMDServer_somdSOMObjFromRef "::SOMDServer::somdSOMObjFromRef"
#define SOMDServer_somdSOMObjFromRef(somSelf,ev,objref) \
    (SOM_Resolve(somSelf, SOMDServer, somdSOMObjFromRef) \
	(somSelf,ev,objref))
#ifndef SOMGD_somdSOMObjFromRef
    #if (defined(_somdSOMObjFromRef) || defined(__somdSOMObjFromRef))
        #undef _somdSOMObjFromRef
        #undef __somdSOMObjFromRef
        #define SOMGD_somdSOMObjFromRef 1
    #else
        #define _somdSOMObjFromRef SOMDServer_somdSOMObjFromRef
    #endif /* _somdSOMObjFromRef */
#endif /* SOMGD_somdSOMObjFromRef */

/*
 * New Method: somdDispatchMethod
 */
typedef void   SOMLINK somTP_SOMDServer_somdDispatchMethod(SOMDServer somSelf, Environment *ev, 
		SOMObject somobj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_SOMDServer_somdDispatchMethod *somTD_SOMDServer_somdDispatchMethod;
/*
 *  This method is called by SOMOA to dispatch a method on a SOM object.
 *  The intention is to give the Server object an opportunity to intercept
 *  method calls, if desired.  The parameters to this method are the same
 *  as the parameters passed to SOMObject::somDispatch.
 * 
 *  The default implementation invokes SOMObject::somDispatch on the
 *  specified target object, "somobj", with the supplied arguments.
 */
#define somMD_SOMDServer_somdDispatchMethod "::SOMDServer::somdDispatchMethod"
#define SOMDServer_somdDispatchMethod(somSelf,ev,somobj,retValue,methodId,ap) \
    (SOM_Resolve(somSelf, SOMDServer, somdDispatchMethod) \
	(somSelf,ev,somobj,retValue,methodId,ap))

/*
 * legacy support for non-system-linkage vararg stub
 * use -mnolegacy to avoid generating this stub.
 */
#ifdef SOMDServer_VA_EXTERN
    SOMEXTERN
#else
    static
#endif
void   va_SOMDServer_somdDispatchMethod(SOMDServer somSelf, Environment *ev,
		SOMObject somobj,
		somToken* retValue,
		somId methodId,
		...)
#if (defined(SOMDServer_VA_STUBS)||!defined(SOMDServer_VA_EXTERN))
{
    va_list ap;
    va_start(ap, methodId);
    SOMDServer_somdDispatchMethod(somSelf,ev,somobj,retValue,methodId,ap);
    va_end(ap);
}    
#else
    ;
#endif

/*
 * normal vararg stubs
 */
#ifndef SOMGD_va_somdDispatchMethod
   #ifdef va_somdDispatchMethod
      #undef va_somdDispatchMethod
      #define SOMGD_va_somdDispatchMethod 1
   #else
      #define va_somdDispatchMethod somva_SOMDServer_somdDispatchMethod
   #endif /* va_somdDispatchMethod */
#endif /* SOMGD_va_somdDispatchMethod */
#ifndef SOMGD_somdDispatchMethod
    #if (defined(_somdDispatchMethod) || defined(__somdDispatchMethod))
        #undef _somdDispatchMethod
        #undef __somdDispatchMethod
        #define SOMGD_somdDispatchMethod 1
    #else
        #define _somdDispatchMethod somva_SOMDServer_somdDispatchMethod
    #endif /* _somdDispatchMethod */
#endif /* SOMGD_somdDispatchMethod */
#ifdef SOMDServer_VA_EXTERN
    SOMEXTERN
#else
    static
#endif
void  SOMLINK somva_SOMDServer_somdDispatchMethod(SOMDServer somSelf, Environment *ev,
		SOMObject somobj,
		somToken* retValue,
		somId methodId,
		...)
#if (defined(SOMDServer_VA_STUBS)||!defined(SOMDServer_VA_EXTERN))
{
    va_list ap;
    va_start(ap, methodId);
    SOMDServer_somdDispatchMethod(somSelf,ev,somobj,retValue,methodId,ap);
    va_end(ap);
}    
#else
    ;
#endif

/*
 * New Method: somdCreateObj
 */
typedef SOMObject   SOMLINK somTP_SOMDServer_somdCreateObj(SOMDServer somSelf, Environment *ev, 
		Identifier objclass, 
		string hints);
typedef somTP_SOMDServer_somdCreateObj *somTD_SOMDServer_somdCreateObj;
/*
 *  Creates an object of the specified class.  This method (if overridden)
 *  may optionally define creation "hints" which the client may specify in
 *  this call.
 * 
 *  Called indirectly by SOMDObjectMgr::somdNewObject.
 * 
 *  The default implementation calls somdGetClassObj to get the specified
 *  SOMClass object, and invokes "somNew".  The "hints" argument is ignored.
 */
#define somMD_SOMDServer_somdCreateObj "::SOMDServer::somdCreateObj"
#define SOMDServer_somdCreateObj(somSelf,ev,objclass,hints) \
    (SOM_Resolve(somSelf, SOMDServer, somdCreateObj) \
	(somSelf,ev,objclass,hints))
#ifndef SOMGD_somdCreateObj
    #if (defined(_somdCreateObj) || defined(__somdCreateObj))
        #undef _somdCreateObj
        #undef __somdCreateObj
        #define SOMGD_somdCreateObj 1
    #else
        #define _somdCreateObj SOMDServer_somdCreateObj
    #endif /* _somdCreateObj */
#endif /* SOMGD_somdCreateObj */

/*
 * New Method: somdDeleteObj
 */
typedef void   SOMLINK somTP_SOMDServer_somdDeleteObj(SOMDServer somSelf, Environment *ev, 
		SOMObject somobj);
typedef somTP_SOMDServer_somdDeleteObj *somTD_SOMDServer_somdDeleteObj;
/*
 *  Deletes a SOM object.  By default, simply calls somFree on the object.
 * 
 *  Called indirectly by SOMDObjectMgr::somdDestroyObject.
 */
#define somMD_SOMDServer_somdDeleteObj "::SOMDServer::somdDeleteObj"
#define SOMDServer_somdDeleteObj(somSelf,ev,somobj) \
    (SOM_Resolve(somSelf, SOMDServer, somdDeleteObj) \
	(somSelf,ev,somobj))
#ifndef SOMGD_somdDeleteObj
    #if (defined(_somdDeleteObj) || defined(__somdDeleteObj))
        #undef _somdDeleteObj
        #undef __somdDeleteObj
        #define SOMGD_somdDeleteObj 1
    #else
        #define _somdDeleteObj SOMDServer_somdDeleteObj
    #endif /* _somdDeleteObj */
#endif /* SOMGD_somdDeleteObj */

/*
 * New Method: somdGetClassObj
 */
typedef SOMClass   SOMLINK somTP_SOMDServer_somdGetClassObj(SOMDServer somSelf, Environment *ev, 
		Identifier objclass);
typedef somTP_SOMDServer_somdGetClassObj *somTD_SOMDServer_somdGetClassObj;
/*
 *  Creates/returns a class object for the specified class.  May result in
 *  loading of a DLL for the class.  This method can be used by a client to
 *  get a proxy to a class object on the server so that methods introduced
 *  in the metaclass (e.g., class-specific constructors, etc.) may be invoked
 *  directly.
 */
#define somMD_SOMDServer_somdGetClassObj "::SOMDServer::somdGetClassObj"
#define SOMDServer_somdGetClassObj(somSelf,ev,objclass) \
    (SOM_Resolve(somSelf, SOMDServer, somdGetClassObj) \
	(somSelf,ev,objclass))
#ifndef SOMGD_somdGetClassObj
    #if (defined(_somdGetClassObj) || defined(__somdGetClassObj))
        #undef _somdGetClassObj
        #undef __somdGetClassObj
        #define SOMGD_somdGetClassObj 1
    #else
        #define _somdGetClassObj SOMDServer_somdGetClassObj
    #endif /* _somdGetClassObj */
#endif /* SOMGD_somdGetClassObj */

/*
 * New Method: somdObjReferencesCached
 */
typedef boolean   SOMLINK somTP_SOMDServer_somdObjReferencesCached(SOMDServer somSelf, Environment *ev);
typedef somTP_SOMDServer_somdObjReferencesCached *somTD_SOMDServer_somdObjReferencesCached;
/*
 *  Whether the server retains ownership of the object references
 *  it creates via the somdRefFromSOMObj method.
 */
#define somMD_SOMDServer_somdObjReferencesCached "::SOMDServer::somdObjReferencesCached"
#define SOMDServer_somdObjReferencesCached(somSelf,ev) \
    (SOM_Resolve(somSelf, SOMDServer, somdObjReferencesCached) \
	(somSelf,ev))
#ifndef SOMGD_somdObjReferencesCached
    #if (defined(_somdObjReferencesCached) || defined(__somdObjReferencesCached))
        #undef _somdObjReferencesCached
        #undef __somdObjReferencesCached
        #define SOMGD_somdObjReferencesCached 1
    #else
        #define _somdObjReferencesCached SOMDServer_somdObjReferencesCached
    #endif /* _somdObjReferencesCached */
#endif /* SOMGD_somdObjReferencesCached */

/*
 * New Method: somdCreateFactory
 */
typedef SOMObject   SOMLINK somTP_SOMDServer_somdCreateFactory(SOMDServer somSelf, Environment *ev, 
		string className, 
		ExtendedNaming_PropertyList* props);
typedef somTP_SOMDServer_somdCreateFactory *somTD_SOMDServer_somdCreateFactory;
/*
 *  To be called from DSOM Factory Finder Service, a FactoryENC object.
 *  Will return a factory specified in idl by the idl modifier "factory",
 *  or if this doesn't exist will return a SOMClass for the object to be
 *  used as the generic factory.  PropertyList is not used.
 */
#define somMD_SOMDServer_somdCreateFactory "::SOMDServer::somdCreateFactory"
#define SOMDServer_somdCreateFactory(somSelf,ev,className,props) \
    (SOM_Resolve(somSelf, SOMDServer, somdCreateFactory) \
	(somSelf,ev,className,props))
#ifndef SOMGD_somdCreateFactory
    #if (defined(_somdCreateFactory) || defined(__somdCreateFactory))
        #undef _somdCreateFactory
        #undef __somdCreateFactory
        #define SOMGD_somdCreateFactory 1
    #else
        #define _somdCreateFactory SOMDServer_somdCreateFactory
    #endif /* _somdCreateFactory */
#endif /* SOMGD_somdCreateFactory */

/*
 * Full Names for Inherited Methods
 */
/* overridden methods */
#define SOMDServer_somDefaultInit SOMObject_somDefaultInit
#define SOMDServer_somDestruct SOMObject_somDestruct

#ifndef SOM_DONT_USE_INHERITED_MACROS
#define SOMDServer_somDefaultCopyInit SOMObject_somDefaultCopyInit
#define SOMDServer_somDefaultAssign SOMObject_somDefaultAssign
#define SOMDServer_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
#define SOMDServer_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
#define SOMDServer_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
#define SOMDServer_somDefaultConstAssign SOMObject_somDefaultConstAssign
#define SOMDServer_somDefaultVAssign SOMObject_somDefaultVAssign
#define SOMDServer_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
#define SOMDServer_somInit SOMObject_somInit
#define SOMDServer_somUninit SOMObject_somUninit
#define SOMDServer_somFree SOMObject_somFree
#define SOMDServer_somGetClass SOMObject_somGetClass
#define SOMDServer_somGetClassName SOMObject_somGetClassName
#define SOMDServer_somGetSize SOMObject_somGetSize
#define SOMDServer_somIsA SOMObject_somIsA
#define SOMDServer_somIsInstanceOf SOMObject_somIsInstanceOf
#define SOMDServer_somRespondsTo SOMObject_somRespondsTo
#define SOMDServer_somDispatch SOMObject_somDispatch
#define SOMDServer_somClassDispatch SOMObject_somClassDispatch
#define SOMDServer_somCastObj SOMObject_somCastObj
#define SOMDServer_somResetObj SOMObject_somResetObj
#define SOMDServer_somPrintSelf SOMObject_somPrintSelf
#define SOMDServer_somDumpSelf SOMObject_somDumpSelf
#define SOMDServer_somDumpSelfInt SOMObject_somDumpSelfInt
#endif /* SOM_DONT_USE_INHERITED_MACROS */

#endif       /* SOM_SOMDServer_h */
