zeus/tools/gateway-front-end/appl/GateWayInterface.hpp

38 lines
979 B
C++
Raw Normal View History

/** @file
* @author Edouard DUPIN
* @copyright 2016, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
2016-10-02 17:01:22 +02:00
#include <zeus/WebServer.hpp>
#include <ememory/memory.hpp>
2016-06-23 22:08:11 +02:00
namespace appl {
class GateWay;
2016-06-23 22:08:11 +02:00
class ClientInterface;
class GateWayInterface {
2016-06-23 22:08:11 +02:00
friend class appl::ClientInterface;
private:
2016-06-23 22:08:11 +02:00
appl::GateWay* m_gatewayInterface;
zeus::WebServer m_interfaceClient;
std::string m_name;
bool requestURI(const std::string& _uri);
public:
GateWayInterface(enet::Tcp _connection, appl::GateWay* _gatewayInterface);
virtual ~GateWayInterface();
2016-05-23 21:18:37 +02:00
void start();
void stop();
2016-07-19 22:31:27 +02:00
void onServiceData(ememory::SharedPtr<zeus::Buffer> _value);
public:
2016-07-19 22:31:27 +02:00
void SendData(uint64_t _userSessionId, ememory::SharedPtr<zeus::Buffer> _data);
const std::string& getName() {
return m_name;
}
bool isAlive();
protected:
void answerProtocolError(uint32_t _transactionId, const std::string& _errorHelp);
};
}