
/*
 * This file was generated by the SOM Compiler.
 * FileName: danimal.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.11.1.1 src/somples.os2/somd/c/animal/danimal.idl, somples.somd, som3.0 12/2/96 16:59:31 [12/4/96 15:09:01]
 * 
 * 
 * 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_dAnimal_ih
#define SOM_dAnimal_ih


#if (defined(dAnimal_Class_Source) || defined(SOM_Module_danimal_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_dAnimal_h
#include "danimal.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 name;
        /*
         *  Name of animal.
         */
	string type;
        /*
         *  Type of animal.
         */
	string food;
        /*
         *  Food animal likes to eat.
         */
	dLocation loc;
        /*
         *  Object with city and state where animal lives.
         */
	string buff;
        /*
         *  Work area for display method.
         */
} __somC_dAnimal_ProtectedPrivateData;
typedef __somC_dAnimal_ProtectedPrivateData dAnimalData, *dAnimalDataPtr;

/*
 * -- GetData macro
 */
typedef dAnimalDataPtr SOMLINK somTP_dAnimal_DataThunk(void*);
typedef somTP_dAnimal_DataThunk *somTD_dAnimal_DataThunk;

#define dAnimalGetData(somSelf) \
   (((somTD_dAnimal_DataThunk)(dAnimalCClassData.instanceDataToken))(somSelf))
#define _name somThis->name
#define _type somThis->type
#define _food somThis->food
#define _loc somThis->loc
#define _buff somThis->buff

/*
 * -- Primary Implementation File Support
 */
#if (defined(dAnimal_Class_Source) || defined(SOM_Module_danimal_Source))

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

static void SOMLINK __somC_dAnimal_classInit(SOMClass cls);


/*
 * Init ClassData Structures
 */
struct dAnimalClassDataStructure SOM_IMPORTEXPORT_danimal_danimal SOMDLINK dAnimalClassData = {0};
struct dAnimalCClassDataStructure SOM_IMPORTEXPORT_danimal_danimal SOMDLINK dAnimalCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_dAnimal0[] = {"dAnimal"}; /* class name */
static char __somC_Strings_dAnimal1[] = {"_get_name"}; /* method name */
static char __somC_Strings_dAnimal2[] = {"_set_name"}; /* method name */
static char __somC_Strings_dAnimal3[] = {"_get_type"}; /* method name */
static char __somC_Strings_dAnimal4[] = {"_set_type"}; /* method name */
static char __somC_Strings_dAnimal5[] = {"_get_food"}; /* method name */
static char __somC_Strings_dAnimal6[] = {"_set_food"}; /* method name */
static char __somC_Strings_dAnimal7[] = {"_get_loc"}; /* method name */
static char __somC_Strings_dAnimal8[] = {"_set_loc"}; /* method name */
static char __somC_Strings_dAnimal9[] = {"_get_buff"}; /* method name */
static char __somC_Strings_dAnimal10[] = {"_set_buff"}; /* method name */
static char __somC_Strings_dAnimal11[] = {"display"}; /* method name */
static char __somC_Strings_dAnimal12[] = {"SOMObject"}; /* parent name */
static char __somC_Strings_dAnimal13[] = {"somDefaultInit"}; /* overridden method name */
static char __somC_Strings_dAnimal14[] = {"somDestruct"}; /* overridden method name */
static char * __somC_dAnimal_regIdsArray[] = {
	__somC_Strings_dAnimal0,
#ifndef __somC_dAnimal_regIds__get_name
#define __somC_dAnimal_regIds__get_name 1
#endif
	__somC_Strings_dAnimal1,
#ifndef __somC_dAnimal_regIds__set_name
#define __somC_dAnimal_regIds__set_name 2
#endif
	__somC_Strings_dAnimal2,
#ifndef __somC_dAnimal_regIds__get_type
#define __somC_dAnimal_regIds__get_type 3
#endif
	__somC_Strings_dAnimal3,
#ifndef __somC_dAnimal_regIds__set_type
#define __somC_dAnimal_regIds__set_type 4
#endif
	__somC_Strings_dAnimal4,
#ifndef __somC_dAnimal_regIds__get_food
#define __somC_dAnimal_regIds__get_food 5
#endif
	__somC_Strings_dAnimal5,
#ifndef __somC_dAnimal_regIds__set_food
#define __somC_dAnimal_regIds__set_food 6
#endif
	__somC_Strings_dAnimal6,
#ifndef __somC_dAnimal_regIds__get_loc
#define __somC_dAnimal_regIds__get_loc 7
#endif
	__somC_Strings_dAnimal7,
#ifndef __somC_dAnimal_regIds__set_loc
#define __somC_dAnimal_regIds__set_loc 8
#endif
	__somC_Strings_dAnimal8,
#ifndef __somC_dAnimal_regIds__get_buff
#define __somC_dAnimal_regIds__get_buff 9
#endif
	__somC_Strings_dAnimal9,
#ifndef __somC_dAnimal_regIds__set_buff
#define __somC_dAnimal_regIds__set_buff 10
#endif
	__somC_Strings_dAnimal10,
#ifndef __somC_dAnimal_regIds_display
#define __somC_dAnimal_regIds_display 11
#endif
	__somC_Strings_dAnimal11,
	__somC_Strings_dAnimal12,
#ifndef __somC_dAnimal_regIds_somDefaultInit
#define __somC_dAnimal_regIds_somDefaultInit 13
#endif
	__somC_Strings_dAnimal13,
#ifndef __somC_dAnimal_regIds_somDestruct
#define __somC_dAnimal_regIds_somDestruct 14
#endif
	__somC_Strings_dAnimal14
};


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

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

/*
 * New Method: _get_name
 */
SOM_Scope string  SOMLINK _get_name(dAnimal somSelf, Environment *ev);
/*
 *  Name of animal.
 */
#ifndef somId__get_name
#define somId__get_name ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__get_name]))
#endif
#define SOM_MPR_MINFO__get_name {0, 8, 0}
static somMpRowMethodInfo dAnimal__get_name_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_name};
#ifndef DEFINEDdAnimal__get_name_mp
#define DEFINEDdAnimal__get_name_mp
/*[ ::dAnimal::_get_name dAnimal__get_name_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__get_name_mp={&dAnimal__get_name_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_name_somMethodInfoValue 0
#define _get_name_somApplyStubValue &dAnimal__get_name_mp.csr
#define _get_name_somHasMPlan 8

/*
 * New Method: _set_name
 */
SOM_Scope void  SOMLINK _set_name(dAnimal somSelf, Environment *ev,
		string name);
/*
 *  Name of animal.
 */
#ifndef somId__set_name
#define somId__set_name ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__set_name]))
#endif
#define SOM_MPR_MINFO__set_name {0, 12, 0}
static somMpRowMethodInfo dAnimal__set_name_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_name};
#ifndef DEFINEDdAnimal__set_name_mp
#define DEFINEDdAnimal__set_name_mp
/*[ ::dAnimal::_set_name dAnimal__set_name_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__set_name_mp={&dAnimal__set_name_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_name_somMethodInfoValue 0
#define _set_name_somApplyStubValue &dAnimal__set_name_mp.csr
#define _set_name_somHasMPlan 8

/*
 * New Method: _get_type
 */
SOM_Scope string  SOMLINK _get_type(dAnimal somSelf, Environment *ev);
/*
 *  Type of animal.
 */
#ifndef somId__get_type
#define somId__get_type ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__get_type]))
#endif
#define SOM_MPR_MINFO__get_type {0, 8, 0}
static somMpRowMethodInfo dAnimal__get_type_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_type};
#ifndef DEFINEDdAnimal__get_type_mp
#define DEFINEDdAnimal__get_type_mp
/*[ ::dAnimal::_get_type dAnimal__get_type_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__get_type_mp={&dAnimal__get_type_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_type_somMethodInfoValue 0
#define _get_type_somApplyStubValue &dAnimal__get_type_mp.csr
#define _get_type_somHasMPlan 8

/*
 * New Method: _set_type
 */
SOM_Scope void  SOMLINK _set_type(dAnimal somSelf, Environment *ev,
		string type);
/*
 *  Type of animal.
 */
#ifndef somId__set_type
#define somId__set_type ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__set_type]))
#endif
#define SOM_MPR_MINFO__set_type {0, 12, 0}
static somMpRowMethodInfo dAnimal__set_type_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_type};
#ifndef DEFINEDdAnimal__set_type_mp
#define DEFINEDdAnimal__set_type_mp
/*[ ::dAnimal::_set_type dAnimal__set_type_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__set_type_mp={&dAnimal__set_type_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_type_somMethodInfoValue 0
#define _set_type_somApplyStubValue &dAnimal__set_type_mp.csr
#define _set_type_somHasMPlan 8

/*
 * New Method: _get_food
 */
SOM_Scope string  SOMLINK _get_food(dAnimal somSelf, Environment *ev);
/*
 *  Food animal likes to eat.
 */
#ifndef somId__get_food
#define somId__get_food ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__get_food]))
#endif
#define SOM_MPR_MINFO__get_food {0, 8, 0}
static somMpRowMethodInfo dAnimal__get_food_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_food};
#ifndef DEFINEDdAnimal__get_food_mp
#define DEFINEDdAnimal__get_food_mp
/*[ ::dAnimal::_get_food dAnimal__get_food_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__get_food_mp={&dAnimal__get_food_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_food_somMethodInfoValue 0
#define _get_food_somApplyStubValue &dAnimal__get_food_mp.csr
#define _get_food_somHasMPlan 8

/*
 * New Method: _set_food
 */
SOM_Scope void  SOMLINK _set_food(dAnimal somSelf, Environment *ev,
		string food);
/*
 *  Food animal likes to eat.
 */
#ifndef somId__set_food
#define somId__set_food ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__set_food]))
#endif
#define SOM_MPR_MINFO__set_food {0, 12, 0}
static somMpRowMethodInfo dAnimal__set_food_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_food};
#ifndef DEFINEDdAnimal__set_food_mp
#define DEFINEDdAnimal__set_food_mp
/*[ ::dAnimal::_set_food dAnimal__set_food_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__set_food_mp={&dAnimal__set_food_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_food_somMethodInfoValue 0
#define _set_food_somApplyStubValue &dAnimal__set_food_mp.csr
#define _set_food_somHasMPlan 8

/*
 * New Method: _get_loc
 */
SOM_Scope dLocation  SOMLINK _get_loc(dAnimal somSelf, Environment *ev);
/*
 *  Object with city and state where animal lives.
 */
#ifndef somId__get_loc
#define somId__get_loc ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__get_loc]))
#endif
#define SOM_MPR_MINFO__get_loc {0, 8, 0}
static somMpRowMethodInfo dAnimal__get_loc_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_loc};
#ifndef DEFINEDdAnimal__get_loc_mp
#define DEFINEDdAnimal__get_loc_mp
/*[ ::dAnimal::_get_loc dAnimal__get_loc_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[out]: ObjREF
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__get_loc_mp={&dAnimal__get_loc_mp_minfoRow, {
0x86, 0x01, 0x96},
};
#endif
#define _get_loc_somMethodInfoValue 0
#define _get_loc_somApplyStubValue &dAnimal__get_loc_mp.csr
#define _get_loc_somHasMPlan 8

/*
 * New Method: _set_loc
 */
SOM_Scope void  SOMLINK _set_loc(dAnimal somSelf, Environment *ev,
		dLocation loc);
/*
 *  Object with city and state where animal lives.
 */
#ifndef somId__set_loc
#define somId__set_loc ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__set_loc]))
#endif
#define SOM_MPR_MINFO__set_loc {0, 12, 0}
static somMpRowMethodInfo dAnimal__set_loc_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_loc};
#ifndef DEFINEDdAnimal__set_loc_mp
#define DEFINEDdAnimal__set_loc_mp
/*[ ::dAnimal::_set_loc dAnimal__set_loc_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: ObjREF
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__set_loc_mp={&dAnimal__set_loc_mp_minfoRow, {
0x82, 0x01, 0x56},
};
#endif
#define _set_loc_somMethodInfoValue 0
#define _set_loc_somApplyStubValue &dAnimal__set_loc_mp.csr
#define _set_loc_somHasMPlan 8

/*
 * New Method: _get_buff
 */
SOM_Scope string  SOMLINK _get_buff(dAnimal somSelf, Environment *ev);
/*
 *  Work area for display method.
 */
#ifndef somId__get_buff
#define somId__get_buff ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__get_buff]))
#endif
#define SOM_MPR_MINFO__get_buff {0, 8, 0}
static somMpRowMethodInfo dAnimal__get_buff_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_buff};
#ifndef DEFINEDdAnimal__get_buff_mp
#define DEFINEDdAnimal__get_buff_mp
/*[ ::dAnimal::_get_buff dAnimal__get_buff_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__get_buff_mp={&dAnimal__get_buff_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_buff_somMethodInfoValue 0
#define _get_buff_somApplyStubValue &dAnimal__get_buff_mp.csr
#define _get_buff_somHasMPlan 8

/*
 * New Method: _set_buff
 */
SOM_Scope void  SOMLINK _set_buff(dAnimal somSelf, Environment *ev,
		string buff);
/*
 *  Work area for display method.
 */
#ifndef somId__set_buff
#define somId__set_buff ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds__set_buff]))
#endif
#define SOM_MPR_MINFO__set_buff {0, 12, 0}
static somMpRowMethodInfo dAnimal__set_buff_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_buff};
#ifndef DEFINEDdAnimal__set_buff_mp
#define DEFINEDdAnimal__set_buff_mp
/*[ ::dAnimal::_set_buff dAnimal__set_buff_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal__set_buff_mp={&dAnimal__set_buff_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_buff_somMethodInfoValue 0
#define _set_buff_somApplyStubValue &dAnimal__set_buff_mp.csr
#define _set_buff_somHasMPlan 8

/*
 * New Method: display
 */
SOM_Scope string  SOMLINK display(dAnimal somSelf, Environment *ev);
/*
 *  Returns description of animal.
 */
#ifndef somId_display
#define somId_display ((somId)&(__somC_dAnimal_regIdsArray[__somC_dAnimal_regIds_display]))
#endif
#define SOM_MPR_MINFO_display {0, 8, 0}
static somMpRowMethodInfo dAnimal_display_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_display};
#ifndef DEFINEDdAnimal_display_mp
#define DEFINEDdAnimal_display_mp
/*[ ::dAnimal::display dAnimal_display_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dAnimal_display_mp={&dAnimal_display_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define display_somMethodInfoValue 0
#define display_somApplyStubValue &dAnimal_display_mp.csr
#define display_somHasMPlan 8

/*
 * Functions for attributes.
 */
SOM_Scope string  SOMLINK _get_name(dAnimal somSelf, Environment *ev){
    dAnimalData *somThis = dAnimalGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->name);
}
SOM_Scope string  SOMLINK _get_type(dAnimal somSelf, Environment *ev){
    dAnimalData *somThis = dAnimalGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->type);
}
SOM_Scope string  SOMLINK _get_food(dAnimal somSelf, Environment *ev){
    dAnimalData *somThis = dAnimalGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->food);
}
SOM_Scope dLocation  SOMLINK _get_loc(dAnimal somSelf, Environment *ev){
    dAnimalData *somThis = dAnimalGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->loc);
}
SOM_Scope void  SOMLINK _set_loc(dAnimal somSelf, Environment *ev,
		dLocation loc){
    dAnimalData *somThis = dAnimalGetData(somSelf);
    SOM_IgnoreWarning(ev);

    (somThis->loc) = loc;
}
SOM_Scope string  SOMLINK _get_buff(dAnimal somSelf, Environment *ev){
    dAnimalData *somThis = dAnimalGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->buff);
}

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

/*
 * somDestruct Macros
 */
#define dAnimal_BeginDestructor \
   if (!ctrl) { \
      ctrl = &globalCtrl;\
      memcpy(ctrl,&((dAnimalCClassData.parentMtab)->destructCtrl),sizeof(somDestructCtrl)); \
   } \
   somThis = (dAnimalDataPtr)((char*)somSelf + ctrl->info->dataOffset);\
   myMask = ctrl->mask; 
#define dAnimal_EndDestructor \
   ctrl->info = (somDestructInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1; \
   dAnimal_DeInit_SOMObject_somDestruct(somSelf,0,ctrl); \
   if (doFree) _somDeallocate((SOMClass)((void*)_dAnimal),(somToken)somSelf);
#define dAnimal_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 dAnimal_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_dAnimal_parentArray[] = {
	NULL,
};
void * __somC_dAnimal_parentMtabs[1];

somMethodDefn __somC_dAnimal_newNDMethodsArray[] = {
	{  (0 | _get_name_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_name, 
	   0, (somMethodPtr)_get_name_somApplyStubValue, 
	   (somMethodInfo *) _get_name_somMethodInfoValue, &dAnimalClassData._get_name, 0, 1 },
	{  (0 | _set_name_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_name, 
	   0, (somMethodPtr)_set_name_somApplyStubValue, 
	   (somMethodInfo *) _set_name_somMethodInfoValue, &dAnimalClassData._set_name, 0, 1 },
	{  (0 | _get_type_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_type, 
	   0, (somMethodPtr)_get_type_somApplyStubValue, 
	   (somMethodInfo *) _get_type_somMethodInfoValue, &dAnimalClassData._get_type, 0, 1 },
	{  (0 | _set_type_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_type, 
	   0, (somMethodPtr)_set_type_somApplyStubValue, 
	   (somMethodInfo *) _set_type_somMethodInfoValue, &dAnimalClassData._set_type, 0, 1 },
	{  (0 | _get_food_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_food, 
	   0, (somMethodPtr)_get_food_somApplyStubValue, 
	   (somMethodInfo *) _get_food_somMethodInfoValue, &dAnimalClassData._get_food, 0, 1 },
	{  (0 | _set_food_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_food, 
	   0, (somMethodPtr)_set_food_somApplyStubValue, 
	   (somMethodInfo *) _set_food_somMethodInfoValue, &dAnimalClassData._set_food, 0, 1 },
	{  (0 | _get_loc_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_loc, 
	   0, (somMethodPtr)_get_loc_somApplyStubValue, 
	   (somMethodInfo *) _get_loc_somMethodInfoValue, &dAnimalClassData._get_loc, 0, 1 },
	{  (0 | _set_loc_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_loc, 
	   0, (somMethodPtr)_set_loc_somApplyStubValue, 
	   (somMethodInfo *) _set_loc_somMethodInfoValue, &dAnimalClassData._set_loc, 0, 1 },
	{  (0 | _get_buff_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_buff, 
	   0, (somMethodPtr)_get_buff_somApplyStubValue, 
	   (somMethodInfo *) _get_buff_somMethodInfoValue, &dAnimalClassData._get_buff, 0, 1 },
	{  (0 | _set_buff_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_buff, 
	   0, (somMethodPtr)_set_buff_somApplyStubValue, 
	   (somMethodInfo *) _set_buff_somMethodInfoValue, &dAnimalClassData._set_buff, 0, 1 },
	{  (0 | display_somHasMPlan), 0, (somMToken)0, (somMethodPtr)display, 
	   0, (somMethodPtr)display_somApplyStubValue, 
	   (somMethodInfo *) display_somMethodInfoValue, &dAnimalClassData.display, 0, 1 }
};

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

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

static struct dAnimalClassDataStructure __somC_dAnimal_resolvedMTokens;

static void * __somC_dAnimal_CIB_unsharedClassVariablesPtr = 0;
som3ClassInfoStruct __somC_dAnimal_ClassInfo; /* C forward reference */

SOM_CIB dAnimal_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_dAnimal_classVars1,
	&__somC_dAnimal_CIB_unsharedClassVariablesPtr,	/* unsharedVars */
	dAnimal_MajorVersion,
	dAnimal_MinorVersion,
	0x60034,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	0,	/* classMeta */
	(somMethodPtr) __somC_dAnimal_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) 0,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	15,	/* numRegIds */
	__somC_dAnimal_regIdsArray,	/* regIds */
	(sizeof(struct dAnimalClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken),	/* numClassDataEntries */
	(somClassDataStructurePtr)&dAnimalClassData,
	(somCClassDataStructurePtr)&dAnimalCClassData,
	&__somC_dAnimal_ClassInfo,
	1,	/* numParents */
	(SOMClass**)__somC_dAnimal_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass**)__somC_dAnimal_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	__somC_dAnimal_specialOverridesArray,	/* special overrides */
	11,	/* maxNDMethods */
	__somC_dAnimal_newNDMethodsArray,	/* newNDMethods */
	0,	/* numOverrides */
	0,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migrated methods */
};	/* CIB */

static som3ClassDetails __somC_dAnimal_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_dAnimal_parentMtabs,	/* parentMtabs */
	&dAnimal_ClassInitBlock,	/* CIB pointer */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_dAnimal_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_dAnimal_ClassInfo = {
	0,	/* classObject */
	&__somC_dAnimal_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

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

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

/* NewClass Function */
SOMEXTERN SOM_IMPORTEXPORT_danimal_danimal SOMClass  SOMLINK dAnimalNewClass (long reqMajorVersion, long reqMinorVersion)
{
   if (_SOMCLASS_dAnimal && _somCheckVersion(_SOMCLASS_dAnimal,reqMajorVersion,reqMinorVersion))
      return _SOMCLASS_dAnimal;
__somC_dAnimal_parentArray[0] = (SOMClass *)&_SOMCLASS_SOMObject;
   /* require parents */
   if (!_SOMCLASS_SOMObject) SOMObjectNewClass(SOMObject_MajorVersion,SOMObject_MinorVersion);
   /* return new class */
   return somBuildClass2( &dAnimal_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_dAnimal_ih */

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


#ifndef SOM_AnimalFactory_ih
#define SOM_AnimalFactory_ih


#if (defined(AnimalFactory_Class_Source) || defined(SOM_Module_danimal_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_AnimalFactory_h
#include "danimal.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 void AnimalFactoryData;
#define __somC_AnimalFactory_NODATA

/*
 * This class introduces no instance data, so no GetData macro is provided
 */

/*
 * -- Primary Implementation File Support
 */
#if (defined(AnimalFactory_Class_Source) || defined(SOM_Module_danimal_Source))

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

static void SOMLINK __somC_AnimalFactory_classInit(SOMClass cls);


/*
 * Init ClassData Structures
 */
struct AnimalFactoryClassDataStructure SOM_IMPORTEXPORT_danimal_danimal SOMDLINK AnimalFactoryClassData = {0};
struct AnimalFactoryCClassDataStructure SOM_IMPORTEXPORT_danimal_danimal SOMDLINK AnimalFactoryCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_AnimalFactory0[] = {"AnimalFactory"}; /* class name */
static char __somC_Strings_AnimalFactory1[] = {"create_animal"}; /* method name */
static char __somC_Strings_AnimalFactory2[] = {"SOMObject"}; /* parent name */
static char * __somC_AnimalFactory_regIdsArray[] = {
	__somC_Strings_AnimalFactory0,
#ifndef __somC_AnimalFactory_regIds_create_animal
#define __somC_AnimalFactory_regIds_create_animal 1
#endif
	__somC_Strings_AnimalFactory1,
	__somC_Strings_AnimalFactory2
};


/*
 * New Method: create_animal
 */
SOM_Scope dAnimal  SOMLINK create_animal(AnimalFactory somSelf, Environment *ev,
		string className);
/*
 *  Creates and returns an instance of the input class name.
 *  The input class name must be a subclass of dAnimal or an exception
 *  will be raised.
 */
#ifndef somId_create_animal
#define somId_create_animal ((somId)&(__somC_AnimalFactory_regIdsArray[__somC_AnimalFactory_regIds_create_animal]))
#endif
#define SOM_MPR_MINFO_create_animal {0, 12, 0}
static somMpRowMethodInfo AnimalFactory_create_animal_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_create_animal};
#ifndef DEFINEDAnimalFactory_create_animal_mp
#define DEFINEDAnimalFactory_create_animal_mp
/*[ ::AnimalFactory::create_animal AnimalFactory_create_animal_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][EXT_HEADER][VERSION 0][HASATTR][USEREXCEPT]
RESULT[out]: ObjREF
ARG 1[in]: String
RAISES: [::AnimalFactory::InvalidClassName <noparams>]
*/
static struct somcsr_exception_entry AnimalFactory_create_animal_mp_exn00b55300[1] = {
	{"::AnimalFactory::InvalidClassName",{0,NULL}}};
static struct somcsr_Exception_Attributes AnimalFactory_create_animal_mp_attr00b55300 = {1, AnimalFactory_create_animal_mp_exn00b55300};
static struct { void * rows; unsigned char csr[8]; void * attrlist[1];} AnimalFactory_create_animal_mp={&AnimalFactory_create_animal_mp_minfoRow, {
0x96, 0x05, 0x02, 0x96, 0x54},
{	 (void *)&AnimalFactory_create_animal_mp_attr00b55300}
};
#endif
#define create_animal_somMethodInfoValue 0
#define create_animal_somApplyStubValue &AnimalFactory_create_animal_mp.csr
#define create_animal_somHasMPlan 8

/*
 * Functions for attributes.
 */

/*
 * Special Method Support
 */

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

somMethodDefn __somC_AnimalFactory_newNDMethodsArray[] = {
	{  (0 | create_animal_somHasMPlan), 0, (somMToken)0, (somMethodPtr)create_animal, 
	   0, (somMethodPtr)create_animal_somApplyStubValue, 
	   (somMethodInfo *) create_animal_somMethodInfoValue, &AnimalFactoryClassData.create_animal, 0, 1 }
};

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

static struct AnimalFactoryClassDataStructure __somC_AnimalFactory_resolvedMTokens;

static void * __somC_AnimalFactory_CIB_unsharedClassVariablesPtr = 0;
som3ClassInfoStruct __somC_AnimalFactory_ClassInfo; /* C forward reference */

SOM_CIB AnimalFactory_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_AnimalFactory_classVars1,
	&__somC_AnimalFactory_CIB_unsharedClassVariablesPtr,	/* unsharedVars */
	AnimalFactory_MajorVersion,
	AnimalFactory_MinorVersion,
	0x60004,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	0,	/* classMeta */
	(somMethodPtr) __somC_AnimalFactory_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) 0,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	3,	/* numRegIds */
	__somC_AnimalFactory_regIdsArray,	/* regIds */
	(sizeof(struct AnimalFactoryClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken),	/* numClassDataEntries */
	(somClassDataStructurePtr)&AnimalFactoryClassData,
	(somCClassDataStructurePtr)&AnimalFactoryCClassData,
	&__somC_AnimalFactory_ClassInfo,
	1,	/* numParents */
	(SOMClass**)__somC_AnimalFactory_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass**)__somC_AnimalFactory_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	0,	/* special overrides */
	1,	/* maxNDMethods */
	__somC_AnimalFactory_newNDMethodsArray,	/* newNDMethods */
	0,	/* numOverrides */
	0,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migrated methods */
};	/* CIB */

static som3ClassDetails __somC_AnimalFactory_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_AnimalFactory_parentMtabs,	/* parentMtabs */
	&AnimalFactory_ClassInitBlock,	/* CIB pointer */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_AnimalFactory_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_AnimalFactory_ClassInfo = {
	0,	/* classObject */
	&__somC_AnimalFactory_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

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

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

/* NewClass Function */
SOMEXTERN SOM_IMPORTEXPORT_danimal_danimal SOMClass  SOMLINK AnimalFactoryNewClass (long reqMajorVersion, long reqMinorVersion)
{
   if (_SOMCLASS_AnimalFactory && _somCheckVersion(_SOMCLASS_AnimalFactory,reqMajorVersion,reqMinorVersion))
      return _SOMCLASS_AnimalFactory;
__somC_AnimalFactory_parentArray[0] = (SOMClass *)&_SOMCLASS_SOMObject;
   /* require parents */
   if (!_SOMCLASS_SOMObject) SOMObjectNewClass(SOMObject_MajorVersion,SOMObject_MinorVersion);
   /* return new class */
   return somBuildClass2( &AnimalFactory_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_AnimalFactory_ih */
