/** @file * @author Edouard DUPIN * @copyright 2016, Edouard DUPIN, all right reserved * @license MPL v2.0 (see license file) */ #pragma once #include #include #include #include namespace appl { class Router; class GateWayInterface; class ClientInterface : public ememory::EnableSharedFromThis { private: appl::Router* m_routerInterface; zeus::WebServer m_interfaceClient; bool requestURI(const std::string& _uri); public: ememory::SharedPtr m_userGateWay; uint16_t m_uid; //!< gateway unique ID ==> to have an internal routage ... public: ClientInterface(enet::Tcp _connection, appl::Router* _routerInterface); virtual ~ClientInterface(); void start(); void stop(); void onClientData(ememory::SharedPtr _value); void send(ememory::SharedPtr _data); bool checkId(uint16_t _id) const { return m_uid == _id; } uint16_t getId() const { return m_uid; } bool isAlive(); void answerProtocolError(uint32_t _transactionId, const std::string& _errorHelp); }; }