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

/*
 *   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.
 */


#ifndef SOM_linkedList_h
#define SOM_linkedList_h


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


/*
 * Passthru lines: File: "C.h", "before"
 */
#include "bt.h"
#include <stdio.h>

#include <som.h>

/*
 * -- 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 linkedList
#define linkedList SOMObject
#endif

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

/*
 * Start of bindings for IDL types
 */

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

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

#define linkedList_MajorVersion 0
#define linkedList_MinorVersion 0

/*
 * Declare the class creation procedure
 */
SOMEXTERN 
#if defined(SOM_Module_ll_Source)
        SOMDLLEXPORT
#else
    SOMDLLIMPORT
#endif
 SOMClass  SOMLINK linkedListNewClass(integer4 somtmajorVersion,
		integer4 somtminorVersion);

/*
 * Declare the ABI 2 ClassData structure
 */
SOMEXTERN struct linkedListClassDataStructure {
	SOMClass classObject;
	somMToken llHead;
	somMToken llTail;
	somMToken llLength;
	somMToken llSetMax;
	somMToken llLeft;
	somMToken llNext;
	somMToken llPrevious;
	somMToken llRetrieve;
	somMToken llReplace;
	somMToken llPromoteTail;
	somMToken llAddHead;
	somMToken llAddTail;
	somMToken llRemoveHead;
	somMToken llIsTail;
	somMToken llFreeContents;
	somMToken llTrace;
} 
#if defined(SOM_Module_ll_Source)
        SOMDLLEXPORT
#else
    SOMDLLIMPORT
#endif
 SOMDLINK linkedListClassData;

/*
 * Declare the ABI 2 CClassData structure
 */
SOMEXTERN struct linkedListCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken instanceDataToken;
} 
#if defined(SOM_Module_ll_Source)
        SOMDLLEXPORT
#else
    SOMDLLIMPORT
#endif
 SOMDLINK linkedListCClassData;

/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_linkedList (linkedListClassData.classObject)
#ifndef SOMGD_linkedList
    #if (defined(_linkedList) || defined(__linkedList))
        #undef _linkedList
        #undef __linkedList
        #define SOMGD_linkedList 1
    #else
        #define _linkedList _SOMCLASS_linkedList
    #endif /* _linkedList */
#endif /* SOMGD_linkedList */
#define linkedList_classObj _SOMCLASS_linkedList
#define _SOMMTOKEN_linkedList(method) ((somMToken)linkedListClassData.method)

/*
 * New and Renew macros for linkedList
 */
#define linkedListNew() \
   ( _linkedList ? \
	_somNew(_linkedList) \
	: ( linkedListNewClass(\
		linkedList_MajorVersion, \
		linkedList_MinorVersion),\
	   _somNew(_linkedList)))
#define linkedListRenew(buf) \
   ( _linkedList ? \
	_somRenew(_linkedList, buf) \
	: ( linkedListNewClass(\
		linkedList_MajorVersion, \
		linkedList_MinorVersion),\
	   _somRenew(_linkedList, buf)))

/*
 * New Method: llHead
 */
typedef baseType   SOMLINK somTP_linkedList_llHead(linkedList somSelf);
typedef somTP_linkedList_llHead *somTD_linkedList_llHead;
/*
 *  Make the head of the list the current link, and return its contents.
 */
#define somMD_linkedList_llHead "::linkedList::llHead"
#define linkedList_llHead(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llHead) \
	(somSelf))
#ifndef SOMGD_llHead
    #if (defined(_llHead) || defined(__llHead))
        #undef _llHead
        #undef __llHead
        #define SOMGD_llHead 1
    #else
        #define _llHead linkedList_llHead
    #endif /* _llHead */
#endif /* SOMGD_llHead */

/*
 * New Method: llTail
 */
typedef baseType   SOMLINK somTP_linkedList_llTail(linkedList somSelf);
typedef somTP_linkedList_llTail *somTD_linkedList_llTail;
/*
 *  Make the tail of the list the current link, and returns its contents.
 */
#define somMD_linkedList_llTail "::linkedList::llTail"
#define linkedList_llTail(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llTail) \
	(somSelf))
#ifndef SOMGD_llTail
    #if (defined(_llTail) || defined(__llTail))
        #undef _llTail
        #undef __llTail
        #define SOMGD_llTail 1
    #else
        #define _llTail linkedList_llTail
    #endif /* _llTail */
#endif /* SOMGD_llTail */

/*
 * New Method: llLength
 */
typedef long   SOMLINK somTP_linkedList_llLength(linkedList somSelf);
typedef somTP_linkedList_llLength *somTD_linkedList_llLength;
/*
 *  Return the number of links is the list.
 */
#define somMD_linkedList_llLength "::linkedList::llLength"
#define linkedList_llLength(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llLength) \
	(somSelf))
#ifndef SOMGD_llLength
    #if (defined(_llLength) || defined(__llLength))
        #undef _llLength
        #undef __llLength
        #define SOMGD_llLength 1
    #else
        #define _llLength linkedList_llLength
    #endif /* _llLength */
#endif /* SOMGD_llLength */

/*
 * New Method: llSetMax
 */
typedef void   SOMLINK somTP_linkedList_llSetMax(linkedList somSelf, 
		long newMax);
typedef somTP_linkedList_llSetMax *somTD_linkedList_llSetMax;
/*
 *  Set the maximum number of links the list can contain.
 */
#define somMD_linkedList_llSetMax "::linkedList::llSetMax"
#define linkedList_llSetMax(somSelf,newMax) \
    (SOM_Resolve(somSelf, linkedList, llSetMax) \
	(somSelf,newMax))
#ifndef SOMGD_llSetMax
    #if (defined(_llSetMax) || defined(__llSetMax))
        #undef _llSetMax
        #undef __llSetMax
        #define SOMGD_llSetMax 1
    #else
        #define _llSetMax linkedList_llSetMax
    #endif /* _llSetMax */
#endif /* SOMGD_llSetMax */

/*
 * New Method: llLeft
 */
typedef long   SOMLINK somTP_linkedList_llLeft(linkedList somSelf);
typedef somTP_linkedList_llLeft *somTD_linkedList_llLeft;
/*
 *  Return the number of links that can still be added to the list.
 */
#define somMD_linkedList_llLeft "::linkedList::llLeft"
#define linkedList_llLeft(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llLeft) \
	(somSelf))
#ifndef SOMGD_llLeft
    #if (defined(_llLeft) || defined(__llLeft))
        #undef _llLeft
        #undef __llLeft
        #define SOMGD_llLeft 1
    #else
        #define _llLeft linkedList_llLeft
    #endif /* _llLeft */
#endif /* SOMGD_llLeft */

/*
 * New Method: llNext
 */
typedef baseType   SOMLINK somTP_linkedList_llNext(linkedList somSelf);
typedef somTP_linkedList_llNext *somTD_linkedList_llNext;
/*
 *  Make the link after current the new current link, and
 *  return its contents.
 */
#define somMD_linkedList_llNext "::linkedList::llNext"
#define linkedList_llNext(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llNext) \
	(somSelf))
#ifndef SOMGD_llNext
    #if (defined(_llNext) || defined(__llNext))
        #undef _llNext
        #undef __llNext
        #define SOMGD_llNext 1
    #else
        #define _llNext linkedList_llNext
    #endif /* _llNext */
#endif /* SOMGD_llNext */

/*
 * New Method: llPrevious
 */
typedef baseType   SOMLINK somTP_linkedList_llPrevious(linkedList somSelf);
typedef somTP_linkedList_llPrevious *somTD_linkedList_llPrevious;
/*
 *  Make the link before current the new current link, and
 *  return its contents.
 */
#define somMD_linkedList_llPrevious "::linkedList::llPrevious"
#define linkedList_llPrevious(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llPrevious) \
	(somSelf))
#ifndef SOMGD_llPrevious
    #if (defined(_llPrevious) || defined(__llPrevious))
        #undef _llPrevious
        #undef __llPrevious
        #define SOMGD_llPrevious 1
    #else
        #define _llPrevious linkedList_llPrevious
    #endif /* _llPrevious */
#endif /* SOMGD_llPrevious */

/*
 * New Method: llRetrieve
 */
typedef baseType   SOMLINK somTP_linkedList_llRetrieve(linkedList somSelf);
typedef somTP_linkedList_llRetrieve *somTD_linkedList_llRetrieve;
/*
 *  Return the contents of the current link.
 */
#define somMD_linkedList_llRetrieve "::linkedList::llRetrieve"
#define linkedList_llRetrieve(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llRetrieve) \
	(somSelf))
#ifndef SOMGD_llRetrieve
    #if (defined(_llRetrieve) || defined(__llRetrieve))
        #undef _llRetrieve
        #undef __llRetrieve
        #define SOMGD_llRetrieve 1
    #else
        #define _llRetrieve linkedList_llRetrieve
    #endif /* _llRetrieve */
#endif /* SOMGD_llRetrieve */

/*
 * New Method: llReplace
 */
typedef baseType   SOMLINK somTP_linkedList_llReplace(linkedList somSelf, 
		baseType newElement);
typedef somTP_linkedList_llReplace *somTD_linkedList_llReplace;
/*
 *  Replace the contents of the current list but this new
 *  element, and return a pointer to the new contents.
 */
#define somMD_linkedList_llReplace "::linkedList::llReplace"
#define linkedList_llReplace(somSelf,newElement) \
    (SOM_Resolve(somSelf, linkedList, llReplace) \
	(somSelf,newElement))
#ifndef SOMGD_llReplace
    #if (defined(_llReplace) || defined(__llReplace))
        #undef _llReplace
        #undef __llReplace
        #define SOMGD_llReplace 1
    #else
        #define _llReplace linkedList_llReplace
    #endif /* _llReplace */
#endif /* SOMGD_llReplace */

/*
 * New Method: llPromoteTail
 */
typedef baseType   SOMLINK somTP_linkedList_llPromoteTail(linkedList somSelf);
typedef somTP_linkedList_llPromoteTail *somTD_linkedList_llPromoteTail;
/*
 *  Move the tail link to the head of the list, and return
 *  its contents.
 */
#define somMD_linkedList_llPromoteTail "::linkedList::llPromoteTail"
#define linkedList_llPromoteTail(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llPromoteTail) \
	(somSelf))
#ifndef SOMGD_llPromoteTail
    #if (defined(_llPromoteTail) || defined(__llPromoteTail))
        #undef _llPromoteTail
        #undef __llPromoteTail
        #define SOMGD_llPromoteTail 1
    #else
        #define _llPromoteTail linkedList_llPromoteTail
    #endif /* _llPromoteTail */
#endif /* SOMGD_llPromoteTail */

/*
 * New Method: llAddHead
 */
typedef baseType   SOMLINK somTP_linkedList_llAddHead(linkedList somSelf, 
		baseType newElement);
typedef somTP_linkedList_llAddHead *somTD_linkedList_llAddHead;
/*
 *  Add a link containing this new Element to the head of the
 *  list, and return a pointer to the new Element.
 */
#define somMD_linkedList_llAddHead "::linkedList::llAddHead"
#define linkedList_llAddHead(somSelf,newElement) \
    (SOM_Resolve(somSelf, linkedList, llAddHead) \
	(somSelf,newElement))
#ifndef SOMGD_llAddHead
    #if (defined(_llAddHead) || defined(__llAddHead))
        #undef _llAddHead
        #undef __llAddHead
        #define SOMGD_llAddHead 1
    #else
        #define _llAddHead linkedList_llAddHead
    #endif /* _llAddHead */
#endif /* SOMGD_llAddHead */

/*
 * New Method: llAddTail
 */
typedef baseType   SOMLINK somTP_linkedList_llAddTail(linkedList somSelf, 
		baseType newElement);
typedef somTP_linkedList_llAddTail *somTD_linkedList_llAddTail;
/*
 *  Add a link containing this new Element to the tail of the
 *  list, and return a pointer to the new Element.
 */
#define somMD_linkedList_llAddTail "::linkedList::llAddTail"
#define linkedList_llAddTail(somSelf,newElement) \
    (SOM_Resolve(somSelf, linkedList, llAddTail) \
	(somSelf,newElement))
#ifndef SOMGD_llAddTail
    #if (defined(_llAddTail) || defined(__llAddTail))
        #undef _llAddTail
        #undef __llAddTail
        #define SOMGD_llAddTail 1
    #else
        #define _llAddTail linkedList_llAddTail
    #endif /* _llAddTail */
#endif /* SOMGD_llAddTail */

/*
 * New Method: llRemoveHead
 */
typedef baseType   SOMLINK somTP_linkedList_llRemoveHead(linkedList somSelf);
typedef somTP_linkedList_llRemoveHead *somTD_linkedList_llRemoveHead;
/*
 *  Delete the link at the head of the list.
 */
#define somMD_linkedList_llRemoveHead "::linkedList::llRemoveHead"
#define linkedList_llRemoveHead(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llRemoveHead) \
	(somSelf))
#ifndef SOMGD_llRemoveHead
    #if (defined(_llRemoveHead) || defined(__llRemoveHead))
        #undef _llRemoveHead
        #undef __llRemoveHead
        #define SOMGD_llRemoveHead 1
    #else
        #define _llRemoveHead linkedList_llRemoveHead
    #endif /* _llRemoveHead */
#endif /* SOMGD_llRemoveHead */

/*
 * New Method: llIsTail
 */
typedef long   SOMLINK somTP_linkedList_llIsTail(linkedList somSelf);
typedef somTP_linkedList_llIsTail *somTD_linkedList_llIsTail;
/*
 *  Returns TRUE if the current link is the head of the list,
 *  FALSE otherwise.
 */
#define somMD_linkedList_llIsTail "::linkedList::llIsTail"
#define linkedList_llIsTail(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llIsTail) \
	(somSelf))
#ifndef SOMGD_llIsTail
    #if (defined(_llIsTail) || defined(__llIsTail))
        #undef _llIsTail
        #undef __llIsTail
        #define SOMGD_llIsTail 1
    #else
        #define _llIsTail linkedList_llIsTail
    #endif /* _llIsTail */
#endif /* SOMGD_llIsTail */

/*
 * New Method: llFreeContents
 */
typedef void   SOMLINK somTP_linkedList_llFreeContents(linkedList somSelf);
typedef somTP_linkedList_llFreeContents *somTD_linkedList_llFreeContents;
/*
 *  Frees the entire list, including the contents of each link.
 */
#define somMD_linkedList_llFreeContents "::linkedList::llFreeContents"
#define linkedList_llFreeContents(somSelf) \
    (SOM_Resolve(somSelf, linkedList, llFreeContents) \
	(somSelf))
#ifndef SOMGD_llFreeContents
    #if (defined(_llFreeContents) || defined(__llFreeContents))
        #undef _llFreeContents
        #undef __llFreeContents
        #define SOMGD_llFreeContents 1
    #else
        #define _llFreeContents linkedList_llFreeContents
    #endif /* _llFreeContents */
#endif /* SOMGD_llFreeContents */

/*
 * New Method: llTrace
 */
typedef void   SOMLINK somTP_linkedList_llTrace(linkedList somSelf, 
		FILE* output);
typedef somTP_linkedList_llTrace *somTD_linkedList_llTrace;
/*
 *  Trace the linkedList, useful for debugging.
 */
#define somMD_linkedList_llTrace "::linkedList::llTrace"
#define linkedList_llTrace(somSelf,output) \
    (SOM_Resolve(somSelf, linkedList, llTrace) \
	(somSelf,output))
#ifndef SOMGD_llTrace
    #if (defined(_llTrace) || defined(__llTrace))
        #undef _llTrace
        #undef __llTrace
        #define SOMGD_llTrace 1
    #else
        #define _llTrace linkedList_llTrace
    #endif /* _llTrace */
#endif /* SOMGD_llTrace */

/*
 * Full Names for Inherited Methods
 */
/* overridden methods */
#define linkedList_print baseType_print
#define linkedList_somInit SOMObject_somInit
#define linkedList_somUninit SOMObject_somUninit
#define linkedList_somDumpSelfInt SOMObject_somDumpSelfInt

#ifndef SOM_DONT_USE_INHERITED_MACROS
#define linkedList_match baseType_match
#define linkedList_somDefaultInit SOMObject_somDefaultInit
#define linkedList_somDestruct SOMObject_somDestruct
#define linkedList_somDefaultCopyInit SOMObject_somDefaultCopyInit
#define linkedList_somDefaultAssign SOMObject_somDefaultAssign
#define linkedList_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
#define linkedList_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
#define linkedList_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
#define linkedList_somDefaultConstAssign SOMObject_somDefaultConstAssign
#define linkedList_somDefaultVAssign SOMObject_somDefaultVAssign
#define linkedList_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
#define linkedList_somFree SOMObject_somFree
#define linkedList_somGetClass SOMObject_somGetClass
#define linkedList_somGetClassName SOMObject_somGetClassName
#define linkedList_somGetSize SOMObject_somGetSize
#define linkedList_somIsA SOMObject_somIsA
#define linkedList_somIsInstanceOf SOMObject_somIsInstanceOf
#define linkedList_somRespondsTo SOMObject_somRespondsTo
#define linkedList_somDispatch SOMObject_somDispatch
#define linkedList_somClassDispatch SOMObject_somClassDispatch
#define linkedList_somCastObj SOMObject_somCastObj
#define linkedList_somResetObj SOMObject_somResetObj
#define linkedList_somPrintSelf SOMObject_somPrintSelf
#define linkedList_somDumpSelf SOMObject_somDumpSelf
#endif /* SOM_DONT_USE_INHERITED_MACROS */

#endif       /* SOM_linkedList_h */
