Mock stream.
More...
#include <mock_stream.hpp>
|
using | recv_handler = std::function< void(std::error_code, nlohmann::json)> |
| Read completion handler. More...
|
|
using | send_handler = std::function< void(std::error_code)> |
| Write completion handler. More...
|
|
using | args = std::vector< std::any > |
| Functions arguments. More...
|
|
using | functions = std::unordered_map< std::string, std::vector< args > > |
| Map of all functions. More...
|
|
◆ recv()
Start asynchronous read.
- Precondition
- another read operation must not be running
-
handler != nullptr
- Parameters
-
Implements irccd::stream.
◆ send()
void irccd::test::mock_stream::send |
( |
const nlohmann::json & |
json, |
|
|
send_handler |
handler |
|
) |
| |
|
overridevirtual |
Start asynchronous write.
- Precondition
- json.is_object()
-
another write operation must not be running
-
handler != nullptr
- Parameters
-
json | the JSON message |
handler | the handler |
Implements irccd::stream.
The documentation for this class was generated from the following file: