home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / WPSDEM.ZIP / CMBSTDNT / STUDENT.C < prev    next >
Text File  |  1992-08-21  |  3KB  |  121 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: student.c.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitc: 1.24
  8.  */
  9.  
  10. #define Student_Class_Source
  11. #include "student.ih"
  12.  
  13. SOM_Scope void   SOMLINK somInit(Student *somSelf)
  14. {
  15.     StudentData *somThis = StudentGetData(somSelf);
  16.     StudentMethodDebug("Student","somInit");
  17.  
  18.     _id[0] = _name[0] = '\0';
  19.     parent_somInit(somSelf);
  20. }
  21.  
  22. /*
  23.  *  sets up a new student
  24.  */
  25.  
  26. SOM_Scope void   SOMLINK setUpStudent(Student *somSelf,
  27.                 char *id,
  28.                 char *name)
  29. {
  30.     StudentData *somThis = StudentGetData(somSelf);
  31.     StudentMethodDebug("Student","setUpStudent");
  32.     strcpy( _id, id );
  33.     strcpy( _name, name );
  34.  
  35. }
  36.  
  37. /*
  38.  *  prints the student information
  39.  */
  40.  
  41. SOM_Scope void   SOMLINK printStudentInfo(Student *somSelf)
  42. {
  43.     char szBuffer[80];
  44.     StudentData *somThis = StudentGetData(somSelf);
  45.     StudentMethodDebug("Student","printStudentInfo");
  46.     printf( "Student Info ID       : %s\n", _id );
  47.     printf( "             Name     : %s\n", _name );
  48.     printf( "             Type     : %s\n", _getStudentType( somSelf) );
  49. }
  50.  
  51. SOM_Scope char *  SOMLINK getStudentType(Student *somSelf)
  52. {
  53.     static char *type = "student";
  54.     StudentData *somThis = StudentGetData(somSelf);
  55.     StudentMethodDebug("Student","getStudentType");
  56.     return type;
  57. }
  58.  
  59. SOM_Scope char *  SOMLINK getStudentID(Student *somSelf)
  60. {
  61.     StudentData *somThis = StudentGetData(somSelf);
  62.     StudentMethodDebug("Student","getStudentID");
  63.  
  64.     return _id;
  65. }
  66.  
  67. SOM_Scope void   SOMLINK SetStudentGPA(Student *somSelf,
  68.                 int GPA)
  69. {
  70.     StudentData *somThis = StudentGetData(somSelf);
  71.     StudentMethodDebug("Student","SetStudentGPA");
  72.  
  73.     _GPA = GPA;
  74. }
  75.  
  76. SOM_Scope int   SOMLINK GetStudentGPA(Student *somSelf)
  77. {
  78.     StudentData *somThis = StudentGetData(somSelf);
  79.     StudentMethodDebug("Student","GetStudentGPA");
  80.  
  81.     return _GPA;
  82. }
  83.  
  84.  
  85.  
  86. /*****************************************************************************
  87.  *****************************************************************************
  88.  * Below this point are the class functions we have defined for our implied  *
  89.  * metaclass. All object functions should be above this section              *
  90.  *****************************************************************************
  91.  *****************************************************************************/
  92.  
  93. #undef SOM_CurrentClass
  94. #define SOM_CurrentClass SOMMeta
  95. SOM_Scope void   SOMLINK StudentClass_somInit(M_Student *somSelf)
  96. {
  97.     M_StudentData *somThis = M_StudentGetData(somSelf);
  98.     M_StudentMethodDebug("M_Student","StudentClass_somInit");
  99.  
  100.     _count = 0;
  101.     parent_somInit(somSelf);
  102. }
  103.  
  104. SOM_Scope SOMAny *  SOMLINK StudentClass_somNew(M_Student *somSelf)
  105. {
  106.     M_StudentData *somThis = M_StudentGetData(somSelf);
  107.     M_StudentMethodDebug("M_Student","StudentClass_somNew");
  108.  
  109.     _count++;
  110.     return (parent_somNew(somSelf));
  111. }
  112.  
  113. SOM_Scope int   SOMLINK StudentClass_countObjects(M_Student *somSelf)
  114. {
  115.     M_StudentData *somThis = M_StudentGetData(somSelf);
  116.     M_StudentMethodDebug("M_Student","StudentClass_countObjects");
  117.  
  118.     return _count;
  119. }
  120.  
  121.