home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
WPSDEM.ZIP
/
CMBSTDNT
/
STUDENT.IH
< prev
next >
Wrap
Text File
|
1992-08-21
|
20KB
|
681 lines
/*
* This file was generated by the SOM Compiler.
* FileName: .\STUDENT.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef STUDENT_ih
#define STUDENT_ih
#include <STUDENT.h>
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#define SOM_Scope static
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass StudentCClassData.parentMtab
#endif
#define Student_MaxNoMethods 6
/*
* Instance data
*/
typedef struct {
char id[16];
char name[32];
int GPA;
} StudentData;
/*
* Instance variable access macros
*/
#define _id (somThis->id)
#define _name (somThis->name)
#define _GPA (somThis->GPA)
/*
* Getdata macro
*/
#define StudentGetData(somSelf) \
((StudentData *) \
SOM_DataResolve(somSelf, StudentCClassData.instanceDataToken))
/*
* Trace/Debug macro
*/
#ifndef StudentMethodDebug
#define StudentMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef Student_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_StudentCClassData.parentMtab
#undef SOMInstance
#define SOMInstance StudentCClassData.parentMtab
#ifndef M_Student_Class_Source
#define M_Student_Class_Source
#endif /* M_Student_Class_Source */
/*
* Generate the Apply Stubs.
*/
#pragma linkage(somAP_setUpStudent, system)
static void SOMLINK somAP_setUpStudent(Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
char *id = va_arg(__ap, char*);
char *name = va_arg(__ap, char*);
__ap; __id; __desc; /* Referenced to prevent warning msg */
Student_setUpStudent(somSelf,id,name);
}
#pragma linkage(somAP_printStudentInfo, system)
static void SOMLINK somAP_printStudentInfo(Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
__ap; __id; __desc; /* Referenced to prevent warning msg */
Student_printStudentInfo(somSelf);
}
#pragma linkage(somAP_getStudentType, system)
static char * SOMLINK somAP_getStudentType(Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
__ap; __id; __desc; /* Referenced to prevent warning msg */
return (Student_getStudentType(somSelf));
}
#pragma linkage(somAP_getStudentID, system)
static char * SOMLINK somAP_getStudentID(Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
__ap; __id; __desc; /* Referenced to prevent warning msg */
return (Student_getStudentID(somSelf));
}
#pragma linkage(somAP_SetStudentGPA, system)
static void SOMLINK somAP_SetStudentGPA(Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
int GPA = va_arg(__ap, int);
__ap; __id; __desc; /* Referenced to prevent warning msg */
Student_SetStudentGPA(somSelf,GPA);
}
#pragma linkage(somAP_GetStudentGPA, system)
static int SOMLINK somAP_GetStudentGPA(Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
__ap; __id; __desc; /* Referenced to prevent warning msg */
return (Student_GetStudentGPA(somSelf));
}
/*
* Overridden method: somInit
*/
#pragma linkage(somInit, system)
SOM_Scope void SOMLINK somInit(Student *somSelf);
#ifndef parent_somInit
static char *somMN_somInit = "somInit";
static somId somId_somInit = &somMN_somInit;
#define parent_somInit(somSelf) \
((SOM_ParentResolveE(SOMObject, SOM_CurrentClass, somInit)) \
(somSelf))
#endif
#define StudentParent_somInit parent_somInit
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure StudenttempClassData;
/*
* Initialize the class data structure
*/
struct StudentClassDataStructure StudentClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct StudentCClassDataStructure StudentCClassData = {(somMethodTab *) NULL};
/*
* New Method: setUpStudent
*/
#pragma linkage(setUpStudent, system)
SOM_Scope void SOMLINK setUpStudent(Student *somSelf,
char *id,
char *name);
static char *somMN_setUpStudent = "setUpStudent";
static somId somId_setUpStudent = &somMN_setUpStudent;
static char *somDS_setUpStudent = somMD_Student_setUpStudent;
static somId somDI_setUpStudent = &somDS_setUpStudent;
#pragma linkage(somRD_setUpStudent, system)
static void SOMLINK somRD_setUpStudent(Student *somSelf,
char *id,
char *name)
{
va_somDispatchV(somSelf, somId_setUpStudent,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_setUpStudent),id,name);
}
/*
* New Method: printStudentInfo
*/
#pragma linkage(printStudentInfo, system)
SOM_Scope void SOMLINK printStudentInfo(Student *somSelf);
static char *somMN_printStudentInfo = "printStudentInfo";
static somId somId_printStudentInfo = &somMN_printStudentInfo;
static char *somDS_printStudentInfo = somMD_Student_printStudentInfo;
static somId somDI_printStudentInfo = &somDS_printStudentInfo;
#pragma linkage(somRD_printStudentInfo, system)
static void SOMLINK somRD_printStudentInfo(Student *somSelf)
{
va_somDispatchV(somSelf, somId_printStudentInfo,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_printStudentInfo));
}
/*
* New Method: getStudentType
*/
#pragma linkage(getStudentType, system)
SOM_Scope char * SOMLINK getStudentType(Student *somSelf);
static char *somMN_getStudentType = "getStudentType";
static somId somId_getStudentType = &somMN_getStudentType;
static char *somDS_getStudentType = somMD_Student_getStudentType;
static somId somDI_getStudentType = &somDS_getStudentType;
#pragma linkage(somRD_getStudentType, system)
static char * SOMLINK somRD_getStudentType(Student *somSelf)
{
return ((char*) va_somDispatchA(somSelf, somId_getStudentType,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_getStudentType)));
}
/*
* New Method: getStudentID
*/
#pragma linkage(getStudentID, system)
SOM_Scope char * SOMLINK getStudentID(Student *somSelf);
static char *somMN_getStudentID = "getStudentID";
static somId somId_getStudentID = &somMN_getStudentID;
static char *somDS_getStudentID = somMD_Student_getStudentID;
static somId somDI_getStudentID = &somDS_getStudentID;
#pragma linkage(somRD_getStudentID, system)
static char * SOMLINK somRD_getStudentID(Student *somSelf)
{
return ((char*) va_somDispatchA(somSelf, somId_getStudentID,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_getStudentID)));
}
/*
* New Method: SetStudentGPA
*/
#pragma linkage(SetStudentGPA, system)
SOM_Scope void SOMLINK SetStudentGPA(Student *somSelf,
int GPA);
static char *somMN_SetStudentGPA = "SetStudentGPA";
static somId somId_SetStudentGPA = &somMN_SetStudentGPA;
static char *somDS_SetStudentGPA = somMD_Student_SetStudentGPA;
static somId somDI_SetStudentGPA = &somDS_SetStudentGPA;
#pragma linkage(somRD_SetStudentGPA, system)
static void SOMLINK somRD_SetStudentGPA(Student *somSelf,
int GPA)
{
va_somDispatchV(somSelf, somId_SetStudentGPA,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_SetStudentGPA),GPA);
}
/*
* New Method: GetStudentGPA
*/
#pragma linkage(GetStudentGPA, system)
SOM_Scope int SOMLINK GetStudentGPA(Student *somSelf);
static char *somMN_GetStudentGPA = "GetStudentGPA";
static somId somId_GetStudentGPA = &somMN_GetStudentGPA;
static char *somDS_GetStudentGPA = somMD_Student_GetStudentGPA;
static somId somDI_GetStudentGPA = &somDS_GetStudentGPA;
#pragma linkage(somRD_GetStudentGPA, system)
static int SOMLINK somRD_GetStudentGPA(Student *somSelf)
{
return ((int) va_somDispatchL(somSelf, somId_GetStudentGPA,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_GetStudentGPA)));
}
/*
* Routines to create the class object
*/
/*
* Declare the Static Methods table.
*/
static somStaticMethod_t StudentSM[] = {
{ &StudentClassData.setUpStudent,
&somId_setUpStudent,
&somDI_setUpStudent,
(somMethodProc *) setUpStudent,
(somMethodProc *) somRD_setUpStudent,
(somMethodProc *) somAP_setUpStudent },
{ &StudentClassData.printStudentInfo,
&somId_printStudentInfo,
&somDI_printStudentInfo,
(somMethodProc *) printStudentInfo,
(somMethodProc *) somRD_printStudentInfo,
(somMethodProc *) somAP_printStudentInfo },
{ &StudentClassData.getStudentType,
&somId_getStudentType,
&somDI_getStudentType,
(somMethodProc *) getStudentType,
(somMethodProc *) somRD_getStudentType,
(somMethodProc *) somAP_getStudentType },
{ &StudentClassData.getStudentID,
&somId_getStudentID,
&somDI_getStudentID,
(somMethodProc *) getStudentID,
(somMethodProc *) somRD_getStudentID,
(somMethodProc *) somAP_getStudentID },
{ &StudentClassData.SetStudentGPA,
&somId_SetStudentGPA,
&somDI_SetStudentGPA,
(somMethodProc *) SetStudentGPA,
(somMethodProc *) somRD_SetStudentGPA,
(somMethodProc *) somAP_SetStudentGPA },
{ &StudentClassData.GetStudentGPA,
&somId_GetStudentGPA,
&somDI_GetStudentGPA,
(somMethodProc *) GetStudentGPA,
(somMethodProc *) somRD_GetStudentGPA,
(somMethodProc *) somAP_GetStudentGPA },
};
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t StudentOM[] = {
{ &somId_somInit,
(somMethodProc *) somInit },
};
static void StudentsomInitializeClass ()
{
int i;
somStaticMethod_t *smp;
somOverrideMethod_t *omp;
/*
* Add the Static Methods.
*/
for (smp = StudentSM, i = 0; i < 6; smp++, i++)
*(smp->classData) =
_somAddStaticMethod (StudenttempClassData.classObject,
*(smp->methodId), *(smp->methodDescriptor),
smp->method, smp->redispatchStub,
smp->applyStub);
/*
* Override methods.
*/
for (omp = StudentOM, i = 0; i < 1; omp++, i++)
_somOverrideSMethod (StudenttempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(StudentsomCreateClass, system)
static void SOMLINK StudentsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
StudenttempClassData.classObject = _somNew (mClsObj);
_somInitClass (StudenttempClassData.classObject,
"Student",
pClsObj,
sizeof(StudentData),
Student_MaxNoMethods,
Student_MajorVersion,
Student_MinorVersion);
StudentCClassData.instanceDataToken =
_somGetInstanceToken(StudenttempClassData.classObject);
StudentsomInitializeClass();
StudentCClassData.parentMtab =
_somGetPClsMtab(StudenttempClassData.classObject);
_somSetClassData(StudenttempClassData.classObject, (somClassDataStructure *)&StudentClassData);
_somClassReady(StudenttempClassData.classObject);
/* make newly created class object visible */
StudentClassData.classObject = StudenttempClassData.classObject;
}
Student * SOMLINK StudentNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != Student_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > Student_MinorVersion))) {
somPrintf("StudentNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (StudentClassData.classObject != (SOMAny *) NULL)
return(StudentClassData.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. */
SOMObjectNewClass(1,1); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("SOMObject"), 1, 1);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Explicit metaclass, so get it */
M_StudentNewClass(0,0); /* static reference */
mClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_Student"), 0, 0);
if (mClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoMetaClass);
somConstructClass(StudentsomCreateClass, pClsObj, mClsObj,
&StudenttempClassData);
return (StudentClassData.classObject);
}
#endif /* Student_Class_Source */
#endif /* STUDENT_ih */
/*
* This file was generated by the SOM Compiler.
* FileName: .\STUDENT.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef STUDENT_mih
#define STUDENT_mih
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#define SOM_Scope static
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass M_StudentCClassData.parentMtab
#endif
#define M_Student_MaxNoMethods 1
/*
* Instance data
*/
typedef struct {
int count;
} M_StudentData;
/*
* Instance variable access macros
*/
#define _count (somThis->count)
/*
* Getdata macro
*/
#define M_StudentGetData(somSelf) \
((M_StudentData *) \
SOM_DataResolve(somSelf, M_StudentCClassData.instanceDataToken))
/*
* Trace/Debug macro
*/
#ifndef M_StudentMethodDebug
#define M_StudentMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef M_Student_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
/*
* Generate the Apply Stubs.
*/
#pragma linkage(somAP_countObjects, system)
static int SOMLINK somAP_countObjects(M_Student *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
__ap; __id; __desc; /* Referenced to prevent warning msg */
return (M_Student_countObjects(somSelf));
}
/*
* Overridden method: somInit
*/
#pragma linkage(StudentClass_somInit, system)
SOM_Scope void SOMLINK StudentClass_somInit(M_Student *somSelf);
#ifndef parent_somInit
static char *somMN_somInit = "somInit";
static somId somId_somInit = &somMN_somInit;
#define parent_somInit(somSelf) \
((SOM_ParentResolveE(SOMObject, SOM_CurrentClass, somInit)) \
(somSelf))
#endif
#define M_StudentParent_somInit parent_somInit
/*
* Overridden method: somNew
*/
#pragma linkage(StudentClass_somNew, system)
SOM_Scope SOMAny * SOMLINK StudentClass_somNew(M_Student *somSelf);
#ifndef parent_somNew
static char *somMN_somNew = "somNew";
static somId somId_somNew = &somMN_somNew;
#define parent_somNew(somSelf) \
((SOM_ParentResolveE(SOMClass, SOM_CurrentClass, somNew)) \
(somSelf))
#endif
#define M_StudentParent_somNew parent_somNew
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure M_StudenttempClassData;
/*
* Initialize the class data structure
*/
struct M_StudentClassDataStructure M_StudentClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct M_StudentCClassDataStructure M_StudentCClassData = {(somMethodTab *) NULL};
/*
* New Method: countObjects
*/
#pragma linkage(StudentClass_countObjects, system)
SOM_Scope int SOMLINK StudentClass_countObjects(M_Student *somSelf);
static char *somMN_countObjects = "countObjects";
static somId somId_countObjects = &somMN_countObjects;
static char *somDS_countObjects = somMD_M_Student_countObjects;
static somId somDI_countObjects = &somDS_countObjects;
#pragma linkage(somRD_countObjects, system)
static int SOMLINK somRD_countObjects(M_Student *somSelf)
{
return ((int) va_somDispatchL(somSelf, somId_countObjects,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_countObjects)));
}
/*
* Routines to create the class object
*/
/*
* Declare the Static Methods table.
*/
static somStaticMethod_t M_StudentSM[] = {
{ &M_StudentClassData.countObjects,
&somId_countObjects,
&somDI_countObjects,
(somMethodProc *) StudentClass_countObjects,
(somMethodProc *) somRD_countObjects,
(somMethodProc *) somAP_countObjects },
};
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t M_StudentOM[] = {
{ &somId_somInit,
(somMethodProc *) StudentClass_somInit },
{ &somId_somNew,
(somMethodProc *) StudentClass_somNew },
};
static void M_StudentsomInitializeClass ()
{
int i;
somStaticMethod_t *smp;
somOverrideMethod_t *omp;
/*
* Add the Static Methods.
*/
for (smp = M_StudentSM, i = 0; i < 1; smp++, i++)
*(smp->classData) =
_somAddStaticMethod (M_StudenttempClassData.classObject,
*(smp->methodId), *(smp->methodDescriptor),
smp->method, smp->redispatchStub,
smp->applyStub);
/*
* Override methods.
*/
for (omp = M_StudentOM, i = 0; i < 2; omp++, i++)
_somOverrideSMethod (M_StudenttempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(M_StudentsomCreateClass, system)
static void SOMLINK M_StudentsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
M_StudenttempClassData.classObject = _somNew (mClsObj);
_somInitClass (M_StudenttempClassData.classObject,
"M_Student",
pClsObj,
sizeof(M_StudentData),
M_Student_MaxNoMethods,
M_Student_MajorVersion,
M_Student_MinorVersion);
M_StudentCClassData.instanceDataToken =
_somGetInstanceToken(M_StudenttempClassData.classObject);
M_StudentsomInitializeClass();
M_StudentCClassData.parentMtab =
_somGetPClsMtab(M_StudenttempClassData.classObject);
_somSetClassData(M_StudenttempClassData.classObject, (somClassDataStructure *)&M_StudentClassData);
_somClassReady(M_StudenttempClassData.classObject);
/* make newly created class object visible */
M_StudentClassData.classObject = M_StudenttempClassData.classObject;
}
M_Student * SOMLINK M_StudentNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != M_Student_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > M_Student_MinorVersion))) {
somPrintf("M_StudentNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (M_StudentClassData.classObject != (SOMAny *) NULL)
return(M_StudentClassData.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. */
SOMClassNewClass(1,1); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("SOMClass"), 1, 1);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(M_StudentsomCreateClass, pClsObj, mClsObj,
&M_StudenttempClassData);
return (M_StudentClassData.classObject);
}
#endif /* M_Student_Class_Source */
#endif /* STUDENT_ih */