xrpld
Loading...
Searching...
No Matches
Resolver.h
1#pragma once
2
3#include <xrpl/beast/net/IPEndpoint.h>
4
5#include <functional>
6#include <string>
7#include <vector>
8
9namespace xrpl {
10
12{
13public:
15
16 virtual ~Resolver() = 0;
17
21 virtual void
22 stopAsync() = 0;
23
27 virtual void
28 stop() = 0;
29
33 virtual void
34 start() = 0;
35
42 template <class Handler>
43 void
44 resolve(std::vector<std::string> const& names, Handler handler)
45 {
46 resolve(names, HandlerType(handler));
47 }
48
49 virtual void
50 resolve(std::vector<std::string> const& names, HandlerType const& handler) = 0;
52};
53
54} // namespace xrpl
std::function< void(std::string, std::vector< beast::ip::Endpoint >)> HandlerType
Definition Resolver.h:14
virtual ~Resolver()=0
virtual void start()=0
Issue a synchronous start request.
void resolve(std::vector< std::string > const &names, Handler handler)
resolve all hostnames on the list
Definition Resolver.h:44
virtual void resolve(std::vector< std::string > const &names, HandlerType const &handler)=0
virtual void stopAsync()=0
Issue an asynchronous stop request.
virtual void stop()=0
Issue a synchronous stop request.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5