lokinet/llarp/endpoint_base.cpp
dr7ana 46ad8d4058 Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2023-10-24 12:11:51 -07:00

35 lines
679 B
C++

#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<bool(const dns::SRVData&)> filter)
{
if (util::erase_if(m_SRVRecords, filter) > 0)
{
SRVRecordsChanged();
return true;
}
return false;
}
std::set<dns::SRVData>
EndpointBase::SRVRecords() const
{
std::set<dns::SRVData> set;
set.insert(m_SRVRecords.begin(), m_SRVRecords.end());
return set;
}
} // namespace llarp