blob: 0c541454e5644dbe4b4472e5452fb9080b7e4cb6 [file] [log] [blame]
akmhoquefdbddb12014-05-02 18:35:19 -05001#ifndef NLSR_MAP_ENTRY_HPP
2#define NLSR_MAP_ENTRY_HPP
3
4#include <boost/cstdint.hpp>
akmhoque31d1d4b2014-05-05 22:08:14 -05005#include <ndn-cxx/name.hpp>
akmhoquefdbddb12014-05-02 18:35:19 -05006
akmhoque31d1d4b2014-05-05 22:08:14 -05007namespace nlsr {
akmhoquefdbddb12014-05-02 18:35:19 -05008
9class MapEntry
10{
11public:
12 MapEntry()
13 : m_router()
14 , m_mappingNumber(-1)
15 {
16 }
17
18 ~MapEntry()
19 {
20 }
21
akmhoque31d1d4b2014-05-05 22:08:14 -050022 MapEntry(const ndn::Name& rtr, int32_t mn)
akmhoquefdbddb12014-05-02 18:35:19 -050023 {
24 m_router = rtr;
25 m_mappingNumber = mn;
26 }
27
akmhoque31d1d4b2014-05-05 22:08:14 -050028 const ndn::Name&
akmhoquefdbddb12014-05-02 18:35:19 -050029 getRouter() const
30 {
31 return m_router;
32 }
33
34 int32_t
35 getMappingNumber() const
36 {
37 return m_mappingNumber;
38 }
39
40private:
akmhoque31d1d4b2014-05-05 22:08:14 -050041 ndn::Name m_router;
akmhoquefdbddb12014-05-02 18:35:19 -050042 int32_t m_mappingNumber;
43};
44
45inline std::ostream&
46operator<<(std::ostream& os, const MapEntry& mpe)
47{
48 os << "MapEntry: ( Router: " << mpe.getRouter() << " Mapping No: ";
49 os << mpe.getMappingNumber() << " )" << std::endl;
50 return os;
51}
52
53} // namespace nlsr
54
55#endif // NLSR_MAP_ENTRY_HPP