From 2fa24b5eae69f2fe95d7c794d7a4e25584282e86 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 6 Apr 2021 10:28:05 -0400 Subject: [PATCH] add untracked file --- llarp/endpoint_base.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 llarp/endpoint_base.cpp diff --git a/llarp/endpoint_base.cpp b/llarp/endpoint_base.cpp new file mode 100644 index 000000000..a8c687766 --- /dev/null +++ b/llarp/endpoint_base.cpp @@ -0,0 +1,34 @@ +#include "endpoint_base.hpp" + +#include "llarp/util/algorithm.hpp" + +namespace llarp +{ + void + EndpointBase::PutSRVRecord(dns::SRVData srv) + { + if (auto result = m_SRVRecords.insert(std::move(srv)); result.second) + { + SRVRecordsChanged(); + } + } + bool + EndpointBase::DelSRVRecordIf(std::function filter) + { + if (util::erase_if(m_SRVRecords, filter) > 0) + { + SRVRecordsChanged(); + return true; + } + return false; + } + + std::set + EndpointBase::SRVRecords() const + { + std::set set; + set.insert(m_SRVRecords.begin(), m_SRVRecords.end()); + return set; + } + +} // namespace llarp