xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
WSClient.h
1
#pragma once
2
3
#include <test/jtx/AbstractClient.h>
4
5
#include <xrpld/core/Config.h>
6
7
#include <xrpl/json/json_value.h>
8
9
#include <
chrono
>
10
#include <
functional
>
11
#include <
memory
>
12
#include <
optional
>
13
#include <
string
>
14
#include <
unordered_map
>
15
16
namespace
xrpl::test
{
17
18
class
WSClient
:
public
AbstractClient
19
{
20
public
:
24
virtual
std::optional<json::Value>
25
getMsg
(
std::chrono::milliseconds
const
& timeout =
std::chrono::milliseconds
{0}) = 0;
26
30
virtual
std::optional<json::Value>
31
findMsg
(
32
std::chrono::milliseconds
const
& timeout,
33
std::function
<
bool
(
json::Value
const
&)> pred) = 0;
34
};
35
39
std::unique_ptr<WSClient>
40
makeWSClient
(
41
Config
const
& cfg,
42
bool
v2 =
true
,
43
unsigned
rpcVersion = 2,
44
std::unordered_map<std::string, std::string>
const
& headers = {});
45
46
}
// namespace xrpl::test
chrono
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::Config
Definition
src/xrpld/core/Config.h:89
xrpl::test::AbstractClient::AbstractClient
AbstractClient()=default
xrpl::test::WSClient
Definition
WSClient.h:19
xrpl::test::WSClient::findMsg
virtual std::optional< json::Value > findMsg(std::chrono::milliseconds const &timeout, std::function< bool(json::Value const &)> pred)=0
Retrieve a message that meets the predicate criteria.
xrpl::test::WSClient::getMsg
virtual std::optional< json::Value > getMsg(std::chrono::milliseconds const &timeout=std::chrono::milliseconds{0})=0
Retrieve a message.
std::chrono::milliseconds
std::function
functional
memory
xrpl::test
Definition
STLedgerEntry.h:21
xrpl::test::makeWSClient
std::unique_ptr< WSClient > makeWSClient(Config const &cfg, bool v2, unsigned rpcVersion, std::unordered_map< std::string, std::string > const &headers)
Returns a client operating through WebSockets/S.
Definition
WSClient.cpp:371
optional
string
std::unique_ptr
unordered_map
Generated by
1.17.0