blob: 0d0b662b778fb38d5a463026d89401b66faf66f0 [file] [log] [blame]
#ifndef NLSR_ROUTING_TABLE_ENTRY_HPP
#define NLSR_ROUTING_TABLE_ENTRY_HPP
#include <iostream>
#include "nexthop-list.hpp"
namespace nlsr {
class RoutingTableEntry
{
public:
RoutingTableEntry()
{
}
~RoutingTableEntry()
{
}
RoutingTableEntry(const std::string& dest)
{
m_destination = dest;
}
std::string
getDestination()
{
return m_destination;
}
NexthopList&
getNexthopList()
{
return m_nexthopList;
}
private:
std::string m_destination;
NexthopList m_nexthopList;
};
inline std::ostream&
operator<<(std::ostream& os, RoutingTableEntry& rte)
{
os << "Destination: " << rte.getDestination() << std::endl;
os << "Nexthops: " << std::endl;
int32_t i = 1;
std::list<NextHop> nhl = rte.getNexthopList().getNextHops();
for (std::list<NextHop>::iterator it = nhl.begin();
it != nhl.end() ; it++, i++)
{
os << " Nexthop " << i << ": " << (*it) << std::endl;
}
return os;
}
} //namespace nlsr
#endif //NLSR_ROUTING_TABLE_ENTRY_HPP