home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
WPSDEM.ZIP
/
CMBSTDNT
/
STUDENT.C
< prev
next >
Wrap
Text File
|
1992-08-21
|
3KB
|
121 lines
/*
* This file was generated by the SOM Compiler.
* FileName: student.c.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitc: 1.24
*/
#define Student_Class_Source
#include "student.ih"
SOM_Scope void SOMLINK somInit(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","somInit");
_id[0] = _name[0] = '\0';
parent_somInit(somSelf);
}
/*
* sets up a new student
*/
SOM_Scope void SOMLINK setUpStudent(Student *somSelf,
char *id,
char *name)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","setUpStudent");
strcpy( _id, id );
strcpy( _name, name );
}
/*
* prints the student information
*/
SOM_Scope void SOMLINK printStudentInfo(Student *somSelf)
{
char szBuffer[80];
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","printStudentInfo");
printf( "Student Info ID : %s\n", _id );
printf( " Name : %s\n", _name );
printf( " Type : %s\n", _getStudentType( somSelf) );
}
SOM_Scope char * SOMLINK getStudentType(Student *somSelf)
{
static char *type = "student";
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","getStudentType");
return type;
}
SOM_Scope char * SOMLINK getStudentID(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","getStudentID");
return _id;
}
SOM_Scope void SOMLINK SetStudentGPA(Student *somSelf,
int GPA)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","SetStudentGPA");
_GPA = GPA;
}
SOM_Scope int SOMLINK GetStudentGPA(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","GetStudentGPA");
return _GPA;
}
/*****************************************************************************
*****************************************************************************
* Below this point are the class functions we have defined for our implied *
* metaclass. All object functions should be above this section *
*****************************************************************************
*****************************************************************************/
#undef SOM_CurrentClass
#define SOM_CurrentClass SOMMeta
SOM_Scope void SOMLINK StudentClass_somInit(M_Student *somSelf)
{
M_StudentData *somThis = M_StudentGetData(somSelf);
M_StudentMethodDebug("M_Student","StudentClass_somInit");
_count = 0;
parent_somInit(somSelf);
}
SOM_Scope SOMAny * SOMLINK StudentClass_somNew(M_Student *somSelf)
{
M_StudentData *somThis = M_StudentGetData(somSelf);
M_StudentMethodDebug("M_Student","StudentClass_somNew");
_count++;
return (parent_somNew(somSelf));
}
SOM_Scope int SOMLINK StudentClass_countObjects(M_Student *somSelf)
{
M_StudentData *somThis = M_StudentGetData(somSelf);
M_StudentMethodDebug("M_Student","StudentClass_countObjects");
return _count;
}