The EmployeeNamed class inherits the PersonNamed and calls it's publishGuts and refreshGuts methods internally.
#ifndef EMPLOYEENAMED_H#define EMPLOYEENAMED_H#include <PersonNamed.h>// <<BeginUserCode>>// <<EndUserCode>>class EmployeeNamed: public PersonNamed {public: unsigned short salary; EmployeeNamed(const IPCPartition & partition, const char *name) : PersonNamed( partition, name, "Employee" ) { salary = 3000;// <<BeginUserCode>>// <<EndUserCode>> } ~EmployeeNamed(){// <<BeginUserCode>>// <<EndUserCode>> }protected: EmployeeNamed( const IPCPartition & partition, const char * name, const char * type ) : PersonNamed( partition, name, type ) { salary = 3000;// <<BeginUserCode>>// <<EndUserCode>> } void publishGuts( ISostream & out ){ PersonNamed::publishGuts( out ); out << salary; } void refreshGuts( ISistream & in ){ PersonNamed::refreshGuts( in ); in >> salary; }// <<BeginUserCode>>// <<EndUserCode>>};// <<BeginUserCode>>// <<EndUserCode>>#endif // EMPLOYEENAMED_H| 2 July 1998 - WebMaster | Copyright © CERN 1998 |