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> |
| 5 | |
| 6 | namespace nlsr{ |
| 7 | |
| 8 | class MapEntry |
| 9 | { |
| 10 | public: |
| 11 | MapEntry() |
| 12 | : m_router() |
| 13 | , m_mappingNumber(-1) |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | ~MapEntry() |
| 18 | { |
| 19 | } |
| 20 | |
| 21 | MapEntry(const std::string& rtr, int32_t mn) |
| 22 | { |
| 23 | m_router = rtr; |
| 24 | m_mappingNumber = mn; |
| 25 | } |
| 26 | |
| 27 | const std::string& |
| 28 | getRouter() const |
| 29 | { |
| 30 | return m_router; |
| 31 | } |
| 32 | |
| 33 | int32_t |
| 34 | getMappingNumber() const |
| 35 | { |
| 36 | return m_mappingNumber; |
| 37 | } |
| 38 | |
| 39 | private: |
| 40 | std::string m_router; |
| 41 | int32_t m_mappingNumber; |
| 42 | }; |
| 43 | |
| 44 | inline std::ostream& |
| 45 | operator<<(std::ostream& os, const MapEntry& mpe) |
| 46 | { |
| 47 | os << "MapEntry: ( Router: " << mpe.getRouter() << " Mapping No: "; |
| 48 | os << mpe.getMappingNumber() << " )" << std::endl; |
| 49 | return os; |
| 50 | } |
| 51 | |
| 52 | } // namespace nlsr |
| 53 | |
| 54 | #endif // NLSR_MAP_ENTRY_HPP |