AirInv Logo  1.00.10
C++ Simulated Airline Inventory Management System Library
Loading...
Searching...
No Matches
RequestHandler.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6#include <string>
7#include <fstream>
8#include <sstream>
9// Boost
10#include <boost/lexical_cast.hpp>
11// StdAir
12// AirInv
16
17namespace AIRINV {
18
19 // //////////////////////////////////////////////////////////////////////
20 RequestHandler::RequestHandler (const stdair::AirlineCode_T& iAirlineCode)
21 : _airlineCode (iAirlineCode) {
22 }
23
24 // //////////////////////////////////////////////////////////////////////
26 handleRequest (Request& ioRequest, Reply& ioReply) const {
27 bool hasBeenSuccessfull = false;
28
29 // Decode request string to a flight-date details (airline code,
30 // flight number and departure date)
31 hasBeenSuccessfull = ioRequest.parseFlightDate();
32
33 if (hasBeenSuccessfull == false) {
35 return hasBeenSuccessfull;
36 }
37
44
45 // Fill out the reply to be sent to the client.
47 ioReply.content = "Your are looking for: '" + ioRequest._flightDetails + "'. Ok, I have found your flight-date. Be patient until I give you more information about it";
48
49 return hasBeenSuccessfull;
50 }
51
52}
RequestHandler(const stdair::AirlineCode_T &)
bool handleRequest(Request &, Reply &) const
std::string content
Definition Reply.hpp:23
FlightRequestStatus::EN_FlightRequestStatus _status
Definition Reply.hpp:20
std::string _flightDetails
Definition Request.hpp:29
bool parseFlightDate()
Definition Request.cpp:12