
#ifndef SOM_Simple_xih
#define SOM_Simple_xih

#if defined(__IBMC__) && (__IBMC__ >= 300)
  #pragma info(none)
#else
  #if defined(__IBMC__)
     #pragma checkout(suspend)
  #endif
#endif


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

#ifndef SOM_Simple_xh
#include "simple.xh"
#endif
#include <somcsr.h>

/*
 * -- Instance Data
 */
typedef struct {
	long x;
	long y;
} __somC_Simple_ProtectedPrivateData;
typedef __somC_Simple_ProtectedPrivateData SimpleData, *SimpleDataPtr;

/*
 * -- GetData Macro
 */
typedef SimpleDataPtr SOMLINK somTP_Simple_DataThunk(void*);
typedef somTP_Simple_DataThunk *somTD_Simple_DataThunk;

#define SimpleGetData(somSelf) \
   (((somTD_Simple_DataThunk)(SimpleCClassData.instanceDataToken))(somSelf))
#ifdef VARIABLE_MACROS
#define _x somThis->x
#define _y somThis->y
#endif


/*
 * -- Method Macros for use in Method Procedures
 */
#ifdef METHOD_MACROS
  #define _somDefaultInit somSelf->somDefaultInit
  #define _somDestruct somSelf->somDestruct
  #define _somDefaultCopyInit somSelf->somDefaultCopyInit
  #define _somDefaultAssign somSelf->somDefaultAssign
  #define _somDefaultConstCopyInit somSelf->somDefaultConstCopyInit
  #define _somDefaultVCopyInit somSelf->somDefaultVCopyInit
  #define _somDefaultConstVCopyInit somSelf->somDefaultConstVCopyInit
  #define _somDefaultConstAssign somSelf->somDefaultConstAssign
  #define _somDefaultVAssign somSelf->somDefaultVAssign
  #define _somDefaultConstVAssign somSelf->somDefaultConstVAssign
  #define _somInit somSelf->somInit
  #define _somUninit somSelf->somUninit
  #define _somFree somSelf->somFree
  #define _somGetClass somSelf->somGetClass
  #define _somGetClassName somSelf->somGetClassName
  #define _somGetSize somSelf->somGetSize
  #define _somIsA somSelf->somIsA
  #define _somIsInstanceOf somSelf->somIsInstanceOf
  #define _somRespondsTo somSelf->somRespondsTo
  #define _somDispatch somSelf->somDispatch
  #define _somClassDispatch somSelf->somClassDispatch
  #define _somCastObj somSelf->somCastObj
  #define _somResetObj somSelf->somResetObj
  #define _somPrintSelf somSelf->somPrintSelf
  #define _somDumpSelf somSelf->somDumpSelf
  #define _somDumpSelfInt somSelf->somDumpSelfInt
  #define __get_x somSelf->_get_x
  #define __set_x somSelf->_set_x
  #define __get_y somSelf->_get_y
  #define __set_y somSelf->_set_y
  #define _withXandY somSelf->withXandY
  #define _withX somSelf->withX
  #define _somDefaultInit somSelf->somDefaultInit
  #define _somDestruct somSelf->somDestruct
#endif /* METHOD_MACROS */


/*
 * -- Primary Implementation File Support
 */
#if (defined(Simple_Class_Source) || defined(SOM_Module_simple_Source))

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

static void SOMLINK __somC_Simple_classInit(SOMClass *cls);


/*
 * Init ClassData Structures
 */
struct SimpleClassDataStructure SOMDLLEXPORT SOMDLINK SimpleClassData = {0};
struct SimpleCClassDataStructure SOMDLLEXPORT SOMDLINK SimpleCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_Simple0[] = {"Simple"}; /* class name */
static char __somC_Strings_Simple1[] = {"_get_x"}; /* method name */
static char __somC_Strings_Simple2[] = {"_set_x"}; /* method name */
static char __somC_Strings_Simple3[] = {"_get_y"}; /* method name */
static char __somC_Strings_Simple4[] = {"_set_y"}; /* method name */
static char __somC_Strings_Simple5[] = {"withXandY"}; /* method name */
static char __somC_Strings_Simple6[] = {"withX"}; /* method name */
static char __somC_Strings_Simple7[] = {"SOMObject"}; /* parent name */
static char __somC_Strings_Simple8[] = {"somDefaultInit"}; /* overridden method name */
static char __somC_Strings_Simple9[] = {"somDestruct"}; /* overridden method name */
static char * __somC_Simple_regIdsArray[] = {
	__somC_Strings_Simple0,
#ifndef __somC_Simple_regIds__get_x
#define __somC_Simple_regIds__get_x 1
#endif
	__somC_Strings_Simple1,
#ifndef __somC_Simple_regIds__set_x
#define __somC_Simple_regIds__set_x 2
#endif
	__somC_Strings_Simple2,
#ifndef __somC_Simple_regIds__get_y
#define __somC_Simple_regIds__get_y 3
#endif
	__somC_Strings_Simple3,
#ifndef __somC_Simple_regIds__set_y
#define __somC_Simple_regIds__set_y 4
#endif
	__somC_Strings_Simple4,
#ifndef __somC_Simple_regIds_withXandY
#define __somC_Simple_regIds_withXandY 5
#endif
	__somC_Strings_Simple5,
#ifndef __somC_Simple_regIds_withX
#define __somC_Simple_regIds_withX 6
#endif
	__somC_Strings_Simple6,
	__somC_Strings_Simple7,
#ifndef __somC_Simple_regIds_somDefaultInit
#define __somC_Simple_regIds_somDefaultInit 8
#endif
	__somC_Strings_Simple8,
#ifndef __somC_Simple_regIds_somDestruct
#define __somC_Simple_regIds_somDestruct 9
#endif
	__somC_Strings_Simple9
};


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

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

/*
 * New Method: _get_x
 */
SOM_Scope long  SOMLINK _get_x(Simple *somSelf);
/*
 * Method from the IDL attribute statement:
 * "attribute long x"
 */
#ifndef somId__get_x
#define somId__get_x ((somId)&(__somC_Simple_regIdsArray[__somC_Simple_regIds__get_x]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
*/
#define _get_x_somMethodInfoValue 0
#define _get_x_somApplyStubValue 0x830105
#define _get_x_somHasMPlan 24

/*
 * New Method: _set_x
 */
SOM_Scope void  SOMLINK _set_x(Simple *somSelf,
		long x);
/*
 * Method from the IDL attribute statement:
 * "attribute long x"
 */
#ifndef somId__set_x
#define somId__set_x ((somId)&(__somC_Simple_regIdsArray[__somC_Simple_regIds__set_x]))
#endif
#define SOM_MPR_MINFO__set_x {0, 8, 0}
static somMpRowMethodInfo Simple__set_x_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_x};
#ifndef DEFINEDSimple__set_x_mp
#define DEFINEDSimple__set_x_mp
/*[ ::Simple::_set_x Simple__set_x_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: Long
*/
static struct { void * rows; unsigned char csr[4]; } Simple__set_x_mp={&Simple__set_x_mp_minfoRow, {
0x81, 0x01, 0x43},
};
#endif
#define _set_x_somMethodInfoValue 0
#define _set_x_somApplyStubValue &Simple__set_x_mp.csr
#define _set_x_somHasMPlan 8

/*
 * New Method: _get_y
 */
SOM_Scope long  SOMLINK _get_y(Simple *somSelf);
/*
 * Method from the IDL attribute statement:
 * "attribute long y"
 */
#ifndef somId__get_y
#define somId__get_y ((somId)&(__somC_Simple_regIdsArray[__somC_Simple_regIds__get_y]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
*/
#define _get_y_somMethodInfoValue 0
#define _get_y_somApplyStubValue 0x830105
#define _get_y_somHasMPlan 24

/*
 * New Method: _set_y
 */
SOM_Scope void  SOMLINK _set_y(Simple *somSelf,
		long y);
/*
 * Method from the IDL attribute statement:
 * "attribute long y"
 */
#ifndef somId__set_y
#define somId__set_y ((somId)&(__somC_Simple_regIdsArray[__somC_Simple_regIds__set_y]))
#endif
#define SOM_MPR_MINFO__set_y {0, 8, 0}
static somMpRowMethodInfo Simple__set_y_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_y};
#ifndef DEFINEDSimple__set_y_mp
#define DEFINEDSimple__set_y_mp
/*[ ::Simple::_set_y Simple__set_y_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: Long
*/
static struct { void * rows; unsigned char csr[4]; } Simple__set_y_mp={&Simple__set_y_mp_minfoRow, {
0x81, 0x01, 0x43},
};
#endif
#define _set_y_somMethodInfoValue 0
#define _set_y_somApplyStubValue &Simple__set_y_mp.csr
#define _set_y_somHasMPlan 8

/*
 * New Method: withXandY
 */
SOM_Scope void  SOMLINK withXandY(Simple *somSelf,
		somInitCtrl* ctrl,
		long xValue,
		long yValue);
/*
 *  an initializer for Simple. sets x and y.
 */
#ifndef somId_withXandY
#define somId_withXandY ((somId)&(__somC_Simple_regIdsArray[__somC_Simple_regIds_withXandY]))
#endif
#define SOM_MPR_MINFO_withXandY {0, 16, 0}
static somMpRowMethodInfo Simple_withXandY_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_withXandY};
#ifndef DEFINEDSimple_withXandY_mp
#define DEFINEDSimple_withXandY_mp
/*[ ::Simple::withXandY Simple_withXandY_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: [OptPtr Character]
ARG 1[in]: Long
ARG 2[in]: Long
*/
static struct { void * rows; unsigned char csr[8]; } Simple_withXandY_mp={&Simple_withXandY_mp_minfoRow, {
0x81, 0x04, 0x57, 0x09, 0x43, 0x43},
};
#endif
#define withXandY_somMethodInfoValue 0
#define withXandY_somApplyStubValue &Simple_withXandY_mp.csr
#define withXandY_somHasMPlan 8

/*
 * New Method: withX
 */
SOM_Scope void  SOMLINK withX(Simple *somSelf,
		somInitCtrl* ctrl,
		long xValue);
/*
 *  an initializer for Simple. sets y = x+1.
 */
#ifndef somId_withX
#define somId_withX ((somId)&(__somC_Simple_regIdsArray[__somC_Simple_regIds_withX]))
#endif
#define SOM_MPR_MINFO_withX {0, 12, 0}
static somMpRowMethodInfo Simple_withX_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_withX};
#ifndef DEFINEDSimple_withX_mp
#define DEFINEDSimple_withX_mp
/*[ ::Simple::withX Simple_withX_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: [OptPtr Character]
ARG 1[in]: Long
*/
static struct { void * rows; unsigned char csr[8]; } Simple_withX_mp={&Simple_withX_mp_minfoRow, {
0x81, 0x03, 0x57, 0x09, 0x43},
};
#endif
#define withX_somMethodInfoValue 0
#define withX_somApplyStubValue &Simple_withX_mp.csr
#define withX_somHasMPlan 8

/*
 * Functions for attributes.
 */
SOM_Scope long  SOMLINK _get_x(Simple *somSelf){
    SimpleData *somThis = SimpleGetData(somSelf);

    return  (somThis->x);
}
SOM_Scope void  SOMLINK _set_x(Simple *somSelf,
		long x){
    SimpleData *somThis = SimpleGetData(somSelf);

    (somThis->x) = x;
}
SOM_Scope long  SOMLINK _get_y(Simple *somSelf){
    SimpleData *somThis = SimpleGetData(somSelf);

    return  (somThis->y);
}
SOM_Scope void  SOMLINK _set_y(Simple *somSelf,
		long y){
    SimpleData *somThis = SimpleGetData(somSelf);

    (somThis->y) = y;
}

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

/*
 * somDestruct Macros
 */
#define Simple_BeginDestructor \
   if (!ctrl) { \
      ctrl = &globalCtrl;\
      memcpy(ctrl,&((SimpleCClassData.parentMtab)->destructCtrl),sizeof(somDestructCtrl)); \
   } \
   somThis = (SimpleDataPtr)((char*)somSelf + ctrl->info->dataOffset);\
   myMask = ctrl->mask; 
#define Simple_EndDestructor \
   ctrl->info = (somDestructInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1; \
   Simple_DeInit_SOMObject_somDestruct(somSelf,0,ctrl); \
   if (doFree) ((SOMClass*)((void*)_Simple))->somDeallocate((somToken)somSelf);
#define Simple_DeInit_SOMObject_somDestruct(somSelf, doFree, ctrl) \
    if (myMask[0]&1) \
       ((somTD_SOMObject_somDestruct) \
           ctrl->info->defaultDestruct) \
               ((SOMObject *)((void *) somSelf), 0, ctrl)

/*
 * Newly Introduced Initializer Macros
 */
#define Simple_BeginInitializer_withX \
   if (!ctrl) { \
      ctrl = &globalCtrl; \
      memcpy(ctrl,&((SimpleCClassData.parentMtab)->initCtrl),sizeof(somInitCtrl)); \
   } \
   myMask = ctrl->mask; \
   somThis = (SimpleDataPtr)((char*)somSelf + ctrl->info->dataOffset);\
   ctrl->info = (somInitInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1;
#define Simple_BeginInitializer_withXandY \
   if (!ctrl) { \
      ctrl = &globalCtrl; \
      memcpy(ctrl,&((SimpleCClassData.parentMtab)->initCtrl),sizeof(somInitCtrl)); \
   } \
   myMask = ctrl->mask; \
   somThis = (SimpleDataPtr)((char*)somSelf + ctrl->info->dataOffset);\
   ctrl->info = (somInitInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1;

/*
 * Ancestor_Init Macros
 */
#define Simple_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_Simple_parentArray[] = {
	NULL,
};

void * __somC_Simple_parentMtabs[1];

somMethodDefn __somC_Simple_newNDMethodsArray[] = {
	{  (0 | _get_x_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_x, 
	   0, (somMethodPtr)_get_x_somApplyStubValue, 
	   (somMethodInfo *) _get_x_somMethodInfoValue, &SimpleClassData._get_x, 0, 1 },
	{  (0 | _set_x_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_x, 
	   0, (somMethodPtr)_set_x_somApplyStubValue, 
	   (somMethodInfo *) _set_x_somMethodInfoValue, &SimpleClassData._set_x, 0, 1 },
	{  (0 | _get_y_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_y, 
	   0, (somMethodPtr)_get_y_somApplyStubValue, 
	   (somMethodInfo *) _get_y_somMethodInfoValue, &SimpleClassData._get_y, 0, 1 },
	{  (0 | _set_y_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_y, 
	   0, (somMethodPtr)_set_y_somApplyStubValue, 
	   (somMethodInfo *) _set_y_somMethodInfoValue, &SimpleClassData._set_y, 0, 1 },
	{  (4 | withXandY_somHasMPlan), 0, (somMToken)0, (somMethodPtr)withXandY, 
	   0, (somMethodPtr)withXandY_somApplyStubValue, 
	   (somMethodInfo *) withXandY_somMethodInfoValue, &SimpleClassData.withXandY, 0, 1 },
	{  (4 | withX_somHasMPlan), 0, (somMToken)0, (somMethodPtr)withX, 
	   0, (somMethodPtr)withX_somApplyStubValue, 
	   (somMethodInfo *) withX_somMethodInfoValue, &SimpleClassData.withX, 0, 1 }
};

static somInitSymbols __somC_Simple_newInitializerSymbolsArray[] = {
  { &(__somC_Simple_regIdsArray[__somC_Simple_regIds_withX]),
    0, 0   },
  { &(__somC_Simple_regIdsArray[__somC_Simple_regIds_withXandY]),
    0, 0   }
};

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

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

static somMethodProc * __somC_Simple_resolvedInits[2];
static struct SimpleClassDataStructure __somC_Simple_resolvedMTokens;
static void * __somC_Simple_unsharedClassVariablesPtr = 0;
extern som3ClassInfoStruct __somC_Simple_ClassInfo; /* C++ forward reference */

static SOM_CIB Simple_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_Simple_classVars1,
	&__somC_Simple_unsharedClassVariablesPtr,	/* unsharedVars */
	Simple_MajorVersion,
	Simple_MinorVersion,
	0x40034,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	(SOMClass**)0,	/* classMeta */
	(somMethodPtr) __somC_Simple_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) 0,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	10,	/* numRegIds */
	__somC_Simple_regIdsArray,	/* regIds */
	((sizeof(struct SimpleClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken)),	/* numClassDataEntries */
	(somClassDataStructurePtr)&SimpleClassData,
	(somCClassDataStructurePtr)&SimpleCClassData,
	&__somC_Simple_ClassInfo,
	1,	/* numParents */
	(SOMClass***)__somC_Simple_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass***)__somC_Simple_parentArray,	/* directInitClasses */
	2,	/* numNewInitializers */
	__somC_Simple_newInitializerSymbolsArray,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	__somC_Simple_specialOverridesArray,	/* special overrides */
	6,	/* maxNDMethods */
	__somC_Simple_newNDMethodsArray,	/* newNDMethods */
	0,	/* numOverrides */
	0,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migratedMethods */
};	/* CIB */
static som3ClassDetails __somC_Simple_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_Simple_parentMtabs,	/* parentMtabs */
	&Simple_ClassInitBlock,	/* ClassInitBlock address */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	__somC_Simple_resolvedInits,	/* resolvedInits */
	(somClassDataStructure *)&__somC_Simple_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_Simple_ClassInfo = {
	0,	/* classObject */
	&__somC_Simple_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

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

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

/* NewClass Function */
SOMEXTERN SOMDLLEXPORT SOMClass * SOMLINK  SimpleNewClass (long reqMajorVersion, long reqMinorVersion)
{
    if (_SOMCLASS_Simple && _SOMCLASS_Simple->somCheckVersion(reqMajorVersion, reqMinorVersion))
          return ((SOMClass*)((void*)_SOMCLASS_Simple));
__somC_Simple_parentArray[0] = (SOMClass **)&_SOMCLASS_SOMObject;
   /* require parents */
   if (!_SOMCLASS_SOMObject) SOMObjectNewClass(SOMObject_MajorVersion,SOMObject_MinorVersion);
   /* return new class */
   return ((SOMClass*)(void*)somBuildClass2(&Simple_ClassInitBlock, reqMajorVersion, reqMinorVersion));
}

#if defined(__IBMC__) && (__IBMC__ >= 300)
  #pragma info(restore)
#else
  #if defined(__IBMC__)
    #pragma checkout(resume)
  #endif
#endif



#endif /* Primary Implementation Support */

#endif       /* SOM_Simple_xih */
