WebServer.hpp
Go to the documentation of this file.
21 ememory::SharedPtr<zeus::BufferCall> createBaseCall(uint64_t _transactionId, const std::string& _functionName, const uint32_t& _serviceId=0);
64 ememory::SharedPtr<zeus::BufferCall> createCall(uint64_t _transactionId, const std::string& _functionName, _ARGS&&... _args) {
78 ememory::SharedPtr<zeus::BufferCall> createCallService(uint64_t _transactionId, const uint32_t& _serviceName, const std::string& _functionName, _ARGS&&... _args) {
79 ememory::SharedPtr<zeus::BufferCall> callElem = createBaseCall(_transactionId, _functionName, _serviceName);
249 ememory::SharedPtr<zeus::BufferCall> callElem = zeus::createCall(id, _functionName, std::forward<_ARGS>(_args)...);
258 zeus::FutureBase callAction(const std::string& _functionName, _ARGS&&... _args, zeus::FutureData::ObserverFinish _callback) {
260 ememory::SharedPtr<zeus::BufferCall> callElem = zeus::createCall(id, _functionName, std::forward<_ARGS>(_args)...);
271 zeus::FutureBase callService(uint32_t _serviceId, const std::string& _functionName, _ARGS&&... _args) {
273 ememory::SharedPtr<zeus::BufferCall> callElem = zeus::createCallService(id, _serviceId, _functionName, std::forward<_ARGS>(_args)...);
282 zeus::FutureBase callServiceAction(uint32_t _serviceId, const std::string& _functionName, _ARGS&&... _args, zeus::FutureData::ObserverFinish _callback) {
284 ememory::SharedPtr<zeus::BufferCall> callElem = zeus::createCallService(id, _serviceId, _functionName, std::forward<_ARGS>(_args)...);
359 void answerError(uint64_t _clientTransactionId, const std::string& _errorValue, const std::string& _errorComment="", uint32_t _clientId=0);
std::function< bool(zeus::FutureBase)> ObserverFinish
Define an Observer: function pointer.
Definition: FutureData.hpp:21
ememory::SharedPtr< zeus::BufferCall > createCallService(uint64_t _transactionId, const uint32_t &_serviceName, const std::string &_functionName, _ARGS &&... _args)
Definition: WebServer.hpp:78
void addAsync(ActionAsync _elem)
Definition: WebServer.hpp:90
void onReceiveData(std::vector< uint8_t > &_frame, bool _isBinary)
zeus::FutureBase callAction(const std::string &_functionName, _ARGS &&... _args, zeus::FutureData::ObserverFinish _callback)
Definition: WebServer.hpp:258
zeus::FutureBase callService(uint32_t _serviceId, const std::string &_functionName, _ARGS &&... _args)
Definition: WebServer.hpp:271
void addAnswer(const ZEUS_TYPE_DATA &_value)
set the answer of the call
Definition: BufferAnswer.hpp:46
static ememory::SharedPtr< zeus::BufferAnswer > create()
Create a shared pointer on the BufferAnswer.
ememory::SharedPtr< zeus::BufferCall > createBaseCall(uint64_t _transactionId, const std::string &_functionName, const uint32_t &_serviceId=0)
Generic zeus Future interface to get data asynchronously.
Definition: FutureBase.hpp:14
void addParameter()
Add parameter (or not.. this is the end of an auto resursive add parameter)
void setInterface(enet::Tcp _connection, bool _isServer)
zeus::FutureBase call(const std::string &_functionName, _ARGS &&... _args)
Definition: WebServer.hpp:247
void disconnect(bool _inThreadStop=false)
bool onReceiveUri(const std::string &_uri, const std::vector< std::string > &_protocols)
std::function< void(ememory::SharedPtr< zeus::Buffer >)> Observer
Define an Observer: function pointer.
Definition: WebServer.hpp:100
zeus::FutureBase callClientAction(uint32_t _clientId, const std::string &_functionName, _ARGS &&... _args, zeus::FutureData::ObserverFinish _callback)
Definition: WebServer.hpp:304
void createParam(int32_t _paramId, ememory::SharedPtr< zeus::BufferCall > _obj)
zeus::FutureBase callClient(uint32_t _clientId, const std::string &_functionName, _ARGS &&... _args)
Definition: WebServer.hpp:293
zeus::FutureBase callForward(uint32_t _clientId, ememory::SharedPtr< zeus::Buffer > _Buffer, uint64_t _singleReferenceId, zeus::FutureData::ObserverFinish _callback)
void answerError(uint64_t _clientTransactionId, const std::string &_errorValue, const std::string &_errorComment="", uint32_t _clientId=0)
WebServer()
void answerVoid(uint64_t _clientTransactionId, uint32_t _clientId=0)
void setInterfaceName(const std::string &_name)
virtual ~WebServer()
ememory::SharedPtr< zeus::BufferCall > createCall(uint64_t _transactionId, const std::string &_functionName, _ARGS &&... _args)
Definition: WebServer.hpp:64
int32_t writeBinary(ememory::SharedPtr< zeus::Buffer > _data)
void connect(CLASS_TYPE *_class, void(CLASS_TYPE::*_func)(ememory::SharedPtr< zeus::Buffer >))
Connect an function member on the signal with the shared_ptr object.
Definition: WebServer.hpp:108
void ping()
const std::chrono::steady_clock::time_point & getLastTimeSend()
Definition: WebServer.hpp:206
const std::chrono::steady_clock::time_point & getLastTimeReceive()
Definition: WebServer.hpp:198
void setTransactionId(uint32_t _value)
Set the transaction identifier of the packet.
void answerValue(uint64_t _clientTransactionId, ZEUS_ARG _value, uint32_t _clientId=0)
Definition: WebServer.hpp:341
void answerProtocolError(uint32_t _transactionId, const std::string &_errorHelp)
zeus::FutureBase callServiceAction(uint32_t _serviceId, const std::string &_functionName, _ARGS &&... _args, zeus::FutureData::ObserverFinish _callback)
Definition: WebServer.hpp:282
void callForwardMultiple(uint32_t _clientId, ememory::SharedPtr< zeus::Buffer > _Buffer, uint64_t _singleReferenceId)
void newBuffer(ememory::SharedPtr< zeus::Buffer > _buffer)
bool isActive() const