#ifndef PERSON_H
#define PERSON_H

#include <iostream>

using namespace std;

enum SocioeconomicalStatus
{
	  socioeconomicalStatusUnknown

	, socioeconomicalStatusPoor
	, socioeconomicalStatusLow
	, socioeconomicalStatusMedium
	, socioeconomicalStatusHigh
	, socioeconomicalStatusRich

	, socioeconomicalStatusCount
};

const char* const SocioeconomicalStatusStr[] =
{
	  "unknown"

	, "poor"
	, "low"
	, "medium"
	, "high"
	, "rich"

	, ""
};

class Person
{
  protected:
	long id;
	string name;
	string birthDate;

  public:
	explicit Person(long id = 0.0, const string& name = "", const string& birthDate = "");
	virtual ~Person() { }
	virtual istream& load(istream& output);
	virtual ostream& print(ostream& output) const;
	virtual SocioeconomicalStatus getSocioeconomicalStatus() const = 0; // pure virtual method

  private:
	Person(const Person& other);
	const Person& operator=(const Person& other);
};

inline istream& operator>>(istream& in, Person& person) { return person.load(in); }
inline ostream& operator<<(ostream& out, const Person& person) { return person.print(out); }
istream& readline(istream& in, string& str);

#endif // PERSON_H
