zeus::WebServer Class Reference
Public Types | |
using | Observer = std::function< void(ememory::SharedPtr< zeus::Buffer >)> |
Public Member Functions | |
template<class CLASS_TYPE > | |
void | connect (CLASS_TYPE *_class, void(CLASS_TYPE::*_func)(ememory::SharedPtr< zeus::Buffer >)) |
WebServer () | |
WebServer (enet::Tcp _connection, bool _isServer) | |
virtual | ~WebServer () |
void | setInterface (enet::Tcp _connection, bool _isServer) |
void | connect (bool _async=false) |
void | disconnect (bool _inThreadStop=false) |
bool | isActive () const |
void | setInterfaceName (const std::string &_name) |
int32_t | writeBinary (ememory::SharedPtr< zeus::Buffer > _data) |
void | ping () |
bool | onReceiveUri (const std::string &_uri, const std::vector< std::string > &_protocols) |
void | onReceiveData (std::vector< uint8_t > &_frame, bool _isBinary) |
void | newBuffer (ememory::SharedPtr< zeus::Buffer > _buffer) |
const std::chrono::steady_clock::time_point & | getLastTimeReceive () |
const std::chrono::steady_clock::time_point & | getLastTimeSend () |
void | addAsync (ActionAsync _elem) |
template<class... _ARGS> | |
zeus::FutureBase | call (const std::string &_functionName, _ARGS &&... _args) |
template<class... _ARGS> | |
zeus::FutureBase | callAction (const std::string &_functionName, _ARGS &&... _args, zeus::FutureData::ObserverFinish _callback) |
template<class... _ARGS> | |
zeus::FutureBase | callService (uint32_t _serviceId, const std::string &_functionName, _ARGS &&... _args) |
template<class... _ARGS> | |
zeus::FutureBase | callServiceAction (uint32_t _serviceId, const std::string &_functionName, _ARGS &&... _args, zeus::FutureData::ObserverFinish _callback) |
template<class... _ARGS> | |
zeus::FutureBase | callClient (uint32_t _clientId, const std::string &_functionName, _ARGS &&... _args) |
template<class... _ARGS> | |
zeus::FutureBase | callClientAction (uint32_t _clientId, const std::string &_functionName, _ARGS &&... _args, zeus::FutureData::ObserverFinish _callback) |
zeus::FutureBase | callForward (uint32_t _clientId, ememory::SharedPtr< zeus::Buffer > _Buffer, uint64_t _singleReferenceId, zeus::FutureData::ObserverFinish _callback) |
void | callForwardMultiple (uint32_t _clientId, ememory::SharedPtr< zeus::Buffer > _Buffer, uint64_t _singleReferenceId) |
void | answerProtocolError (uint32_t _transactionId, const std::string &_errorHelp) |
template<class ZEUS_ARG > | |
void | answerValue (uint64_t _clientTransactionId, ZEUS_ARG _value, uint32_t _clientId=0) |
void | answerVoid (uint64_t _clientTransactionId, uint32_t _clientId=0) |
void | answerError (uint64_t _clientTransactionId, const std::string &_errorValue, const std::string &_errorComment="", uint32_t _clientId=0) |
Public Attributes | |
Observer | m_observerElement |
Member Typedef Documentation
§ Observer
using zeus::WebServer::Observer = std::function<void(ememory::SharedPtr<zeus::Buffer>)> |
Define an Observer: function pointer.
Constructor & Destructor Documentation
§ WebServer() [1/2]
zeus::WebServer::WebServer | ( | ) |
- Parameters
-
[in]
§ WebServer() [2/2]
zeus::WebServer::WebServer | ( | enet::Tcp | _connection, |
bool | _isServer | ||
) |
- Parameters
-
[in]
§ ~WebServer()
|
virtual |
- Parameters
-
[in]
Member Function Documentation
§ addAsync()
void zeus::WebServer::addAsync | ( | ActionAsync | _elem | ) |
- Parameters
-
[in]
§ answerError()
void zeus::WebServer::answerError | ( | uint64_t | _clientTransactionId, |
const std::string & | _errorValue, | ||
const std::string & | _errorComment = "" , |
||
uint32_t | _clientId = 0 |
||
) |
- Parameters
-
[in]
§ answerProtocolError()
void zeus::WebServer::answerProtocolError | ( | uint32_t | _transactionId, |
const std::string & | _errorHelp | ||
) |
- Parameters
-
[in]
§ answerValue()
template<class ZEUS_ARG >
|
inline |
- Parameters
-
[in]
§ answerVoid()
void zeus::WebServer::answerVoid | ( | uint64_t | _clientTransactionId, |
uint32_t | _clientId = 0 |
||
) |
- Parameters
-
[in]
§ call()
template<class... _ARGS>
|
inline |
- Parameters
-
[in]
§ callAction()
template<class... _ARGS>
|
inline |
- Parameters
-
[in]
§ callClient()
template<class... _ARGS>
|
inline |
- Parameters
-
[in]
§ callClientAction()
template<class... _ARGS>
|
inline |
- Parameters
-
[in]
§ callForward()
zeus::FutureBase zeus::WebServer::callForward | ( | uint32_t | _clientId, |
ememory::SharedPtr< zeus::Buffer > | _Buffer, | ||
uint64_t | _singleReferenceId, | ||
zeus::FutureData::ObserverFinish | _callback | ||
) |
- Parameters
-
[in]
§ callForwardMultiple()
void zeus::WebServer::callForwardMultiple | ( | uint32_t | _clientId, |
ememory::SharedPtr< zeus::Buffer > | _Buffer, | ||
uint64_t | _singleReferenceId | ||
) |
- Parameters
-
[in]
§ callService()
template<class... _ARGS>
|
inline |
- Parameters
-
[in]
§ callServiceAction()
template<class... _ARGS>
|
inline |
- Parameters
-
[in]
§ connect() [1/2]
template<class CLASS_TYPE >
|
inline |
Connect an function member on the signal with the shared_ptr object.
- Parameters
-
[in] _class shared_ptr Object on whe we need to call ==> the object is get in keeped in weak_ptr. [in] _func Function to call.
§ connect() [2/2]
void zeus::WebServer::connect | ( | bool | _async = false | ) |
- Parameters
-
[in]
§ disconnect()
void zeus::WebServer::disconnect | ( | bool | _inThreadStop = false | ) |
- Parameters
-
[in]
§ getLastTimeReceive()
|
inline |
- Parameters
-
[in]
§ getLastTimeSend()
|
inline |
- Parameters
-
[in]
§ isActive()
bool zeus::WebServer::isActive | ( | ) | const |
- Parameters
-
[in]
§ newBuffer()
void zeus::WebServer::newBuffer | ( | ememory::SharedPtr< zeus::Buffer > | _buffer | ) |
- Parameters
-
[in]
§ onReceiveData()
void zeus::WebServer::onReceiveData | ( | std::vector< uint8_t > & | _frame, |
bool | _isBinary | ||
) |
- Parameters
-
[in]
§ onReceiveUri()
bool zeus::WebServer::onReceiveUri | ( | const std::string & | _uri, |
const std::vector< std::string > & | _protocols | ||
) |
- Parameters
-
[in]
§ ping()
void zeus::WebServer::ping | ( | ) |
- Parameters
-
[in]
§ setInterface()
void zeus::WebServer::setInterface | ( | enet::Tcp | _connection, |
bool | _isServer | ||
) |
- Parameters
-
[in]
§ setInterfaceName()
void zeus::WebServer::setInterfaceName | ( | const std::string & | _name | ) |
- Parameters
-
[in]
§ writeBinary()
int32_t zeus::WebServer::writeBinary | ( | ememory::SharedPtr< zeus::Buffer > | _data | ) |
- Parameters
-
[in]
The documentation for this class was generated from the following file:
- framework/atria-soft/zeus/zeus/WebServer.hpp