blob: ab507d7a652010b1f0910d8277bcab70c2ca7f86 [file] [log] [blame]
#ifndef NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
#define NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
#include <list>
#include <utility>
#include <boost/cstdint.hpp>
#include "routing-table-entry.hpp"
namespace nlsr {
class NamePrefixTableEntry
{
public:
NamePrefixTableEntry()
{
}
NamePrefixTableEntry(const ndn::Name& namePrefix)
: m_namePrefix(namePrefix)
, m_nexthopList()
{
}
const ndn::Name&
getNamePrefix() const
{
return m_namePrefix;
}
std::list<RoutingTableEntry>&
getRteList()
{
return m_rteList;
}
void
resetRteListNextHop()
{
if (m_rteList.size() > 0)
{
for (std::list<RoutingTableEntry>::iterator it = m_rteList.begin();
it != m_rteList.end(); ++it)
{
(*it).getNexthopList().reset();
}
}
}
size_t
getRteListSize()
{
return m_rteList.size();
}
NexthopList&
getNexthopList()
{
return m_nexthopList;
}
void
generateNhlfromRteList();
void
removeRoutingTableEntry(RoutingTableEntry& rte);
void
addRoutingTableEntry(RoutingTableEntry& rte);
private:
ndn::Name m_namePrefix;
std::list<RoutingTableEntry> m_rteList;
NexthopList m_nexthopList;
};
std::ostream&
operator<<(std::ostream& os, NamePrefixTableEntry& npte);
}//namespace nlsr
#endif //NLSR_NAME_PREFIX_TABLE_ENTRY_HPP