blob: b42d39671981fb8b94b89fd7e0a4bb705c2260cf [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);
void
writeLog();
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