blob: f2ba05d4d6a02877daf5c621e513ac4a8d3ea939 [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014 University of Memphis,
4 * Regents of the University of California
5 *
6 * This file is part of NLSR (Named-data Link State Routing).
7 * See AUTHORS.md for complete list of NLSR authors and contributors.
8 *
9 * NLSR is free software: you can redistribute it and/or modify it under the terms
10 * of the GNU General Public License as published by the Free Software Foundation,
11 * either version 3 of the License, or (at your option) any later version.
12 *
13 * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
14 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * \author A K M Mahmudul Hoque <ahoque1@memphis.edu>
21 *
22 **/
akmhoquefdbddb12014-05-02 18:35:19 -050023#ifndef NLSR_MAP_ENTRY_HPP
24#define NLSR_MAP_ENTRY_HPP
25
26#include <boost/cstdint.hpp>
akmhoque31d1d4b2014-05-05 22:08:14 -050027#include <ndn-cxx/name.hpp>
akmhoquefdbddb12014-05-02 18:35:19 -050028
akmhoque31d1d4b2014-05-05 22:08:14 -050029namespace nlsr {
akmhoquefdbddb12014-05-02 18:35:19 -050030
31class MapEntry
32{
33public:
34 MapEntry()
35 : m_router()
36 , m_mappingNumber(-1)
37 {
38 }
39
40 ~MapEntry()
41 {
42 }
43
akmhoque31d1d4b2014-05-05 22:08:14 -050044 MapEntry(const ndn::Name& rtr, int32_t mn)
akmhoquefdbddb12014-05-02 18:35:19 -050045 {
46 m_router = rtr;
47 m_mappingNumber = mn;
48 }
49
akmhoque31d1d4b2014-05-05 22:08:14 -050050 const ndn::Name&
akmhoquefdbddb12014-05-02 18:35:19 -050051 getRouter() const
52 {
53 return m_router;
54 }
55
56 int32_t
57 getMappingNumber() const
58 {
59 return m_mappingNumber;
60 }
61
62private:
akmhoque31d1d4b2014-05-05 22:08:14 -050063 ndn::Name m_router;
akmhoquefdbddb12014-05-02 18:35:19 -050064 int32_t m_mappingNumber;
65};
66
67inline std::ostream&
68operator<<(std::ostream& os, const MapEntry& mpe)
69{
70 os << "MapEntry: ( Router: " << mpe.getRouter() << " Mapping No: ";
71 os << mpe.getMappingNumber() << " )" << std::endl;
72 return os;
73}
74
75} // namespace nlsr
76
77#endif // NLSR_MAP_ENTRY_HPP