nlsr::NamePrefixList Class Reference

#include <name-prefix-list.hpp>

Public Types

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

Public Member Functions

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

Detailed Description

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

Member Typedef Documentation

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

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

Member Enumeration Documentation

Enumerator
NAME 
SOURCES 

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

Constructor & Destructor Documentation

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

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

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

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

template<class ContainerType >
nlsr::NamePrefixList::NamePrefixList ( const ContainerType &  names)
inline

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

Here is the call graph for this function:

nlsr::NamePrefixList::~NamePrefixList ( )

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

Here is the caller graph for this function:

Member Function Documentation

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 131 of file name-prefix-list.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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 137 of file name-prefix-list.cpp.

Here is the caller graph for this function:

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 71 of file name-prefix-list.cpp.

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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 91 of file name-prefix-list.cpp.

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

void nlsr::NamePrefixList::sort ( )

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

Here is the caller graph for this function: