00001 #ifndef ITEMLY_TEMPLATE_CLASS_HEADER_INCLUDED 00002 #define ITEMLY_TEMPLATE_CLASS_HEADER_INCLUDED 00003 00004 #include "employee.h" 00005 #include <iostream> 00006 00007 template <typename ItemType> 00008 class ItemlyWorker : virtual public Employee { 00009 protected: 00010 double wage_per_item; 00011 ItemType item_quantity; 00012 00013 public: 00014 ItemlyWorker(const char first[] = "", const char last[] = "", 00015 double wage_per = 0.0, const ItemType & quant = ItemType()); 00016 ItemlyWorker(const ItemlyWorker & worker); 00017 virtual ~ItemlyWorker(); 00018 00019 ItemlyWorker & operator = (const ItemlyWorker & worker); 00020 00021 void set_wage_per(double wage_per); 00022 void set_quantity(const ItemType & quant); 00023 00024 virtual double earnings(void) const; 00025 virtual void print(std::ostream & out) const; 00026 }; 00027 00028 #ifdef TEMPLATE_CLASSES_WONT_COMPILE 00029 #include "itemly.def" 00030 #endif 00031 00032 #endif