
#ifndef SOM_Cell_xih
#define SOM_Cell_xih


#if (defined(Cell_Class_Source) || defined(SOM_Module_cell_Source))
#ifndef SOM_DLL_event
#define SOM_DLL_event
#endif
#endif

#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_Cell_xh
#include "cell.xh"
#endif
#include <somcsr.h>

/*
 * -- Instance Data
 */
typedef struct {
	long val;
	EventComm_Consumer* cons_if;
} __somC_Cell_ProtectedPrivateData;
typedef __somC_Cell_ProtectedPrivateData CellData, *CellDataPtr;

/*
 * -- GetData Macro
 */
typedef CellDataPtr SOMLINK somTP_Cell_DataThunk(void*);
typedef somTP_Cell_DataThunk *somTD_Cell_DataThunk;

#define CellGetData(somSelf) \
   (((somTD_Cell_DataThunk)(CellCClassData.instanceDataToken))(somSelf))
#ifdef VARIABLE_MACROS
#define _val somThis->val
#define _cons_if somThis->cons_if
#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_val somSelf->_get_val
  #define __set_val somSelf->_set_val
  #define _notifyEventCh somSelf->notifyEventCh
  #define _setConsumerIf somSelf->setConsumerIf
#endif /* METHOD_MACROS */


/*
 * -- Primary Implementation File Support
 */
#if (defined(Cell_Class_Source) || defined(SOM_Module_cell_Source))

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

static void SOMLINK __somC_Cell_classInit(SOMClass *cls);


/*
 * Init ClassData Structures
 */
struct CellClassDataStructure SOM_IMPORTEXPORT_event_cell SOMDLINK CellClassData = {0};
struct CellCClassDataStructure SOM_IMPORTEXPORT_event_cell SOMDLINK CellCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_Cell0[] = {"Cell"}; /* class name */
static char __somC_Strings_Cell1[] = {"_get_val"}; /* method name */
static char __somC_Strings_Cell2[] = {"_set_val"}; /* method name */
static char __somC_Strings_Cell3[] = {"notifyEventCh"}; /* method name */
static char __somC_Strings_Cell4[] = {"setConsumerIf"}; /* method name */
static char __somC_Strings_Cell5[] = {"SOMObject"}; /* parent name */
static char * __somC_Cell_regIdsArray[] = {
	__somC_Strings_Cell0,
#ifndef __somC_Cell_regIds__get_val
#define __somC_Cell_regIds__get_val 1
#endif
	__somC_Strings_Cell1,
#ifndef __somC_Cell_regIds__set_val
#define __somC_Cell_regIds__set_val 2
#endif
	__somC_Strings_Cell2,
#ifndef __somC_Cell_regIds_notifyEventCh
#define __somC_Cell_regIds_notifyEventCh 3
#endif
	__somC_Strings_Cell3,
#ifndef __somC_Cell_regIds_setConsumerIf
#define __somC_Cell_regIds_setConsumerIf 4
#endif
	__somC_Strings_Cell4,
	__somC_Strings_Cell5
};


/*
 * New Method: _get_val
 */
SOM_Scope long  SOMLINK _get_val(Cell *somSelf, Environment *ev);
/*
 * Method from the IDL attribute statement:
 * "attribute long val"
 */
#ifndef somId__get_val
#define somId__get_val ((somId)&(__somC_Cell_regIdsArray[__somC_Cell_regIds__get_val]))
#endif
#define SOM_MPR_MINFO__get_val {0, 8, 0}
static somMpRowMethodInfo Cell__get_val_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_val};
#ifndef DEFINEDCell__get_val_mp
#define DEFINEDCell__get_val_mp
/*[ ::Cell::_get_val Cell__get_val_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: Long
*/
static struct { void * rows; unsigned char csr[4]; } Cell__get_val_mp={&Cell__get_val_mp_minfoRow, {
0x86, 0x01, 0xa3},
};
#endif
#define _get_val_somMethodInfoValue 0
#define _get_val_somApplyStubValue &Cell__get_val_mp.csr
#define _get_val_somHasMPlan 8

/*
 * New Method: _set_val
 */
SOM_Scope void  SOMLINK _set_val(Cell *somSelf, Environment *ev,
		long val);
/*
 * Method from the IDL attribute statement:
 * "attribute long val"
 */
#ifndef somId__set_val
#define somId__set_val ((somId)&(__somC_Cell_regIdsArray[__somC_Cell_regIds__set_val]))
#endif
#define SOM_MPR_MINFO__set_val {0, 12, 0}
static somMpRowMethodInfo Cell__set_val_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_val};
#ifndef DEFINEDCell__set_val_mp
#define DEFINEDCell__set_val_mp
/*[ ::Cell::_set_val Cell__set_val_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: Long
*/
static struct { void * rows; unsigned char csr[4]; } Cell__set_val_mp={&Cell__set_val_mp_minfoRow, {
0x82, 0x01, 0x43},
};
#endif
#define _set_val_somMethodInfoValue 0
#define _set_val_somApplyStubValue &Cell__set_val_mp.csr
#define _set_val_somHasMPlan 8

/*
 * New Method: notifyEventCh
 */
SOM_Scope void  SOMLINK notifyEventCh(Cell *somSelf, Environment *ev);
#ifndef somId_notifyEventCh
#define somId_notifyEventCh ((somId)&(__somC_Cell_regIdsArray[__somC_Cell_regIds_notifyEventCh]))
#endif
#define SOM_MPR_MINFO_notifyEventCh {0, 8, 0}
static somMpRowMethodInfo Cell_notifyEventCh_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_notifyEventCh};
#ifndef DEFINEDCell_notifyEventCh_mp
#define DEFINEDCell_notifyEventCh_mp
/*[ ::Cell::notifyEventCh Cell_notifyEventCh_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
*/
static struct { void * rows; unsigned char csr[4]; } Cell_notifyEventCh_mp={&Cell_notifyEventCh_mp_minfoRow, {
0x82, 0x00},
};
#endif
#define notifyEventCh_somMethodInfoValue 0
#define notifyEventCh_somApplyStubValue &Cell_notifyEventCh_mp.csr
#define notifyEventCh_somHasMPlan 8

/*
 * New Method: setConsumerIf
 */
SOM_Scope void  SOMLINK setConsumerIf(Cell *somSelf, Environment *ev,
		EventComm_Consumer* consumer_if);
#ifndef somId_setConsumerIf
#define somId_setConsumerIf ((somId)&(__somC_Cell_regIdsArray[__somC_Cell_regIds_setConsumerIf]))
#endif
#define SOM_MPR_MINFO_setConsumerIf {0, 12, 0}
static somMpRowMethodInfo Cell_setConsumerIf_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_setConsumerIf};
#ifndef DEFINEDCell_setConsumerIf_mp
#define DEFINEDCell_setConsumerIf_mp
/*[ ::Cell::setConsumerIf Cell_setConsumerIf_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: ObjREF
*/
static struct { void * rows; unsigned char csr[4]; } Cell_setConsumerIf_mp={&Cell_setConsumerIf_mp_minfoRow, {
0x82, 0x01, 0x56},
};
#endif
#define setConsumerIf_somMethodInfoValue 0
#define setConsumerIf_somApplyStubValue &Cell_setConsumerIf_mp.csr
#define setConsumerIf_somHasMPlan 8

/*
 * Functions for attributes.
 */
SOM_Scope long  SOMLINK _get_val(Cell *somSelf, Environment *ev){
    CellData *somThis = CellGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->val);
}

/*
 * Special Method Support
 */

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

void * __somC_Cell_parentMtabs[1];

somMethodDefn __somC_Cell_newNDMethodsArray[] = {
	{  (0 | _get_val_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_val, 
	   0, (somMethodPtr)_get_val_somApplyStubValue, 
	   (somMethodInfo *) _get_val_somMethodInfoValue, &CellClassData._get_val, 0, 1 },
	{  (0 | _set_val_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_val, 
	   0, (somMethodPtr)_set_val_somApplyStubValue, 
	   (somMethodInfo *) _set_val_somMethodInfoValue, &CellClassData._set_val, 0, 1 },
	{  (0 | notifyEventCh_somHasMPlan), 0, (somMToken)0, (somMethodPtr)notifyEventCh, 
	   0, (somMethodPtr)notifyEventCh_somApplyStubValue, 
	   (somMethodInfo *) notifyEventCh_somMethodInfoValue, &CellClassData.notifyEventCh, 0, 1 },
	{  (0 | setConsumerIf_somHasMPlan), 0, (somMToken)0, (somMethodPtr)setConsumerIf, 
	   0, (somMethodPtr)setConsumerIf_somApplyStubValue, 
	   (somMethodInfo *) setConsumerIf_somMethodInfoValue, &CellClassData.setConsumerIf, 0, 1 }
};

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

static struct CellClassDataStructure __somC_Cell_resolvedMTokens;
static void * __somC_Cell_unsharedClassVariablesPtr = 0;
extern som3ClassInfoStruct __somC_Cell_ClassInfo; /* C++ forward reference */

static SOM_CIB Cell_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_Cell_classVars1,
	&__somC_Cell_unsharedClassVariablesPtr,	/* unsharedVars */
	Cell_MajorVersion,
	Cell_MinorVersion,
	0x60004,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	(SOMClass**)0,	/* classMeta */
	(somMethodPtr) __somC_Cell_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) 0,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	6,	/* numRegIds */
	__somC_Cell_regIdsArray,	/* regIds */
	((sizeof(struct CellClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken)),	/* numClassDataEntries */
	(somClassDataStructurePtr)&CellClassData,
	(somCClassDataStructurePtr)&CellCClassData,
	&__somC_Cell_ClassInfo,
	1,	/* numParents */
	(SOMClass***)__somC_Cell_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass***)__somC_Cell_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	0,	/* special overrides */
	4,	/* maxNDMethods */
	__somC_Cell_newNDMethodsArray,	/* newNDMethods */
	0,	/* numOverrides */
	0,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migratedMethods */
};	/* CIB */
static som3ClassDetails __somC_Cell_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_Cell_parentMtabs,	/* parentMtabs */
	&Cell_ClassInitBlock,	/* ClassInitBlock address */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_Cell_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_Cell_ClassInfo = {
	0,	/* classObject */
	&__somC_Cell_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

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

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

/* NewClass Function */
SOMEXTERN SOM_IMPORTEXPORT_event_cell SOMClass * SOMLINK  CellNewClass (long reqMajorVersion, long reqMinorVersion)
{
    if (_SOMCLASS_Cell && _SOMCLASS_Cell->somCheckVersion(reqMajorVersion, reqMinorVersion))
          return ((SOMClass*)((void*)_SOMCLASS_Cell));
__somC_Cell_parentArray[0] = (SOMClass **)&_SOMCLASS_SOMObject;
   /* require parents */
   if (!_SOMCLASS_SOMObject) SOMObjectNewClass(SOMObject_MajorVersion,SOMObject_MinorVersion);
   /* return new class */
   return ((SOMClass*)(void*)somBuildClass2(&Cell_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_Cell_xih */
