home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
WPSDEM.ZIP
/
CMBSTDNT
/
UNDRGRAD.IH
< prev
next >
Wrap
Text File
|
1992-08-21
|
9KB
|
272 lines
/*
* This file was generated by the SOM Compiler.
* FileName: .\UNDRGRAD.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef UNDRGRAD_ih
#define UNDRGRAD_ih
#include "UNDRGRAD.h"
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#define SOM_Scope static
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass UnderGraduateStudentCClassData.parentMtab
#endif
#define UnderGraduateStudent_MaxNoMethods 1
/*
* Instance data
*/
typedef struct {
char date[16];
} UnderGraduateStudentData;
/*
* Instance variable access macros
*/
#define _date (somThis->date)
/*
* Getdata macro
*/
#define UnderGraduateStudentGetData(somSelf) \
((UnderGraduateStudentData *) \
SOM_DataResolve(somSelf, UnderGraduateStudentCClassData.instanceDataToken))
/*
* Trace/Debug macro
*/
#ifndef UnderGraduateStudentMethodDebug
#define UnderGraduateStudentMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef UnderGraduateStudent_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_UnderGraduateStudentCClassData.parentMtab
#undef SOMInstance
#define SOMInstance UnderGraduateStudentCClassData.parentMtab
#ifndef M_UnderGraduateStudent_Class_Source
#define M_UnderGraduateStudent_Class_Source
#endif /* M_UnderGraduateStudent_Class_Source */
/*
* Generate the Apply Stubs.
*/
#pragma linkage(somAP_setUpUnderGraduateStudent, system)
static void SOMLINK somAP_setUpUnderGraduateStudent(UnderGraduateStudent *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
char *id = va_arg(__ap, char*);
char *name = va_arg(__ap, char*);
char *date = va_arg(__ap, char*);
__ap; __id; __desc; /* Referenced to prevent warning msg */
UnderGraduateStudent_setUpUnderGraduateStudent(somSelf,id,name,date);
}
/*
* Overridden method: printStudentInfo
*/
#pragma linkage(printStudentInfo, system)
SOM_Scope void SOMLINK printStudentInfo(UnderGraduateStudent *somSelf);
#ifndef parent_printStudentInfo
static char *somMN_printStudentInfo = "printStudentInfo";
static somId somId_printStudentInfo = &somMN_printStudentInfo;
#define parent_printStudentInfo(somSelf) \
((SOM_ParentResolveE(Student, SOM_CurrentClass, printStudentInfo)) \
(somSelf))
#endif
#define UnderGraduateStudentParent_printStudentInfo parent_printStudentInfo
/*
* Overridden method: getStudentType
*/
#pragma linkage(getStudentType, system)
SOM_Scope char * SOMLINK getStudentType(UnderGraduateStudent *somSelf);
#ifndef parent_getStudentType
static char *somMN_getStudentType = "getStudentType";
static somId somId_getStudentType = &somMN_getStudentType;
#define parent_getStudentType(somSelf) \
((SOM_ParentResolveE(Student, SOM_CurrentClass, getStudentType)) \
(somSelf))
#endif
#define UnderGraduateStudentParent_getStudentType parent_getStudentType
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure UnderGraduateStudenttempClassData;
/*
* Initialize the class data structure
*/
struct UnderGraduateStudentClassDataStructure UnderGraduateStudentClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct UnderGraduateStudentCClassDataStructure UnderGraduateStudentCClassData = {(somMethodTab *) NULL};
/*
* New Method: setUpUnderGraduateStudent
*/
#pragma linkage(setUpUnderGraduateStudent, system)
SOM_Scope void SOMLINK setUpUnderGraduateStudent(UnderGraduateStudent *somSelf,
char *id,
char *name,
char *date);
static char *somMN_setUpUnderGraduateStudent = "setUpUnderGraduateStudent";
static somId somId_setUpUnderGraduateStudent = &somMN_setUpUnderGraduateStudent;
static char *somDS_setUpUnderGraduateStudent = somMD_UnderGraduateStudent_setUpUnderGraduateStudent;
static somId somDI_setUpUnderGraduateStudent = &somDS_setUpUnderGraduateStudent;
#pragma linkage(somRD_setUpUnderGraduateStudent, system)
static void SOMLINK somRD_setUpUnderGraduateStudent(UnderGraduateStudent *somSelf,
char *id,
char *name,
char *date)
{
va_somDispatchV(somSelf, somId_setUpUnderGraduateStudent,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_setUpUnderGraduateStudent),id,name,date);
}
/*
* Routines to create the class object
*/
/*
* Declare the Static Methods table.
*/
static somStaticMethod_t UnderGraduateStudentSM[] = {
{ &UnderGraduateStudentClassData.setUpUnderGraduateStudent,
&somId_setUpUnderGraduateStudent,
&somDI_setUpUnderGraduateStudent,
(somMethodProc *) setUpUnderGraduateStudent,
(somMethodProc *) somRD_setUpUnderGraduateStudent,
(somMethodProc *) somAP_setUpUnderGraduateStudent },
};
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t UnderGraduateStudentOM[] = {
{ &somId_printStudentInfo,
(somMethodProc *) printStudentInfo },
{ &somId_getStudentType,
(somMethodProc *) getStudentType },
};
static void UnderGraduateStudentsomInitializeClass ()
{
int i;
somStaticMethod_t *smp;
somOverrideMethod_t *omp;
/*
* Add the Static Methods.
*/
for (smp = UnderGraduateStudentSM, i = 0; i < 1; smp++, i++)
*(smp->classData) =
_somAddStaticMethod (UnderGraduateStudenttempClassData.classObject,
*(smp->methodId), *(smp->methodDescriptor),
smp->method, smp->redispatchStub,
smp->applyStub);
/*
* Override methods.
*/
for (omp = UnderGraduateStudentOM, i = 0; i < 2; omp++, i++)
_somOverrideSMethod (UnderGraduateStudenttempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(UnderGraduateStudentsomCreateClass, system)
static void SOMLINK UnderGraduateStudentsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
UnderGraduateStudenttempClassData.classObject = _somNew (mClsObj);
_somInitClass (UnderGraduateStudenttempClassData.classObject,
"UnderGraduateStudent",
pClsObj,
sizeof(UnderGraduateStudentData),
UnderGraduateStudent_MaxNoMethods,
UnderGraduateStudent_MajorVersion,
UnderGraduateStudent_MinorVersion);
UnderGraduateStudentCClassData.instanceDataToken =
_somGetInstanceToken(UnderGraduateStudenttempClassData.classObject);
UnderGraduateStudentsomInitializeClass();
UnderGraduateStudentCClassData.parentMtab =
_somGetPClsMtab(UnderGraduateStudenttempClassData.classObject);
_somSetClassData(UnderGraduateStudenttempClassData.classObject, (somClassDataStructure *)&UnderGraduateStudentClassData);
_somClassReady(UnderGraduateStudenttempClassData.classObject);
/* make newly created class object visible */
UnderGraduateStudentClassData.classObject = UnderGraduateStudenttempClassData.classObject;
}
UnderGraduateStudent * SOMLINK UnderGraduateStudentNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != UnderGraduateStudent_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > UnderGraduateStudent_MinorVersion))) {
somPrintf("UnderGraduateStudentNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (UnderGraduateStudentClassData.classObject != (SOMAny *) NULL)
return(UnderGraduateStudentClassData.classObject);
/* Make sure the environment is initialized. */
if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
if (SOMClassMgrObject == (SOMAny *) NULL)
SOM_Error(SOMERROR_CouldNotStartup);
/* Get the parent class object. */
StudentNewClass(1,1); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("Student"), 1, 1);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(UnderGraduateStudentsomCreateClass, pClsObj, mClsObj,
&UnderGraduateStudenttempClassData);
return (UnderGraduateStudentClassData.classObject);
}
#endif /* UnderGraduateStudent_Class_Source */
#endif /* UNDRGRAD_ih */