Class Hierarchy
Loading...
Searching...
No Matches
employee.cpp
Go to the documentation of this file.
1#include "employee.h"
2#include <iostream>
3#include <string>
4using namespace std;
5
6int Employee::_counter = 0;
7
8Employee::Employee(const std::string& name)
9: _name(name)
10{
11 //ctor
12 ++_counter;
13}
14
16{
17 //dtor
18 --_counter;
19}
20
21
22void Employee::print(std::ostream& s) const
23{
24 s << "Name: " << _name << endl;
25 s << "Bezahlung: " << payment() << endl;
26// Bei virtuellen Methoden wird hier zur Laufzeit
27// via der VMT die konkrete Methode Klasse::payment()
28// aufgerufen.
29}
30
Employee(const std::string &name)
Definition employee.cpp:8
virtual ~Employee()
Definition employee.cpp:15
virtual float payment() const =0
virtual void print(std::ostream &s) const
Definition employee.cpp:22