nlsr::NamePrefixList Class Reference

#include <name-prefix-list.hpp>

Public Types

using NamePair = std::tuple< ndn::Name, std::vector< std::string > >
 
enum  NamePairIndex {
  NAME,
  SOURCES
}
 

Public Member Functions

 NamePrefixList ()
 
 NamePrefixList (const std::initializer_list< ndn::Name > &names)
 
 NamePrefixList (const std::initializer_list< NamePrefixList::NamePair > &namesAndSources)
 
 ~NamePrefixList ()
 
void clear ()
 
uint32_t countSources (const ndn::Name &name) const
 
std::list< ndn::Name > getNames () const
 
const std::vector< std::string > getSources (const ndn::Name &name) const
 
bool insert (const ndn::Name &name, const std::string &source="")
 inserts name into NamePrefixList More...
 
bool operator== (const NamePrefixList &other) const
 
bool remove (const ndn::Name &name, const std::string &source="")
 removes name from NamePrefixList More...
 
size_t size () const
 
void sort ()
 

Detailed Description

Definition at line 33 of file name-prefix-list.hpp.

Member Typedef Documentation

◆ NamePair

using nlsr::NamePrefixList::NamePair = std::tuple<ndn::Name, std::vector<std::string> >

Definition at line 36 of file name-prefix-list.hpp.

Member Enumeration Documentation

◆ NamePairIndex

Enumerator
NAME 
SOURCES 

Definition at line 37 of file name-prefix-list.hpp.

Constructor & Destructor Documentation

◆ NamePrefixList() [1/3]

nlsr::NamePrefixList::NamePrefixList ( )
default

◆ NamePrefixList() [2/3]

nlsr::NamePrefixList::NamePrefixList ( const std::initializer_list< ndn::Name > &  names)

Definition at line 29 of file name-prefix-list.cpp.

◆ NamePrefixList() [3/3]

nlsr::NamePrefixList::NamePrefixList ( const std::initializer_list< NamePrefixList::NamePair > &  namesAndSources)

Definition at line 39 of file name-prefix-list.cpp.

◆ ~NamePrefixList()

nlsr::NamePrefixList::~NamePrefixList ( )

Definition at line 44 of file name-prefix-list.cpp.

Member Function Documentation

◆ clear()

void nlsr::NamePrefixList::clear ( )
inline

Definition at line 105 of file name-prefix-list.hpp.

+ Here is the call graph for this function:

◆ countSources()

uint32_t nlsr::NamePrefixList::countSources ( const ndn::Name &  name) const

Returns how many unique sources this name has.

Return values
0if the name is not in the list, else the number of sources.

Definition at line 128 of file name-prefix-list.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNames()

std::list< ndn::Name > nlsr::NamePrefixList::getNames ( ) const

Definition at line 118 of file name-prefix-list.cpp.

+ Here is the caller graph for this function:

◆ getSources()

const std::vector< std::string > nlsr::NamePrefixList::getSources ( const ndn::Name &  name) const

Returns the sources that this name has.

Return values
anempty vector if the name is not in the list, else a vector containing the sources.

Definition at line 134 of file name-prefix-list.cpp.

+ Here is the caller graph for this function:

◆ insert()

bool nlsr::NamePrefixList::insert ( const ndn::Name &  name,
const std::string &  source = "" 
)

inserts name into NamePrefixList

Return values
trueIf the name was successfully inserted.
falseIf the name could not be inserted.

Definition at line 68 of file name-prefix-list.cpp.

+ Here is the caller graph for this function:

◆ operator==()

bool nlsr::NamePrefixList::operator== ( const NamePrefixList other) const

Definition at line 106 of file name-prefix-list.cpp.

+ Here is the caller graph for this function:

◆ remove()

bool nlsr::NamePrefixList::remove ( const ndn::Name &  name,
const std::string &  source = "" 
)

removes name from NamePrefixList

Return values
trueIf the name is removed
falseIf the name failed to be removed.

Definition at line 88 of file name-prefix-list.cpp.

+ Here is the caller graph for this function:

◆ size()

size_t nlsr::NamePrefixList::size ( ) const
inline

Definition at line 78 of file name-prefix-list.hpp.

+ Here is the call graph for this function:

◆ sort()

void nlsr::NamePrefixList::sort ( )

Definition at line 112 of file name-prefix-list.cpp.

+ Here is the caller graph for this function: