rippled
Loading...
Searching...
No Matches
SourceStrings.cpp
1#include <xrpld/peerfinder/detail/SourceStrings.h>
2
3namespace ripple {
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 {
31 if (is_unspecified(ep))
33 if (!is_unspecified(ep))
34 results.addresses.push_back(ep);
35 }
36 }
37
38private:
41};
42
43//------------------------------------------------------------------------------
44
46SourceStrings::New(std::string const& name, Strings const& strings)
47{
49}
50
51} // namespace PeerFinder
52} // namespace ripple
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