#ifndef INC_MAIN
#define INC_MAIN
#include <iostream>
#include <map>
using namespace std;
typedef map< string, string > StringMap;
class cPerson
{
public:
cPerson();
cPerson(string);
~cPerson();
string Get(string);
bool Set(string x, string y);
private:
StringMap data;
};
typedef map< int, cPerson *> SeatMap;
class cFlight
{
public:
cFlight();
cFlight( string );
~cFlight();
string GetName() const { return name; }
string GetCity( string s )
{
if ( !s.empty() )
return cities[s];
else
return "";
}
bool AddMenu( string, string );
bool AddCrew( string, string );
bool AddCity( string, string );
bool AssignSeat( string, int, cPerson *);
bool FreeSeat( string, int );
void Print(bool = true, bool = true, bool = true, bool = true );
private:
string name;
StringMap menu; StringMap crew; StringMap cities; SeatMap aisle_seats;
SeatMap window_seats;
};
typedef map<string, cFlight * > FlightMap;
class cAirline
{
public:
cAirline();
~cAirline();
bool CreateFlight( string );
bool DeleteFlight( string );
void PrintFlights( bool = false, bool = false );
void PrintFlightsByCity( string );
void PrintPassengers(string, bool = false);
cFlight* GetFlight( string );
bool SetCrew( string, string, string );
bool SetCity( string, string, string );
bool SetMenu( string, string, string );
bool SetSeat( string, string, int, cPerson *);
bool FreeSeat( string, string, int );
private:
FlightMap flights;
};
#endif