/** @file * @author Edouard DUPIN * @copyright 2016, Edouard DUPIN, all right reserved * @license MPL v2.0 (see license file) */ #pragma once #include #include namespace appl { class Router; class ClientInterface; class GateWayInterface { private: appl::Router* m_routerInterface; zeus::WebServer m_interfaceClient; uint16_t m_lastSourceID; //!< The source dynbamic generated ID is manage in 2 part the value <= 0x7FFF is used by the gateway and the value >= 0x8000 is manage by the router std::vector> m_clientConnected; std::string m_name; bool requestURI(const std::string& _uri); public: GateWayInterface(enet::Tcp _connection, appl::Router* _routerInterface); virtual ~GateWayInterface(); void start(); void stop(); void onServiceData(ememory::SharedPtr _value); public: uint16_t addClient(ememory::SharedPtr _value); void rmClient(ememory::SharedPtr _value); void send(ememory::SharedPtr _data); const std::string& getName() { return m_name; } bool isAlive(); protected: void answerProtocolError(uint32_t _transactionId, const std::string& _errorHelp); }; }