Class to wrap IConnection objects with template functions.
More...
#include <msgpack_rpc/transport/connection_wrapper.h>
Class to wrap IConnection objects with template functions.
Definition at line 36 of file connection_wrapper.h.
◆ ConnectionClosedCallback
Type of callback functions called when a connection is closed.
Parameters:
- Status object specifying the reason.
Definition at line 60 of file connection_wrapper.h.
◆ MessageReceivedCallback
Type of callback functions called when a message is received.
Parameters:
- Received message.
Definition at line 45 of file connection_wrapper.h.
◆ MessageSentCallback
Type of callback functions called when a message is successfully sent.
Definition at line 51 of file connection_wrapper.h.
◆ ConnectionWrapper()
msgpack_rpc::transport::ConnectionWrapper::ConnectionWrapper |
( |
std::shared_ptr< IConnection > | connection | ) |
|
|
inlineexplicitnoexcept |
◆ async_close()
void msgpack_rpc::transport::ConnectionWrapper::async_close |
( |
| ) |
|
|
inline |
◆ async_notify()
template<typename... Parameters>
void msgpack_rpc::transport::ConnectionWrapper::async_notify |
( |
messages::MethodNameView | method_name, |
|
|
const Parameters &... | parameters ) |
|
inline |
Asynchronously send a notification.
- Template Parameters
-
Parameters | Types of parameters. |
- Parameters
-
[in] | method_name | Method name. |
[in] | parameters | Parameters. |
Definition at line 138 of file connection_wrapper.h.
◆ async_request()
template<typename... Parameters>
Asynchronously send a request.
- Template Parameters
-
Parameters | Types of parameters. |
- Parameters
-
[in] | method_name | Method name. |
[in] | message_id | Message ID. |
[in] | parameters | Parameters. |
Definition at line 95 of file connection_wrapper.h.
◆ async_response_error()
template<typename T>
void msgpack_rpc::transport::ConnectionWrapper::async_response_error |
( |
messages::MessageID | request_id, |
|
|
const T & | error ) |
|
inline |
Asynchronously send a response with an error.
- Template Parameters
-
- Parameters
-
[in] | request_id | Message ID of the request. |
[in] | error | Error. |
Definition at line 124 of file connection_wrapper.h.
◆ async_response_success()
template<typename T>
void msgpack_rpc::transport::ConnectionWrapper::async_response_success |
( |
messages::MessageID | request_id, |
|
|
const T & | result ) |
|
inline |
Asynchronously send a response without an error.
- Template Parameters
-
- Parameters
-
[in] | request_id | Message ID of the request. |
[in] | result | Result. |
Definition at line 109 of file connection_wrapper.h.
◆ connection()
std::shared_ptr< IConnection > msgpack_rpc::transport::ConnectionWrapper::connection |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ local_address()
◆ remote_address()
const addresses::IAddress & msgpack_rpc::transport::ConnectionWrapper::remote_address |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ start()
Start process of this connection.
- Parameters
-
[in] | on_received | Callback function called when a message is received. |
[in] | on_sent | Callback function called when a message is sent. |
[in] | on_closed | Callback function called when this connection is closed. |
Definition at line 80 of file connection_wrapper.h.
◆ connection_
std::shared_ptr<IConnection> msgpack_rpc::transport::ConnectionWrapper::connection_ |
|
private |
The documentation for this class was generated from the following file: