rippled
Loading...
Searching...
No Matches
SourceStrings.cpp
1#include <xrpld/peerfinder/detail/SourceStrings.h>
2
3namespace xrpl {
4namespace PeerFinder {
5
7{
8public:
9 SourceStringsImp(std::string const& name, Strings const& strings)
10 : m_name(name), m_strings(strings)
11 {
12 }
13
14 ~SourceStringsImp() = default;
15
16 std::string const&
17 name() override
18 {
19 return m_name;
20 }
21
22 void
23 fetch(Results& results, beast::Journal journal) override
24 {
25 results.addresses.resize(0);
27 for (int i = 0; i < m_strings.size(); ++i)
28 {
30 if (is_unspecified(ep))
32 if (!is_unspecified(ep))
33 results.addresses.push_back(ep);
34 }
35 }
36
37private:
40};
41
42//------------------------------------------------------------------------------
43
45SourceStrings::New(std::string const& name, Strings const& strings)
46{
48}
49
50} // namespace PeerFinder
51} // namespace xrpl
A version-independent IP address and port combination.
Definition IPEndpoint.h:18
static Endpoint from_string(std::string const &s)
A generic endpoint for log messages.
Definition Journal.h:40
void fetch(Results &results, beast::Journal journal) override
std::string const & name() override
SourceStringsImp(std::string const &name, Strings const &strings)
Provides addresses from a static set of strings.
static std::shared_ptr< Source > New(std::string const &name, Strings const &strings)
virtual std::string const & name()=0
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
T push_back(T... args)
T reserve(T... args)
T resize(T... args)
T size(T... args)
The results of a fetch.
Definition Source.h:23