#include <iostream>
#include <string>
#include "person.h"
using namespace std;

Person::Person(const string &name, int yearOfBirth)
  : name_(name), yearOfBirth_(yearOfBirth) {
  // leerer Rumpf
}

// alternativ: 
//
// Person::Person(const string &name, int yearOfBirth) {
//   name_ = name;
//   yearOfBirth_ = yearOfBirth;
// }

void Person::setName(const string &name) {
  name_ = name;
}

string Person::getName() const {
  return name_;
}

void Person::setYearOfBirth(int yearOfBirth) {
  yearOfBirth_ = yearOfBirth;
}

int Person::getYearOfBirth() const {
  return yearOfBirth_;
}

void Person::print(ostream &os) const {
  os << getName()
     << " " << getYearOfBirth();
}

ostream& operator<<(ostream &os, const Person &p) {
  p.print(os);
  return os;
} 


