home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_01 / 1001032a < prev    next >
Text File  |  1991-11-18  |  1KB  |  49 lines

  1. //////////////////////////////////////////////////
  2. //  PAYLIST.H
  3. //  Concrete List Class For a Payroll List.
  4. //  By David Brumbaugh
  5. //////////////////////////////////////////////////
  6.  
  7. #ifndef PAYLIST_H
  8. #define PAYLIST_H
  9. #include "pinclas.h"
  10.  
  11. struct employee
  12. {
  13.     char last[21], first[11];
  14.     double pay_rate;  // Dollars per day
  15.     long days_worked;
  16.     // Days worked in this pay period.
  17. };
  18.  
  19. class PayList: public Pfm_List {
  20. protected:
  21.     employee empBuffer;
  22.  
  23. public:
  24. // Constructors
  25.   PayList():Pfm_List("payroll.db","Employees")
  26.   {default_key = DB_Column(table,"LastFirst"); }
  27.   PayList(DB &open_db):Pfm_List(open_db, "Employees")
  28.   {default_key = DB_Column(table,"LastFirst");}
  29.   PayList(DB &open_db, DBTAB &db_table):
  30.   Pfm_List(open_db, db_table)
  31.   {default_key = DB_Column(table,"LastFirst");}
  32.  
  33. // List Navigation
  34.     virtual Boolean find (char *last),
  35.                     find(char *last, char *first);
  36.     virtual Boolean find(void *key)
  37.     {return (find( (char *) key));}
  38.  
  39. // List Interface
  40.     virtual void add(employee &emp);
  41.     virtual void replace(employee &emp);
  42.     virtual void get(employee &emp);
  43.     virtual void *current()
  44.     { get(empBuffer); return (void *) &empBuffer;}
  45.  
  46. };
  47. #endif
  48.  
  49.