
/*
 * This file was generated by the SOM Compiler.
 * FileName: ddog.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.9.1.1 src/somples.os2/somd/c/animal/ddog.idl, somples.somd, som3.0 12/2/96 17:00:18 [12/4/96 15:09:05]
 * 
 * 
 * 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_dDog_ih
#define SOM_dDog_ih


#if (defined(dDog_Class_Source) || defined(SOM_Module_ddog_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_dDog_h
#include "ddog.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 noise;
        /*
         *  Noise dog makes.
         */
	string trick;
        /*
         *  Trick dog performs.
         */
} __somC_dDog_ProtectedPrivateData;
typedef __somC_dDog_ProtectedPrivateData dDogData, *dDogDataPtr;

/*
 * -- GetData macro
 */
typedef dDogDataPtr SOMLINK somTP_dDog_DataThunk(void*);
typedef somTP_dDog_DataThunk *somTD_dDog_DataThunk;

#define dDogGetData(somSelf) \
   (((somTD_dDog_DataThunk)(dDogCClassData.instanceDataToken))(somSelf))
#define _noise somThis->noise
#define _trick somThis->trick

/*
 * -- Primary Implementation File Support
 */
#if (defined(dDog_Class_Source) || defined(SOM_Module_ddog_Source))

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

static void SOMLINK __somC_dDog_classInit(SOMClass cls);


/*
 * Init ClassData Structures
 */
struct dDogClassDataStructure SOM_IMPORTEXPORT_danimal_ddog SOMDLINK dDogClassData = {0};
struct dDogCClassDataStructure SOM_IMPORTEXPORT_danimal_ddog SOMDLINK dDogCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_dDog0[] = {"dDog"}; /* class name */
static char __somC_Strings_dDog1[] = {"_get_noise"}; /* method name */
static char __somC_Strings_dDog2[] = {"_set_noise"}; /* method name */
static char __somC_Strings_dDog3[] = {"_get_trick"}; /* method name */
static char __somC_Strings_dDog4[] = {"_set_trick"}; /* method name */
static char __somC_Strings_dDog5[] = {"dAnimal"}; /* parent name */
static char __somC_Strings_dDog6[] = {"somDefaultInit"}; /* overridden method name */
static char __somC_Strings_dDog7[] = {"somDestruct"}; /* overridden method name */
static char __somC_Strings_dDog8[] = {"display"}; /* overridden method name */
static char * __somC_dDog_regIdsArray[] = {
	__somC_Strings_dDog0,
#ifndef __somC_dDog_regIds__get_noise
#define __somC_dDog_regIds__get_noise 1
#endif
	__somC_Strings_dDog1,
#ifndef __somC_dDog_regIds__set_noise
#define __somC_dDog_regIds__set_noise 2
#endif
	__somC_Strings_dDog2,
#ifndef __somC_dDog_regIds__get_trick
#define __somC_dDog_regIds__get_trick 3
#endif
	__somC_Strings_dDog3,
#ifndef __somC_dDog_regIds__set_trick
#define __somC_dDog_regIds__set_trick 4
#endif
	__somC_Strings_dDog4,
	__somC_Strings_dDog5,
#ifndef __somC_dDog_regIds_somDefaultInit
#define __somC_dDog_regIds_somDefaultInit 6
#endif
	__somC_Strings_dDog6,
#ifndef __somC_dDog_regIds_somDestruct
#define __somC_dDog_regIds_somDestruct 7
#endif
	__somC_Strings_dDog7,
#ifndef __somC_dDog_regIds_display
#define __somC_dDog_regIds_display 8
#endif
	__somC_Strings_dDog8
};


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

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

/*
 * Overridden method: display
 */
SOM_Scope string  SOMLINK display(dDog somSelf, Environment *ev);
static somMethodProc* dDog_parent_dAnimal_display_resolved;
#define dDog_parent_dAnimal_display(somSelf,ev) \
  ((( somTD_dAnimal_display ) \
    dDog_parent_dAnimal_display_resolved)(somSelf,ev))
#ifndef SOMGD_pmc_dAnimal_display
  #ifdef parent_dAnimal_display
     #define SOMGD_pmc_dAnimal_display 1
     #undef parent_dAnimal_display
  #else
     #define parent_dAnimal_display dDog_parent_dAnimal_display
  #endif /* parent_dAnimal_display */
#endif /* SOMGD_pmc_dAnimal_display */
#ifndef SOMGD_pmc_parent_display
  #ifdef parent_display
    #define SOMGD_pmc_parent_display
    #undef parent_display
  #else
#define parent_display dDog_parent_dAnimal_display
  #endif
#endif
#define dDog_parents_display(somSelf,ev) (\
   dDog_parent_dAnimal_display(somSelf,ev))
#define SOMPCALLdDog_display
static somMethodProc* dDog_pcall_display_resolved;
#define dDog_pcall_display(somSelf,ev) \
  ((( somTD_dAnimal_display ) \
    dDog_pcall_display_resolved)(somSelf,ev))
static string  SOMLINK dDog_pcallResolve_display(dDog somSelf, Environment *ev)
{
   return ((somTD_dAnimal_display) 
      somPCallResolve(somSelf, _dDog, _SOMMTOKEN_dAnimal(display)))(somSelf,ev);
}


/*
 * New Method: _get_noise
 */
SOM_Scope string  SOMLINK _get_noise(dDog somSelf, Environment *ev);
/*
 *  Noise dog makes.
 */
#ifndef somId__get_noise
#define somId__get_noise ((somId)&(__somC_dDog_regIdsArray[__somC_dDog_regIds__get_noise]))
#endif
#define SOM_MPR_MINFO__get_noise {0, 8, 0}
static somMpRowMethodInfo dDog__get_noise_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_noise};
#ifndef DEFINEDdDog__get_noise_mp
#define DEFINEDdDog__get_noise_mp
/*[ ::dDog::_get_noise dDog__get_noise_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dDog__get_noise_mp={&dDog__get_noise_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_noise_somMethodInfoValue 0
#define _get_noise_somApplyStubValue &dDog__get_noise_mp.csr
#define _get_noise_somHasMPlan 8

/*
 * New Method: _set_noise
 */
SOM_Scope void  SOMLINK _set_noise(dDog somSelf, Environment *ev,
		string noise);
/*
 *  Noise dog makes.
 */
#ifndef somId__set_noise
#define somId__set_noise ((somId)&(__somC_dDog_regIdsArray[__somC_dDog_regIds__set_noise]))
#endif
#define SOM_MPR_MINFO__set_noise {0, 12, 0}
static somMpRowMethodInfo dDog__set_noise_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_noise};
#ifndef DEFINEDdDog__set_noise_mp
#define DEFINEDdDog__set_noise_mp
/*[ ::dDog::_set_noise dDog__set_noise_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dDog__set_noise_mp={&dDog__set_noise_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_noise_somMethodInfoValue 0
#define _set_noise_somApplyStubValue &dDog__set_noise_mp.csr
#define _set_noise_somHasMPlan 8

/*
 * New Method: _get_trick
 */
SOM_Scope string  SOMLINK _get_trick(dDog somSelf, Environment *ev);
/*
 *  Trick dog performs.
 */
#ifndef somId__get_trick
#define somId__get_trick ((somId)&(__somC_dDog_regIdsArray[__somC_dDog_regIds__get_trick]))
#endif
#define SOM_MPR_MINFO__get_trick {0, 8, 0}
static somMpRowMethodInfo dDog__get_trick_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__get_trick};
#ifndef DEFINEDdDog__get_trick_mp
#define DEFINEDdDog__get_trick_mp
/*[ ::dDog::_get_trick dDog__get_trick_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][RESULT][VERSION 0]
RESULT[object-owns out]: String
*/
static struct { void * rows; unsigned char csr[4]; } dDog__get_trick_mp={&dDog__get_trick_mp_minfoRow, {
0x86, 0x01, 0xb4},
};
#endif
#define _get_trick_somMethodInfoValue 0
#define _get_trick_somApplyStubValue &dDog__get_trick_mp.csr
#define _get_trick_somHasMPlan 8

/*
 * New Method: _set_trick
 */
SOM_Scope void  SOMLINK _set_trick(dDog somSelf, Environment *ev,
		string trick);
/*
 *  Trick dog performs.
 */
#ifndef somId__set_trick
#define somId__set_trick ((somId)&(__somC_dDog_regIdsArray[__somC_dDog_regIds__set_trick]))
#endif
#define SOM_MPR_MINFO__set_trick {0, 12, 0}
static somMpRowMethodInfo dDog__set_trick_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO__set_trick};
#ifndef DEFINEDdDog__set_trick_mp
#define DEFINEDdDog__set_trick_mp
/*[ ::dDog::_set_trick dDog__set_trick_mp ]*/
/* Contract specification:
[CALLTYPE_IDL (2)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } dDog__set_trick_mp={&dDog__set_trick_mp_minfoRow, {
0x82, 0x01, 0x54},
};
#endif
#define _set_trick_somMethodInfoValue 0
#define _set_trick_somApplyStubValue &dDog__set_trick_mp.csr
#define _set_trick_somHasMPlan 8

/*
 * Functions for attributes.
 */
SOM_Scope string  SOMLINK _get_noise(dDog somSelf, Environment *ev){
    dDogData *somThis = dDogGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->noise);
}
SOM_Scope string  SOMLINK _get_trick(dDog somSelf, Environment *ev){
    dDogData *somThis = dDogGetData(somSelf);
    SOM_IgnoreWarning(ev);

    return  (somThis->trick);
}

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

/*
 * somDestruct Macros
 */
#define dDog_BeginDestructor \
   if (!ctrl) { \
      ctrl = &globalCtrl;\
      memcpy(ctrl,&((dDogCClassData.parentMtab)->destructCtrl),sizeof(somDestructCtrl)); \
   } \
   somThis = (dDogDataPtr)((char*)somSelf + ctrl->info->dataOffset);\
   myMask = ctrl->mask; 
#define dDog_EndDestructor \
   ctrl->info = (somDestructInfo*)(ctrl->infoSize + (char*)(ctrl->info)); \
   ctrl->mask += 1; \
   dDog_DeInit_dAnimal_somDestruct(somSelf,0,ctrl); \
   if (doFree) _somDeallocate((SOMClass)((void*)_dDog),(somToken)somSelf);
#define dDog_DeInit_dAnimal_somDestruct(somSelf, doFree, ctrl) \
    if (myMask[0]&1) \
       ((somTD_SOMObject_somDestruct) \
           ctrl->info->defaultDestruct) \
               ((SOMObject )((void *) somSelf), 0, ctrl)

/*
 * Ancestor_Init Macros
 */
#define dDog_Init_dAnimal_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_dDog_parentArray[] = {
	NULL,
};
void * __somC_dDog_parentMtabs[1];

somMethodDefn __somC_dDog_newNDMethodsArray[] = {
	{  (0 | _get_noise_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_noise, 
	   0, (somMethodPtr)_get_noise_somApplyStubValue, 
	   (somMethodInfo *) _get_noise_somMethodInfoValue, &dDogClassData._get_noise, 0, 1 },
	{  (0 | _set_noise_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_noise, 
	   0, (somMethodPtr)_set_noise_somApplyStubValue, 
	   (somMethodInfo *) _set_noise_somMethodInfoValue, &dDogClassData._set_noise, 0, 1 },
	{  (0 | _get_trick_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_get_trick, 
	   0, (somMethodPtr)_get_trick_somApplyStubValue, 
	   (somMethodInfo *) _get_trick_somMethodInfoValue, &dDogClassData._get_trick, 0, 1 },
	{  (0 | _set_trick_somHasMPlan), 0, (somMToken)0, (somMethodPtr)_set_trick, 
	   0, (somMethodPtr)_set_trick_somApplyStubValue, 
	   (somMethodInfo *) _set_trick_somMethodInfoValue, &dDogClassData._set_trick, 0, 1 }
};

static somOverrideMethod_t2 __somC_dDog_overridesArray[] = {
{ &(__somC_dDog_regIdsArray[__somC_dDog_regIds_display]), 
#ifdef SOMPCALLdDog_display
   (somMethodPtr*)&dDog_pcall_display_resolved, 
   (somMethodPtr)dDog_pcallResolve_display, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)display }
};

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

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

static struct dDogClassDataStructure __somC_dDog_resolvedMTokens;

static void * __somC_dDog_CIB_unsharedClassVariablesPtr = 0;
som3ClassInfoStruct __somC_dDog_ClassInfo; /* C forward reference */

SOM_CIB dDog_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_dDog_classVars1,
	&__somC_dDog_CIB_unsharedClassVariablesPtr,	/* unsharedVars */
	dDog_MajorVersion,
	dDog_MinorVersion,
	0x60034,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	0,	/* classMeta */
	(somMethodPtr) __somC_dDog_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) 0,	/* legacyInit */
	(somMethodPtr) 0,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	9,	/* numRegIds */
	__somC_dDog_regIdsArray,	/* regIds */
	(sizeof(struct dDogClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken),	/* numClassDataEntries */
	(somClassDataStructurePtr)&dDogClassData,
	(somCClassDataStructurePtr)&dDogCClassData,
	&__somC_dDog_ClassInfo,
	1,	/* numParents */
	(SOMClass**)__somC_dDog_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass**)__somC_dDog_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	__somC_dDog_specialOverridesArray,	/* special overrides */
	4,	/* maxNDMethods */
	__somC_dDog_newNDMethodsArray,	/* newNDMethods */
	1,	/* numOverrides */
	__somC_dDog_overridesArray,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migrated methods */
};	/* CIB */

static som3ClassDetails __somC_dDog_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_dDog_parentMtabs,	/* parentMtabs */
	&dDog_ClassInitBlock,	/* CIB pointer */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_dDog_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_dDog_ClassInfo = {
	0,	/* classObject */
	&__somC_dDog_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

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

/* classinit function */
SOM_Scope void SOMLINK __somC_dDog_classInit(SOMClass somSelf)
{
   SOM_IgnoreWarning(somSelf);
   dDog_parent_dAnimal_display_resolved = 
	somParentNumResolve(dDogCClassData.parentMtab, 1, _SOMMTOKEN_dAnimal(display)); 
}

/* NewClass Function */
SOMEXTERN SOM_IMPORTEXPORT_danimal_ddog SOMClass  SOMLINK dDogNewClass (long reqMajorVersion, long reqMinorVersion)
{
   if (_SOMCLASS_dDog && _somCheckVersion(_SOMCLASS_dDog,reqMajorVersion,reqMinorVersion))
      return _SOMCLASS_dDog;
__somC_dDog_parentArray[0] = (SOMClass *)&_SOMCLASS_dAnimal;
   /* require parents */
   if (!_SOMCLASS_dAnimal) dAnimalNewClass(dAnimal_MajorVersion,dAnimal_MinorVersion);
   /* return new class */
   return somBuildClass2( &dDog_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_dDog_ih */
