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

/*
 *   This class is adapted from the book
 *     Class Construction in C and C++, Object Oriented Fundamentals
 *     by Roger Sessions, Copyright (c) 1992 Prentice Hall.
 *   Reprinted with permission.
 */


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


#ifndef SOM_link_ih
#define SOM_link_ih


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

#ifndef SOM_link_h
#include "link.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 {
	link next;
	link previous;
	baseType contents;
} __somC_link_ProtectedPrivateData;
typedef __somC_link_ProtectedPrivateData linkData, *linkDataPtr;

/*
 * -- GetData macro
 */
typedef linkDataPtr SOMLINK somTP_link_DataThunk(void*);
typedef somTP_link_DataThunk *somTD_link_DataThunk;

#define linkGetData(somSelf) \
   (((somTD_link_DataThunk)(linkCClassData.instanceDataToken))(somSelf))
#define _next somThis->next
#define _previous somThis->previous
#define _contents somThis->contents

/*
 * -- Primary Implementation File Support
 */
#if (defined(link_Class_Source) || defined(SOM_Module_link_Source))

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

static void SOMLINK __somC_link_classInit(SOMClass cls);


/*
 * Init ClassData Structures
 */
struct linkClassDataStructure SOMDLLEXPORT SOMDLINK linkClassData = {0};
struct linkCClassDataStructure SOMDLLEXPORT SOMDLINK linkCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_link0[] = {"link"}; /* class name */
static char __somC_Strings_link1[] = {"linkSetNext"}; /* method name */
static char __somC_Strings_link2[] = {"linkSetPrevious"}; /* method name */
static char __somC_Strings_link3[] = {"linkSetContents"}; /* method name */
static char __somC_Strings_link4[] = {"linkGetNext"}; /* method name */
static char __somC_Strings_link5[] = {"linkGetPrevious"}; /* method name */
static char __somC_Strings_link6[] = {"linkGetContents"}; /* method name */
static char __somC_Strings_link7[] = {"baseType"}; /* parent name */
static char __somC_Strings_link8[] = {"print"}; /* overridden method name */
static char __somC_Strings_link9[] = {"somInit"}; /* overridden method name */
static char __somC_Strings_link10[] = {"somDumpSelfInt"}; /* overridden method name */
static char * __somC_link_regIdsArray[] = {
	__somC_Strings_link0,
#ifndef __somC_link_regIds_linkSetNext
#define __somC_link_regIds_linkSetNext 1
#endif
	__somC_Strings_link1,
#ifndef __somC_link_regIds_linkSetPrevious
#define __somC_link_regIds_linkSetPrevious 2
#endif
	__somC_Strings_link2,
#ifndef __somC_link_regIds_linkSetContents
#define __somC_link_regIds_linkSetContents 3
#endif
	__somC_Strings_link3,
#ifndef __somC_link_regIds_linkGetNext
#define __somC_link_regIds_linkGetNext 4
#endif
	__somC_Strings_link4,
#ifndef __somC_link_regIds_linkGetPrevious
#define __somC_link_regIds_linkGetPrevious 5
#endif
	__somC_Strings_link5,
#ifndef __somC_link_regIds_linkGetContents
#define __somC_link_regIds_linkGetContents 6
#endif
	__somC_Strings_link6,
	__somC_Strings_link7,
#ifndef __somC_link_regIds_print
#define __somC_link_regIds_print 8
#endif
	__somC_Strings_link8,
#ifndef __somC_link_regIds_somInit
#define __somC_link_regIds_somInit 9
#endif
	__somC_Strings_link9,
#ifndef __somC_link_regIds_somDumpSelfInt
#define __somC_link_regIds_somDumpSelfInt 10
#endif
	__somC_Strings_link10
};


/*
 * Overridden method: print
 */
SOM_Scope void  SOMLINK print(link somSelf,
		FILE* outputFile);
static somMethodProc* link_parent_baseType_print_resolved;
#define link_parent_baseType_print(somSelf,outputFile) \
  ((( somTD_baseType_print ) \
    link_parent_baseType_print_resolved)(somSelf,outputFile))
#ifndef SOMGD_pmc_baseType_print
  #ifdef parent_baseType_print
     #define SOMGD_pmc_baseType_print 1
     #undef parent_baseType_print
  #else
     #define parent_baseType_print link_parent_baseType_print
  #endif /* parent_baseType_print */
#endif /* SOMGD_pmc_baseType_print */
#ifndef SOMGD_pmc_parent_print
  #ifdef parent_print
    #define SOMGD_pmc_parent_print
    #undef parent_print
  #else
#define parent_print link_parent_baseType_print
  #endif
#endif
#define link_parents_print(somSelf,outputFile) (\
   link_parent_baseType_print(somSelf,outputFile))
#define SOMPCALLlink_print
static somMethodProc* link_pcall_print_resolved;
#define link_pcall_print(somSelf,outputFile) \
  ((( somTD_baseType_print ) \
    link_pcall_print_resolved)(somSelf,outputFile))
static void  SOMLINK link_pcallResolve_print(link somSelf,
		FILE* outputFile)
{
   ((somTD_baseType_print) 
      somPCallResolve(somSelf, _link, _SOMMTOKEN_baseType(print)))(somSelf,outputFile);
}


/*
 * Overridden method: somInit
 */
SOM_Scope void  SOMLINK somInit(link somSelf);
/* pcalls for somInit/somUninit are turned off */
#define link_parent_baseType_somInit(__somSelf) 
#ifndef parent_baseType_somInit
   #define parent_baseType_somInit(__somSelf) 
#endif
#ifndef parent_somInit
   #define parent_somInit(__somSelf) 
#endif
#define link_parents_somInit(__somSelf) 

/*
 * Overridden method: somDumpSelfInt
 */
SOM_Scope void  SOMLINK somDumpSelfInt(link somSelf,
		long level);
static somMethodProc* link_parent_baseType_somDumpSelfInt_resolved;
#define link_parent_baseType_somDumpSelfInt(somSelf,level) \
  ((( somTD_SOMObject_somDumpSelfInt ) \
    link_parent_baseType_somDumpSelfInt_resolved)(somSelf,level))
#ifndef SOMGD_pmc_baseType_somDumpSelfInt
  #ifdef parent_baseType_somDumpSelfInt
     #define SOMGD_pmc_baseType_somDumpSelfInt 1
     #undef parent_baseType_somDumpSelfInt
  #else
     #define parent_baseType_somDumpSelfInt link_parent_baseType_somDumpSelfInt
  #endif /* parent_baseType_somDumpSelfInt */
#endif /* SOMGD_pmc_baseType_somDumpSelfInt */
#ifndef SOMGD_pmc_parent_somDumpSelfInt
  #ifdef parent_somDumpSelfInt
    #define SOMGD_pmc_parent_somDumpSelfInt
    #undef parent_somDumpSelfInt
  #else
#define parent_somDumpSelfInt link_parent_baseType_somDumpSelfInt
  #endif
#endif
#define link_parents_somDumpSelfInt(somSelf,level) (\
   link_parent_baseType_somDumpSelfInt(somSelf,level))
#define SOMPCALLlink_somDumpSelfInt
static somMethodProc* link_pcall_somDumpSelfInt_resolved;
#define link_pcall_somDumpSelfInt(somSelf,level) \
  ((( somTD_SOMObject_somDumpSelfInt ) \
    link_pcall_somDumpSelfInt_resolved)(somSelf,level))
static void  SOMLINK link_pcallResolve_somDumpSelfInt(link somSelf,
		long level)
{
   ((somTD_SOMObject_somDumpSelfInt) 
      somPCallResolve(somSelf, _link, _SOMMTOKEN_SOMObject(somDumpSelfInt)))(somSelf,level);
}


/*
 * New Method: linkSetNext
 */
SOM_Scope void  SOMLINK linkSetNext(link somSelf,
		link nextLink);
/*
 *  Set the next pointer on target link to new link.
 */
#ifndef somId_linkSetNext
#define somId_linkSetNext ((somId)&(__somC_link_regIdsArray[__somC_link_regIds_linkSetNext]))
#endif
#define SOM_MPR_MINFO_linkSetNext {0, 8, 0}
static somMpRowMethodInfo link_linkSetNext_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_linkSetNext};
#ifndef DEFINEDlink_linkSetNext_mp
#define DEFINEDlink_linkSetNext_mp
/*[ ::link::linkSetNext link_linkSetNext_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: ObjREF
*/
static struct { void * rows; unsigned char csr[4]; } link_linkSetNext_mp={&link_linkSetNext_mp_minfoRow, {
0x81, 0x01, 0x56},
};
#endif
#define linkSetNext_somMethodInfoValue 0
#define linkSetNext_somApplyStubValue &link_linkSetNext_mp.csr
#define linkSetNext_somHasMPlan 8

/*
 * New Method: linkSetPrevious
 */
SOM_Scope void  SOMLINK linkSetPrevious(link somSelf,
		link nextLink);
/*
 *  Set the previous pointer on target link to new link.
 */
#ifndef somId_linkSetPrevious
#define somId_linkSetPrevious ((somId)&(__somC_link_regIdsArray[__somC_link_regIds_linkSetPrevious]))
#endif
#define SOM_MPR_MINFO_linkSetPrevious {0, 8, 0}
static somMpRowMethodInfo link_linkSetPrevious_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_linkSetPrevious};
#ifndef DEFINEDlink_linkSetPrevious_mp
#define DEFINEDlink_linkSetPrevious_mp
/*[ ::link::linkSetPrevious link_linkSetPrevious_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: ObjREF
*/
static struct { void * rows; unsigned char csr[4]; } link_linkSetPrevious_mp={&link_linkSetPrevious_mp_minfoRow, {
0x81, 0x01, 0x56},
};
#endif
#define linkSetPrevious_somMethodInfoValue 0
#define linkSetPrevious_somApplyStubValue &link_linkSetPrevious_mp.csr
#define linkSetPrevious_somHasMPlan 8

/*
 * New Method: linkSetContents
 */
SOM_Scope void  SOMLINK linkSetContents(link somSelf,
		baseType newContents);
/*
 *  Set the contents pointer on target link to new object.
 */
#ifndef somId_linkSetContents
#define somId_linkSetContents ((somId)&(__somC_link_regIdsArray[__somC_link_regIds_linkSetContents]))
#endif
#define SOM_MPR_MINFO_linkSetContents {0, 8, 0}
static somMpRowMethodInfo link_linkSetContents_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_linkSetContents};
#ifndef DEFINEDlink_linkSetContents_mp
#define DEFINEDlink_linkSetContents_mp
/*[ ::link::linkSetContents link_linkSetContents_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: ObjREF
*/
static struct { void * rows; unsigned char csr[4]; } link_linkSetContents_mp={&link_linkSetContents_mp_minfoRow, {
0x81, 0x01, 0x56},
};
#endif
#define linkSetContents_somMethodInfoValue 0
#define linkSetContents_somApplyStubValue &link_linkSetContents_mp.csr
#define linkSetContents_somHasMPlan 8

/*
 * New Method: linkGetNext
 */
SOM_Scope link  SOMLINK linkGetNext(link somSelf);
/*
 *  Get the next link after the target link.
 */
#ifndef somId_linkGetNext
#define somId_linkGetNext ((somId)&(__somC_link_regIdsArray[__somC_link_regIds_linkGetNext]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: ObjREF
*/
#define linkGetNext_somMethodInfoValue 0
#define linkGetNext_somApplyStubValue 0x960105
#define linkGetNext_somHasMPlan 24

/*
 * New Method: linkGetPrevious
 */
SOM_Scope link  SOMLINK linkGetPrevious(link somSelf);
/*
 *  Get the previous link before the target link.
 */
#ifndef somId_linkGetPrevious
#define somId_linkGetPrevious ((somId)&(__somC_link_regIdsArray[__somC_link_regIds_linkGetPrevious]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: ObjREF
*/
#define linkGetPrevious_somMethodInfoValue 0
#define linkGetPrevious_somApplyStubValue 0x960105
#define linkGetPrevious_somHasMPlan 24

/*
 * New Method: linkGetContents
 */
SOM_Scope baseType  SOMLINK linkGetContents(link somSelf);
/*
 *  Get the contents of the target link.
 */
#ifndef somId_linkGetContents
#define somId_linkGetContents ((somId)&(__somC_link_regIdsArray[__somC_link_regIds_linkGetContents]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: ObjREF
*/
#define linkGetContents_somMethodInfoValue 0
#define linkGetContents_somApplyStubValue 0x960105
#define linkGetContents_somHasMPlan 24

/*
 * Functions for attributes.
 */

/*
 * Special Method Support
 */

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

somMethodDefn __somC_link_newNDMethodsArray[] = {
	{  (0 | linkSetNext_somHasMPlan), 0, (somMToken)0, (somMethodPtr)linkSetNext, 
	   0, (somMethodPtr)linkSetNext_somApplyStubValue, 
	   (somMethodInfo *) linkSetNext_somMethodInfoValue, &linkClassData.linkSetNext, 0, 1 },
	{  (0 | linkSetPrevious_somHasMPlan), 0, (somMToken)0, (somMethodPtr)linkSetPrevious, 
	   0, (somMethodPtr)linkSetPrevious_somApplyStubValue, 
	   (somMethodInfo *) linkSetPrevious_somMethodInfoValue, &linkClassData.linkSetPrevious, 0, 1 },
	{  (0 | linkSetContents_somHasMPlan), 0, (somMToken)0, (somMethodPtr)linkSetContents, 
	   0, (somMethodPtr)linkSetContents_somApplyStubValue, 
	   (somMethodInfo *) linkSetContents_somMethodInfoValue, &linkClassData.linkSetContents, 0, 1 },
	{  (0 | linkGetNext_somHasMPlan), 0, (somMToken)0, (somMethodPtr)linkGetNext, 
	   0, (somMethodPtr)linkGetNext_somApplyStubValue, 
	   (somMethodInfo *) linkGetNext_somMethodInfoValue, &linkClassData.linkGetNext, 0, 1 },
	{  (0 | linkGetPrevious_somHasMPlan), 0, (somMToken)0, (somMethodPtr)linkGetPrevious, 
	   0, (somMethodPtr)linkGetPrevious_somApplyStubValue, 
	   (somMethodInfo *) linkGetPrevious_somMethodInfoValue, &linkClassData.linkGetPrevious, 0, 1 },
	{  (0 | linkGetContents_somHasMPlan), 0, (somMToken)0, (somMethodPtr)linkGetContents, 
	   0, (somMethodPtr)linkGetContents_somApplyStubValue, 
	   (somMethodInfo *) linkGetContents_somMethodInfoValue, &linkClassData.linkGetContents, 0, 1 }
};

static somOverrideMethod_t2 __somC_link_overridesArray[] = {
{ &(__somC_link_regIdsArray[__somC_link_regIds_print]), 
#ifdef SOMPCALLlink_print
   (somMethodPtr*)&link_pcall_print_resolved, 
   (somMethodPtr)link_pcallResolve_print, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)print },
{ &(__somC_link_regIdsArray[__somC_link_regIds_somInit]), 
#ifdef SOMPCALLlink_somInit
   (somMethodPtr*)&link_pcall_somInit_resolved, 
   (somMethodPtr)link_pcallResolve_somInit, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)somInit },
{ &(__somC_link_regIdsArray[__somC_link_regIds_somDumpSelfInt]), 
#ifdef SOMPCALLlink_somDumpSelfInt
   (somMethodPtr*)&link_pcall_somDumpSelfInt_resolved, 
   (somMethodPtr)link_pcallResolve_somDumpSelfInt, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)somDumpSelfInt }
};

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

static struct linkClassDataStructure __somC_link_resolvedMTokens;

static void * __somC_link_CIB_unsharedClassVariablesPtr = 0;
som3ClassInfoStruct __somC_link_ClassInfo; /* C forward reference */

SOM_CIB link_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_link_classVars1,
	&__somC_link_CIB_unsharedClassVariablesPtr,	/* unsharedVars */
	link_MajorVersion,
	link_MinorVersion,
	0x40004,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	0,	/* classMeta */
	(somMethodPtr) __somC_link_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) somInit,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	11,	/* numRegIds */
	__somC_link_regIdsArray,	/* regIds */
	(sizeof(struct linkClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken),	/* numClassDataEntries */
	(somClassDataStructurePtr)&linkClassData,
	(somCClassDataStructurePtr)&linkCClassData,
	&__somC_link_ClassInfo,
	1,	/* numParents */
	(SOMClass**)__somC_link_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass**)__somC_link_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	0,	/* special overrides */
	6,	/* maxNDMethods */
	__somC_link_newNDMethodsArray,	/* newNDMethods */
	3,	/* numOverrides */
	__somC_link_overridesArray,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migrated methods */
};	/* CIB */

static som3ClassDetails __somC_link_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_link_parentMtabs,	/* parentMtabs */
	&link_ClassInitBlock,	/* CIB pointer */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_link_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_link_ClassInfo = {
	0,	/* classObject */
	&__somC_link_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

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

/* classinit function */
SOM_Scope void SOMLINK __somC_link_classInit(SOMClass somSelf)
{
   SOM_IgnoreWarning(somSelf);
   link_parent_baseType_somDumpSelfInt_resolved = 
	somParentNumResolve(linkCClassData.parentMtab, 1, _SOMMTOKEN_SOMObject(somDumpSelfInt)); 
   link_parent_baseType_print_resolved = 
	somParentNumResolve(linkCClassData.parentMtab, 1, _SOMMTOKEN_baseType(print)); 
}

/* NewClass Function */
SOMEXTERN SOMDLLEXPORT SOMClass  SOMLINK linkNewClass (long reqMajorVersion, long reqMinorVersion)
{
   if (_SOMCLASS_link && _somCheckVersion(_SOMCLASS_link,reqMajorVersion,reqMinorVersion))
      return _SOMCLASS_link;
__somC_link_parentArray[0] = (SOMClass *)&_SOMCLASS_baseType;
   /* require parents */
   if (!_SOMCLASS_baseType) baseTypeNewClass(baseType_MajorVersion,baseType_MinorVersion);
   /* return new class */
   return somBuildClass2( &link_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_link_ih */
