akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 1 | #ifndef NLSR_MAP_ENTRY_HPP |
| 2 | #define NLSR_MAP_ENTRY_HPP |
| 3 | |
| 4 | #include <boost/cstdint.hpp> |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 5 | #include <ndn-cxx/name.hpp> |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 6 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 7 | namespace nlsr { |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 8 | |
| 9 | class MapEntry |
| 10 | { |
| 11 | public: |
| 12 | MapEntry() |
| 13 | : m_router() |
| 14 | , m_mappingNumber(-1) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | ~MapEntry() |
| 19 | { |
| 20 | } |
| 21 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 22 | MapEntry(const ndn::Name& rtr, int32_t mn) |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 23 | { |
| 24 | m_router = rtr; |
| 25 | m_mappingNumber = mn; |
| 26 | } |
| 27 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 28 | const ndn::Name& |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 29 | getRouter() const |
| 30 | { |
| 31 | return m_router; |
| 32 | } |
| 33 | |
| 34 | int32_t |
| 35 | getMappingNumber() const |
| 36 | { |
| 37 | return m_mappingNumber; |
| 38 | } |
| 39 | |
| 40 | private: |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 41 | ndn::Name m_router; |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 42 | int32_t m_mappingNumber; |
| 43 | }; |
| 44 | |
| 45 | inline std::ostream& |
| 46 | operator<<(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 |