#ifndef MANAGER_HH #define MANAGER_HH #include #include #include #include "Employee.hh" using namespace std ; class Manager : public Employee { public: Manager(const char* name, double salary) : Employee(name, salary) {} void businessCard( ostream& os = cout) const { Employee::businessCard( os ); os << " +----------+ " << endl << " Subordinates " << endl << " +----------+ " << endl; for ( auto iter = _subordinates.begin() ; iter != _subordinates.end(); iter++ ) { os << " - " << (*iter)->name() << endl; } os << " +----------+ " << endl; } void addSubordinate ( Employee& empl ) { _subordinates.insert( &empl ); } const set& listOfSubordinates() const { return _subordinates; } private: string _name ; double _salary ; set _subordinates ;// subordinates is an unordered collection of unique people so set is usefull enough } ; #endif