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

/*
 *    COMPONENT_NAME: somm
 * 
 *    ORIGINS: 27
 * 
 * 
 *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,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.
 * 
 */


#ifndef SOM_SOMMSingleInstance_h
#define SOM_SOMMSingleInstance_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_somu_snglicls
#ifdef SOM_DLL_somu
	/* export semantics */
	#if defined(SOM_DEFFILE_somu)\
	||(defined(SOM_DEFFILE_BY_DEFAULT)&&!defined(SOM_NODEFFILE_somu))\
	|| !defined(SOM_Module_snglicls_Source)
	#define SOM_IMPORTEXPORT_somu_snglicls
	#else
	#define SOM_IMPORTEXPORT_somu_snglicls SOMDLLEXPORT
	#endif
#else
	#define SOM_IMPORTEXPORT_somu_snglicls 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 SOMMSingleInstance
#define SOMMSingleInstance SOMObject
#endif
/*
 *  Classes that specify SOMMSingleInstance as their metaclass (or
 *  are derived from such a class) will only be allowed to have a
 *  single instance. Such classes are called single instance classes.
 * 
 *  For example, if a class named Dog specified SOMMSingleInstance
 *  as its explicit metaclass, only one dog object could be
 *  instantiated. Repeated invocations of somNew on the Dog class
 *  would simply return the same Dog instance.
 *  Note: it makes little or no sense for a metaclass to be a single
 *  instance class because, in most cases, it would be impossible to
 *  create subclasses of its first instance. (These subclasses would
 *  need to be additional instances of the metaclass.)
 * 
 *  The (one) instance of a single instance class is always created
 *  on the heap, either as a result of a user invoking somNew or
 *  somNewNoInit on the single instance class, or by internal code
 *  as a result of a user invoking any of the somRenew<...> object
 *  creation calls on the single instance class. In this second
 *  case, a proxy to the single instance is created in the location
 *  pointed to by the Renew call. This is done in case the specified
 *  location is not on the heap, and means that objects created
 *  using Renew operations won't have users the caller is not aware
 *  of (thus the memory can be reused when the caller is finished with
 *  the object, which is one purpose of the Renew methods). The size
 *  of a proxy to the single instance is 4 bytes (i.e., the proxy
 *  contains no instance data, and consists solely of a method table
 *  pointer). Thus, the proxy will always fit in the space reserved by
 *  the caller for use by a Renew method.
 * 
 *  Once the single instance exists, subsequent invocations of somNew
 *  or somNewNoInit return a pointer to the single instance.
 *  Invocations of the somRenew<...> object creation methods that
 *  point to the single instance do nothing; otherwise, a proxy to
 *  the single instance is created in the location pointed to by the
 *  Renew call (since a new instance of the class cannot be created).
 * 
 *  The single instance is reference counted, and is destroyed when
 *  the count goes to zero.
 * 
 *  There are two ways to retrieve the single instance of a single
 *  instance class:
 * 
 *   1) Invoke sommGetSingleInstance on the single instance class.
 *      This is the preferred way when the user is statically aware that
 *      the class is a single instance class.
 * 
 *   2) Invoke somNew or somNewNoInit on the class object of the using class.
 * 
 */

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

/*
 * Start of bindings for IDL types
 */

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

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

#define SOMMSingleInstance_MajorVersion 2
#define SOMMSingleInstance_MinorVersion 2

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

/*
 * Declare the ABI 2 ClassData structure
 */
SOMEXTERN struct SOMMSingleInstanceClassDataStructure {
	SOMClass classObject;
	somMToken sommGetSingleInstance;
	somMToken sommFreeSingleInstance;
} SOM_IMPORTEXPORT_somu_snglicls SOMDLINK SOMMSingleInstanceClassData;

/*
 * Declare the ABI 2 CClassData structure
 */
SOMEXTERN struct SOMMSingleInstanceCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken instanceDataToken;
} SOM_IMPORTEXPORT_somu_snglicls SOMDLINK SOMMSingleInstanceCClassData;

/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_SOMMSingleInstance (SOMMSingleInstanceClassData.classObject)
#ifndef SOMGD_SOMMSingleInstance
    #if (defined(_SOMMSingleInstance) || defined(__SOMMSingleInstance))
        #undef _SOMMSingleInstance
        #undef __SOMMSingleInstance
        #define SOMGD_SOMMSingleInstance 1
    #else
        #define _SOMMSingleInstance _SOMCLASS_SOMMSingleInstance
    #endif /* _SOMMSingleInstance */
#endif /* SOMGD_SOMMSingleInstance */
#define SOMMSingleInstance_classObj _SOMCLASS_SOMMSingleInstance
#define _SOMMTOKEN_SOMMSingleInstance(method) ((somMToken)SOMMSingleInstanceClassData.method)

/*
 * New and Renew macros for SOMMSingleInstance
 */
#define SOMMSingleInstanceNew() \
   ( _SOMMSingleInstance ? \
	_somNew(_SOMMSingleInstance) \
	: ( SOMMSingleInstanceNewClass(\
		SOMMSingleInstance_MajorVersion, \
		SOMMSingleInstance_MinorVersion),\
	   _somNew(_SOMMSingleInstance)))
#define SOMMSingleInstanceRenew(buf) \
   ( _SOMMSingleInstance ? \
	_somRenew(_SOMMSingleInstance, buf) \
	: ( SOMMSingleInstanceNewClass(\
		SOMMSingleInstance_MajorVersion, \
		SOMMSingleInstance_MinorVersion),\
	   _somRenew(_SOMMSingleInstance, buf)))

/*
 * New Method: sommGetSingleInstance
 */
typedef SOMObject   SOMLINK somTP_SOMMSingleInstance_sommGetSingleInstance(SOMMSingleInstance somSelf, Environment *ev);
typedef somTP_SOMMSingleInstance_sommGetSingleInstance *somTD_SOMMSingleInstance_sommGetSingleInstance;
/*
 *  Returns the single instance of the using class. If
 *  there isn't one, then it creates one first with somNew.
 */
#define somMD_SOMMSingleInstance_sommGetSingleInstance "::SOMMSingleInstance::sommGetSingleInstance"
#define SOMMSingleInstance_sommGetSingleInstance(somSelf,ev) \
    (SOM_Resolve(somSelf, SOMMSingleInstance, sommGetSingleInstance) \
	(somSelf,ev))
#ifndef SOMGD_sommGetSingleInstance
    #if (defined(_sommGetSingleInstance) || defined(__sommGetSingleInstance))
        #undef _sommGetSingleInstance
        #undef __sommGetSingleInstance
        #define SOMGD_sommGetSingleInstance 1
    #else
        #define _sommGetSingleInstance SOMMSingleInstance_sommGetSingleInstance
    #endif /* _sommGetSingleInstance */
#endif /* SOMGD_sommGetSingleInstance */

/*
 * New Method: sommFreeSingleInstance
 */
typedef void   SOMLINK somTP_SOMMSingleInstance_sommFreeSingleInstance(SOMMSingleInstance somSelf, Environment *ev);
typedef somTP_SOMMSingleInstance_sommFreeSingleInstance *somTD_SOMMSingleInstance_sommFreeSingleInstance;
/*
 *  Frees the single instance of the class.
 *  If there isn't one, then the method does nothing.
 */
#define somMD_SOMMSingleInstance_sommFreeSingleInstance "::SOMMSingleInstance::sommFreeSingleInstance"
#define SOMMSingleInstance_sommFreeSingleInstance(somSelf,ev) \
    (SOM_Resolve(somSelf, SOMMSingleInstance, sommFreeSingleInstance) \
	(somSelf,ev))
#ifndef SOMGD_sommFreeSingleInstance
    #if (defined(_sommFreeSingleInstance) || defined(__sommFreeSingleInstance))
        #undef _sommFreeSingleInstance
        #undef __sommFreeSingleInstance
        #define SOMGD_sommFreeSingleInstance 1
    #else
        #define _sommFreeSingleInstance SOMMSingleInstance_sommFreeSingleInstance
    #endif /* _sommFreeSingleInstance */
#endif /* SOMGD_sommFreeSingleInstance */

/*
 * Full Names for Inherited Methods
 */

#ifndef SOM_DONT_USE_INHERITED_MACROS
#define SOMMSingleInstance_somNew SOMClass_somNew
#define SOMMSingleInstance_somNewNoInit SOMClass_somNewNoInit
#define SOMMSingleInstance_somRenew SOMClass_somRenew
#define SOMMSingleInstance_somRenewNoInit SOMClass_somRenewNoInit
#define SOMMSingleInstance_somRenewNoZero SOMClass_somRenewNoZero
#define SOMMSingleInstance_somRenewNoInitNoZero SOMClass_somRenewNoInitNoZero
#define SOMMSingleInstance_somAllocate SOMClass_somAllocate
#define SOMMSingleInstance_somDeallocate SOMClass_somDeallocate
#define SOMMSingleInstance_somJoin SOMClass_somJoin
#define SOMMSingleInstance_somEndow SOMClass_somEndow
#define SOMMSingleInstance_somClassOfNewClassWithParents SOMClass_somClassOfNewClassWithParents
#define SOMMSingleInstance_somInitMIClass SOMClass_somInitMIClass
#define SOMMSingleInstance_somAddStaticMethod SOMClass_somAddStaticMethod
#define SOMMSingleInstance_somOverrideSMethod SOMClass_somOverrideSMethod
#define SOMMSingleInstance_somClassReady SOMClass_somClassReady
#define SOMMSingleInstance_somAddDynamicMethod SOMClass_somAddDynamicMethod
#define SOMMSingleInstance_somGetName SOMClass_somGetName
#define SOMMSingleInstance_somGetVersionNumbers SOMClass_somGetVersionNumbers
#define SOMMSingleInstance_somGetNumMethods SOMClass_somGetNumMethods
#define SOMMSingleInstance_somGetNumStaticMethods SOMClass_somGetNumStaticMethods
#define SOMMSingleInstance_somGetParents SOMClass_somGetParents
#define SOMMSingleInstance_somGetInstanceSize SOMClass_somGetInstanceSize
#define SOMMSingleInstance_somGetInstancePartSize SOMClass_somGetInstancePartSize
#define SOMMSingleInstance_somGetInstanceToken SOMClass_somGetInstanceToken
#define SOMMSingleInstance_somGetMemberToken SOMClass_somGetMemberToken
#define SOMMSingleInstance_somGetClassMtab SOMClass_somGetClassMtab
#define SOMMSingleInstance_somGetClassData SOMClass_somGetClassData
#define SOMMSingleInstance_somSetClassData SOMClass_somSetClassData
#define SOMMSingleInstance__get_somDataAlignment SOMClass__get_somDataAlignment
#define SOMMSingleInstance__get_somInstanceDataOffsets SOMClass__get_somInstanceDataOffsets
#define SOMMSingleInstance__get_somDirectInitClasses SOMClass__get_somDirectInitClasses
#define SOMMSingleInstance_somGetMethodDescriptor SOMClass_somGetMethodDescriptor
#define SOMMSingleInstance_somGetMethodIndex SOMClass_somGetMethodIndex
#define SOMMSingleInstance_somGetMethodToken SOMClass_somGetMethodToken
#define SOMMSingleInstance_somGetNthMethodInfo SOMClass_somGetNthMethodInfo
#define SOMMSingleInstance_somGetMarshalPlan SOMClass_somGetMarshalPlan
#define SOMMSingleInstance_somGetMethodData SOMClass_somGetMethodData
#define SOMMSingleInstance_somGetNthMethodData SOMClass_somGetNthMethodData
#define SOMMSingleInstance_somFindMethod SOMClass_somFindMethod
#define SOMMSingleInstance_somFindMethodOk SOMClass_somFindMethodOk
#define SOMMSingleInstance_somFindSMethod SOMClass_somFindSMethod
#define SOMMSingleInstance_somFindSMethodOk SOMClass_somFindSMethodOk
#define SOMMSingleInstance_somLookupMethod SOMClass_somLookupMethod
#define SOMMSingleInstance_somGetApplyStub SOMClass_somGetApplyStub
#define SOMMSingleInstance_somGetPClsMtab SOMClass_somGetPClsMtab
#define SOMMSingleInstance_somCheckVersion SOMClass_somCheckVersion
#define SOMMSingleInstance_somDescendedFrom SOMClass_somDescendedFrom
#define SOMMSingleInstance_somSupportsMethod SOMClass_somSupportsMethod
#define SOMMSingleInstance_somDefinedMethod SOMClass_somDefinedMethod
#define SOMMSingleInstance_somMethodImplOwner SOMClass_somMethodImplOwner
#define SOMMSingleInstance_somGetRdStub SOMClass_somGetRdStub
#define SOMMSingleInstance_somOverrideMtab SOMClass_somOverrideMtab
#define SOMMSingleInstance_somDefaultInit SOMObject_somDefaultInit
#define SOMMSingleInstance_somDestruct SOMObject_somDestruct
#define SOMMSingleInstance_somDefaultCopyInit SOMObject_somDefaultCopyInit
#define SOMMSingleInstance_somDefaultAssign SOMObject_somDefaultAssign
#define SOMMSingleInstance_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
#define SOMMSingleInstance_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
#define SOMMSingleInstance_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
#define SOMMSingleInstance_somDefaultConstAssign SOMObject_somDefaultConstAssign
#define SOMMSingleInstance_somDefaultVAssign SOMObject_somDefaultVAssign
#define SOMMSingleInstance_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
#define SOMMSingleInstance_somInit SOMObject_somInit
#define SOMMSingleInstance_somUninit SOMObject_somUninit
#define SOMMSingleInstance_somFree SOMObject_somFree
#define SOMMSingleInstance_somGetClass SOMObject_somGetClass
#define SOMMSingleInstance_somGetClassName SOMObject_somGetClassName
#define SOMMSingleInstance_somGetSize SOMObject_somGetSize
#define SOMMSingleInstance_somIsA SOMObject_somIsA
#define SOMMSingleInstance_somIsInstanceOf SOMObject_somIsInstanceOf
#define SOMMSingleInstance_somRespondsTo SOMObject_somRespondsTo
#define SOMMSingleInstance_somDispatch SOMObject_somDispatch
#define SOMMSingleInstance_somClassDispatch SOMObject_somClassDispatch
#define SOMMSingleInstance_somCastObj SOMObject_somCastObj
#define SOMMSingleInstance_somResetObj SOMObject_somResetObj
#define SOMMSingleInstance_somPrintSelf SOMObject_somPrintSelf
#define SOMMSingleInstance_somDumpSelf SOMObject_somDumpSelf
#define SOMMSingleInstance_somDumpSelfInt SOMObject_somDumpSelfInt
#endif /* SOM_DONT_USE_INHERITED_MACROS */

#endif       /* SOM_SOMMSingleInstance_h */
