31 for (
const auto& name : names) {
39 auto& sources = m_namesSources[name];
40 return sources.insert(source).second;
46 auto it = m_namesSources.find(name);
47 if (it == m_namesSources.end()) {
51 bool isRemoved = it->second.erase(source);
52 if (it->second.empty()) {
53 m_namesSources.erase(it);
61 std::list<ndn::Name> names;
62 for (
const auto& [name, sources] : m_namesSources) {
63 names.push_back(name);
71 NamePrefixList::getSources(
const ndn::Name& name)
const
73 if (
auto it = m_namesSources.find(name); it != m_namesSources.end()) {
84 os <<
"Name prefix list: {\n";
85 for (
const auto& [name, sources] : list.m_namesSources) {
86 os << name <<
"\nSources:\n";
87 for (
const auto& source : sources) {
88 os <<
" " << source <<
"\n";
91 os <<
"}" << std::endl;
bool erase(const ndn::Name &name, const std::string &source="")
Deletes name and source combination.
bool insert(const ndn::Name &name, const std::string &source="")
Inserts name and source combination.
std::list< ndn::Name > getNames() const
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)