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) : m_name(name), m_strings(strings)
10 {
11 }
12
13 ~SourceStringsImp() = default;
14
15 std::string const&
16 name() override
17 {
18 return m_name;
19 }
20
21 void
22 fetch(Results& results, beast::Journal journal) override
23 {
24 results.addresses.resize(0);
26 for (int i = 0; i < m_strings.size(); ++i)
27 {
29 if (is_unspecified(ep))
31 if (!is_unspecified(ep))
32 results.addresses.push_back(ep);
33 }
34 }
35
36private:
39};
40
41//------------------------------------------------------------------------------
42
44SourceStrings::New(std::string const& name, Strings const& strings)
45{
47}
48
49} // namespace PeerFinder
50} // namespace xrpl
A version-independent IP address and port combination.
Definition IPEndpoint.h:19
static Endpoint from_string(std::string const &s)
A generic endpoint for log messages.
Definition Journal.h:41
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:6
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:24