
/*
 * This file was generated by the SOM Compiler.
 * FileName: dloc.ih.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.19
 *     SOM Emitter emitih.dll: 2.77.1.179
 */

/*
 *    COMPONENT_NAME: somx
 * 
 *    ORIGINS: 27
 * 
 * 
 *    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,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.
 * 
 *    @(#) 2.10.1.1 src/somples.os2/somd/c/animal/dloc.idl, somples.somd, som3.0 12/2/96 17:00:58 [12/4/96 15:09:09]
 * 
 * 
 * DISCLAIMER OF WARRANTIES.
 * The following [enclosed] code is sample code created by IBM
 * Corporation. This sample code is not part of any standard or IBM
 * product and is provided to you solely for the purpose of assisting
 * you in the development of your applications.  The code is provided
 * "AS IS". IBM MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE, REGARDING THE FUNCTION OR PERFORMANCE OF
 * THIS CODE.  IBM shall not be liable for any damages arising out of
 * your use of the sample code, even if they have been advised of the
 * possibility of such damages.
 * 
 * DISTRIBUTION.
 * This sample code can be freely distributed, copied, altered, and
 * incorporated into other software, provided that it bears the above
 * Copyright notice and DISCLAIMER intact.
 */


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


#ifndef SOM_dLocation_ih
#define SOM_dLocation_ih


#if (defined(dLocation_Class_Source) || defined(SOM_Module_dloc_Source))
#ifndef SOM_DLL_danimal
#define SOM_DLL_danimal
#endif
#endif


/*
 * Set the scope of method functions
 */
#ifndef SOM_Scope
#define SOM_Scope static
#endif

#ifndef SOM_dLocation_h
#include "dloc.h"
#endif
#include <somcsr.h>
#if defined(__IBMC__) && (__IBMC__ >= 300)
  #pragma info(none)
#else
  #if defined(__IBMC__)
     #pragma checkout(suspend)
  #endif
#endif


/*
 * -- Instance data
 */
typedef struct {
	string city;
        /*
         *  City where animal was born.
         */
	string state;
        /*
         *  State where animal was born.
         */
} __somC_dLocation_ProtectedPrivateData;
typedef __somC_dLocation_ProtectedPrivateData dLocationData, *dLocationDataPtr;

/*
 * -- GetData macro
 */
typedef dLocationDataPtr SOMLINK somTP_dLocation_DataThunk(void*);
typedef somTP_dLocation_DataThunk *somTD_dLocation_DataThunk;

#define dLocationGetData(somSelf) \
   (((somTD_dLocation_DataThunk)(dLocationCClassData.instanceDataToken))(somSelf))
#define _city somThis->city
#define _state somThis->state

/*
 * -- Primary Implementation File Support
 */
#if (defined(dLocation_Class_Source) || defined(SOM_Module_dloc_Source))

#ifndef dLocationMethodDebug
   #define dLocationMethodDebug(c,m) SOMMethodDebug(c,m)
#endif  /* dLocationMethodDebug */

static void SOMLINK __somC_dLocation_classInit(SOMClass cls);


/*
 * Init ClassData Structures
 */
struct dLocationClassDataStructure SOM_IMPORTEXPORT_danimal_dloc SOMDLINK dLocationClassData = {0};
struct dLocationCClassDataStructure SOM_IMPORTEXPORT_danimal_dloc SOMDLINK dLocationCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_dLocation0[] = {"dLocation"}; /* class name */
static char __somC_Strings_dLocation1[] = {"_get_city"}; /* method name */
static char __somC_Strings_dLocation2[] = {"_set_city"}; /* method name */
static char __somC_Strings_dLocation3[] = {"_get_state"}; /* method name */
static char __somC_Strings_dLocation4[] = {"_set_state"}; /* method name */
static char __somC_Strings_dLocation5[] = {"SOMObject"}; /* parent name */
static char __somC_Strings_dLocation6[] = {"somDefaultInit"}; /* overridden method name */
static char __somC_Strings_dLocation7[] = {"somDestruct"}; /* overridden method name */
static char * __somC_dLocation_regIdsArray[] = {
	__somC_Strings_dLocation0,
#ifndef __somC_dLocation_regIds__get_city
#define __somC_dLocation_regIds__get_city 1
#endif
	__somC_Strings_dLocation1,
#ifndef __somC_dLocation_regIds__set_city
#define __somC_dLocation_regIds__set_city 2
#endif
	__somC_Strings_dLocation2,
#ifndef __somC_dLocation_regIds__get_state
#define __somC_dLocation_regIds__get_state 3
#endif
	__somC_Strings_dLocation3,
#ifndef __somC_dLocation_regIds__set_state
#define __somC_dLocation_regIds__set_state 4
#endif
	__somC_Strings_dLocation4,
	__somC_Strings_dLocation5,
#ifndef __somC_dLocation_regIds_somDefaultInit
#define __somC_dLocation_regIds_somDefaultInit 6
#endif
	__somC_Strings_dLocation6,
#ifndef __somC_dLocation_regIds_somDestruct
#define __somC_dLocation_regIds_somDestruct 7
#endif
	__somC_Strings_dLocation7
};


/*
 * Overridden method: somDefaultInit
 */
SOM_Scope void  SOMLINK somDefaultInit(dLocation somSelf,
		som3InitCtrl* ctrl);

/*
 * Overridden method: somDestruct
 */
SOM_Scope void  SOMLINK somDestruct(dLocation somSelf,
		octet doFree,
		som3DestructCtrl* ctrl);

/*
 * New Method: _get_city
 */
SOM_Scope string  SOMLINK _get_city(dLocation somSelf, Environment *ev);
/*
 *  City where animal was born.
 */
#ifndef somId__get_city
#define somId__get_city ((somId)&(__somC_dLocation_regIdsArray[__somC_dLocation_regIds__get_city]))
#endif
#define SOM_MPR_MINFO__get_city {0, 8, 0}
static somMpRowMethodInfo dLocation__get_city_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_city};
#ifndef DEFINEDdLocation__get_city_mp
#define DEFINEDdLocation__get_city_mp
/*[ ::dLocation::_get_city dLocation__get_city_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dLocation__get_city_mp={&dLocation__get_city_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_city_somMethodInfoValue 0
#define _get_city_somApplyStubValue &dLocation__get_city_mp.csr
#define _get_city_somHasMPlan 8

/*
 * New Method: _set_city
 */
SOM_Scope void  SOMLINK _set_city(dLocation somSelf, Environment *ev,
		string city);
/*
 *  City where animal was born.
 */
#ifndef somId__set_city
#define somId__set_city ((somId)&(__somC_dLocation_regIdsArray[__somC_dLocation_regIds__set_city]))
#endif
#define SOM_MPR_MINFO__set_city {0, 12, 0}
static somMpRowMethodInfo dLocation__set_city_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_city};
#ifndef DEFINEDdLocation__set_city_mp
#define DEFINEDdLocation__set_city_mp
/*[ ::dLocation::_set_city dLocation__set_city_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dLocation__set_city_mp={&dLocation__set_city_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_city_somMethodInfoValue 0
#define _set_city_somApplyStubValue &dLocation__set_city_mp.csr
#define _set_city_somHasMPlan 8

/*
 * New Method: _get_state
 */
SOM_Scope string  SOMLINK _get_state(dLocation somSelf, Environment *ev);
/*
 *  State where animal was born.
 */
#ifndef somId__get_state
#define somId__get_state ((somId)&(__somC_dLocation_regIdsArray[__somC_dLocation_regIds__get_state]))
#endif
#define SOM_MPR_MINFO__get_state {0, 8, 0}
static somMpRowMethodInfo dLocation__get_state_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_state};
#ifndef DEFINEDdLocation__get_state_mp
#define DEFINEDdLocation__get_state_mp
/*[ ::dLocation::_get_state dLocation__get_state_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dLocation__get_state_mp={&dLocation__get_state_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_state_somMethodInfoValue 0
#define _get_state_somApplyStubValue &dLocation__get_state_mp.csr
#define _get_state_somHasMPlan 8

/*
 * New Method: _set_state
 */
SOM_Scope void  SOMLINK _set_state(dLocation somSelf, Environment *ev,
		string state);
/*
 *  State where animal was born.
 */
#ifndef somId__set_state
#define somId__set_state ((somId)&(__somC_dLocation_regIdsArray[__somC_dLocation_regIds__set_state]))
#endif
#define SOM_MPR_MINFO__set_state {0, 12, 0}
static somMpRowMethodInfo dLocation__set_state_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_state};
#ifndef DEFINEDdLocation__set_state_mp
#define DEFINEDdLocation__set_state_mp
/*[ ::dLocation::_set_state dLocation__set_state_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dLocation__set_state_mp={&dLocation__set_state_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_state_somMethodInfoValue 0
#define _set_state_somApplyStubValue &dLocation__set_state_mp.csr
#define _set_state_somHasMPlan 8

/*
 * Functions for attributes.
 */
SOM_Scope string  SOMLINK _get_city(dLocation somSelf, Environment *ev){
    dLocationData *somThis = dLocationGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->city);
}
SOM_Scope string  SOMLINK _get_state(dLocation somSelf, Environment *ev){
    dLocationData *somThis = dLocationGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->state);
}

/*
 * Special Method Support
 */
#define dLocation_BeginInitializer_somDefaultInit \
   if (!ctrl) { \
      ctrl = &globalCtrl;\
      memcpy(ctrl,&((dLocationCClassData.parentMtab)->initCtrl),sizeof(somInitCtrl)); \
   } \
   myMask = ctrl->mask; \
   somThis = (dLocationData*)((char*)somSelf + ctrl->info->dataOffset);\
   ctrl->info = (somInitInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1;

/*
 * somDestruct Macros
 */
#define dLocation_BeginDestructor \
   if (!ctrl) { \
      ctrl = &globalCtrl;\
      memcpy(ctrl,&((dLocationCClassData.parentMtab)->destructCtrl),sizeof(somDestructCtrl)); \
   } \
   somThis = (dLocationDataPtr)((char*)somSelf + ctrl->info->dataOffset);\
   myMask = ctrl->mask; 
#define dLocation_EndDestructor \
   ctrl->info = (somDestructInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1; \
   dLocation_DeInit_SOMObject_somDestruct(somSelf,0,ctrl); \
   if (doFree) _somDeallocate((SOMClass)((void*)_dLocation),(somToken)somSelf);
#define dLocation_DeInit_SOMObject_somDestruct(somSelf, doFree, ctrl) \
    if (myMask[0]&1) \
       ((somTD_SOMObject_somDestruct) \
           ctrl->info->defaultDestruct) \
               ((SOMObject )((void *) somSelf), 0, ctrl)

/*
 * Ancestor_Init Macros
 */
#define dLocation_Init_SOMObject_somDefaultInit(somSelf, ctrl) \
    if (myMask[0]&1) \
       ((somTD_SOMObject_somDefaultInit) \
           ctrl->info->defaultInit) \
               ((SOMObject )((void *) somSelf), ctrl)

/*
 * -- Routines and Structures to create the class object
 */
static SOMClass * __somC_dLocation_parentArray[] = {
	NULL,
};
void * __somC_dLocation_parentMtabs[1];

somMethodDefn __somC_dLocation_newNDMethodsArray[] = {
	{  (0 | _get_city_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_city, 
	   0, (somMethodPtr)_get_city_somApplyStubValue, 
	   (somMethodInfo *) _get_city_somMethodInfoValue, &dLocationClassData._get_city, 0, 1 },
	{  (0 | _set_city_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_city, 
	   0, (somMethodPtr)_set_city_somApplyStubValue, 
	   (somMethodInfo *) _set_city_somMethodInfoValue, &dLocationClassData._set_city, 0, 1 },
	{  (0 | _get_state_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_state, 
	   0, (somMethodPtr)_get_state_somApplyStubValue, 
	   (somMethodInfo *) _get_state_somMethodInfoValue, &dLocationClassData._get_state, 0, 1 },
	{  (0 | _set_state_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_state, 
	   0, (somMethodPtr)_set_state_somApplyStubValue, 
	   (somMethodInfo *) _set_state_somMethodInfoValue, &dLocationClassData._set_state, 0, 1 }
};

static somSpecialOverrides __somC_dLocation_specialOverridesArray[] = {
  {0, 0, (somMethodPtr)somDefaultInit },
  {0, 0, (somMethodPtr)somDestruct },
};

static somClassVars1 __somC_dLocation_classVars1 = {
	1,		/* layoutVersion */
	(void *)NULL,	/* extension */
	sizeof(dLocationData),	/* dataSize */
	4,		/* type code dataAlignment */
	(somMethodPtr)0,	/* classAllocate */
	(somMethodPtr)0	/* classDeallocate */
};

static struct dLocationClassDataStructure __somC_dLocation_resolvedMTokens;

static void * __somC_dLocation_CIB_unsharedClassVariablesPtr = 0;
som3ClassInfoStruct __somC_dLocation_ClassInfo; /* C forward reference */

SOM_CIB dLocation_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_dLocation_classVars1,
	&__somC_dLocation_CIB_unsharedClassVariablesPtr,	/* unsharedVars */
	dLocation_MajorVersion,
	dLocation_MinorVersion,
	0x60034,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	0,	/* classMeta */
	(somMethodPtr) __somC_dLocation_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) 0,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	8,	/* numRegIds */
	__somC_dLocation_regIdsArray,	/* regIds */
	(sizeof(struct dLocationClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken),	/* numClassDataEntries */
	(somClassDataStructurePtr)&dLocationClassData,
	(somCClassDataStructurePtr)&dLocationCClassData,
	&__somC_dLocation_ClassInfo,
	1,	/* numParents */
	(SOMClass**)__somC_dLocation_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass**)__somC_dLocation_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	__somC_dLocation_specialOverridesArray,	/* special overrides */
	4,	/* maxNDMethods */
	__somC_dLocation_newNDMethodsArray,	/* newNDMethods */
	0,	/* numOverrides */
	0,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migrated methods */
};	/* CIB */

static som3ClassDetails __somC_dLocation_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_dLocation_parentMtabs,	/* parentMtabs */
	&dLocation_ClassInitBlock,	/* CIB pointer */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_dLocation_resolvedMTokens,	/* resolvedMTokens */
	{0,0,0,0},	/* initCtrl */
	{0,0,0,0},	/* destructCtrl */
	{0,0,0,0},	/* assignCtrl */
	(long)1,	/* layoutVersion */
	(void*)NULL,	/* extension */
	(somDToken)NULL,	/* publicDataToken */
	(somDToken)NULL,	/* protectedDataToken */
};
som3ClassInfoStruct __somC_dLocation_ClassInfo = {
	0,	/* classObject */
	&__somC_dLocation_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

#if defined(__IBMC__) && (defined(_WIN32) || defined(__OS2__)) && !defined(SOM_PREWARP)
#pragma alloc_text (SEG0002, __somC_dLocation_classInit)
#pragma alloc_text (SEG0002, dLocationNewClass)
#endif

/* classinit function */
SOM_Scope void SOMLINK __somC_dLocation_classInit(SOMClass somSelf)
{
   SOM_IgnoreWarning(somSelf);
}

/* NewClass Function */
SOMEXTERN SOM_IMPORTEXPORT_danimal_dloc SOMClass  SOMLINK dLocationNewClass (long reqMajorVersion, long reqMinorVersion)
{
   if (_SOMCLASS_dLocation && _somCheckVersion(_SOMCLASS_dLocation,reqMajorVersion,reqMinorVersion))
      return _SOMCLASS_dLocation;
__somC_dLocation_parentArray[0] = (SOMClass *)&_SOMCLASS_SOMObject;
   /* require parents */
   if (!_SOMCLASS_SOMObject) SOMObjectNewClass(SOMObject_MajorVersion,SOMObject_MinorVersion);
   /* return new class */
   return somBuildClass2( &dLocation_ClassInitBlock, reqMajorVersion, reqMinorVersion );
}

#endif       /* Primary Implementation Support */
#if defined(__IBMC__) && (__IBMC__ >= 300)
  #pragma info(restore)
#else
  #if defined(__IBMC__)
    #pragma checkout(resume)
  #endif
#endif

#endif       /* SOM_dLocation_ih */
