AirInv Logo  1.00.0
C++ Simulated Airline Inventory Management System library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AirInvServer.hpp
Go to the documentation of this file.
1 #ifndef __AIRINV_SVR_AIRINVSERVER_HPP
2 #define __AIRINV_SVR_AIRINVSERVER_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 #include <vector>
10 // Boost
11 #include <boost/asio.hpp>
12 #include <boost/noncopyable.hpp>
13 #include <boost/shared_ptr.hpp>
14 // StdAir
15 #include <stdair/stdair_basic_types.hpp>
16 // AirInv
19 
20 namespace AIRINV {
21 
23  class AirInvServer : private boost::noncopyable {
24  public:
25  // //////////// Constructors and Destructors /////////////////
29  AirInvServer (const std::string& address, const std::string& port,
30  const stdair::AirlineCode_T& iAirlineCode,
31  std::size_t thread_pool_size);
33  ~AirInvServer();
34 
35 
36  public:
37  // ////////////////// Business Methods ////////////////////
39  void run();
40 
42  void stop();
43 
44 
45  private:
46  // //////////// Constructors and Destructors /////////////////
48  AirInvServer();
49  AirInvServer(const AirInvServer&);
50 
51 
52  private:
53  // //////////// Attributes /////////////////
55  void handleAccept (const boost::system::error_code& e);
56 
58  std::size_t _threadPoolSize;
59 
61  boost::asio::io_service _ioService;
62 
64  boost::asio::ip::tcp::acceptor _acceptor;
65 
67  ConnectionShrPtr_T _newConnection;
68 
70  RequestHandler _requestHandler;
71  };
72 
73 }
74 #endif // __AIRINV_SVR_AIRINVSERVER_HPP