home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_03 / 1003032b < prev    next >
Text File  |  1992-01-13  |  2KB  |  57 lines

  1.  
  2.  
  3. EXAMPLE 2 :
  4.  
  5. /****************************************************
  6. * This code declares tests objects, test_a, test_b
  7. * and test_c.  These objects attach their own 
  8. * initialization, processing and display routines 
  9. * to the pointers provided.
  10. * Each test has its own name and initialization methods,
  11. * but inherits its store and display methods from it's
  12. * respective class, ie. test_b from class_1, test_c from 
  13. * class_2.
  14. *
  15. * Construct  Name              Location
  16. *
  17. * CLASS      TEST_CLASS        class header file     ROM
  18. * SUBCLASS   class_1, class_2  class specific files  ROM
  19. * OBJECTS    test_a, test_b    object specific files ROM
  20. *
  21. * The "const" directive tells the compiler to place
  22. * the test objects in ROM.
  23. ****************************************************/
  24.  
  25. file test_a.c
  26.  
  27. /***** Definition of Object "A" *******/
  28.  
  29. const TEST_CLASS     test_a = { "TEST A",
  30.                                 object_a_init,
  31.                                 class_1_process_data,
  32.                                 class_1_display
  33.                               };
  34.  
  35. file test_b.c
  36.  
  37. /***** Definition of Object "B" ********/
  38.  
  39. const TEST_CLASS     test_b = { "TEST B",
  40.                                 object_b_init,
  41.                                 class_1_process_data,
  42.                                 class_1_display
  43.                               };
  44.  
  45.  
  46. file test_c.c
  47.  
  48. /***** Definition of Object "C" ********/
  49.  
  50. const TEST_CLASS     test_c = { "TEST C",
  51.                                 object_c_init,
  52.                                 class_2_process_data,
  53.                                 class_2_display
  54.                               };
  55.  
  56.  
  57.