blob: 77f0801e4969ae5a5ebb3ce80303184fc55b3d31 [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Nick Gordonc6a85222017-01-03 16:54:34 -06003 * Copyright (c) 2014-2017, The University of Memphis,
alvy297f4162015-03-03 17:15:33 -06004 * Regents of the University of California,
5 * Arizona Board of Regents.
akmhoque3d06e792014-05-27 16:23:20 -05006 *
7 * This file is part of NLSR (Named-data Link State Routing).
8 * See AUTHORS.md for complete list of NLSR authors and contributors.
9 *
10 * NLSR is free software: you can redistribute it and/or modify it under the terms
11 * of the GNU General Public License as published by the Free Software Foundation,
12 * either version 3 of the License, or (at your option) any later version.
13 *
14 * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
akmhoque3d06e792014-05-27 16:23:20 -050020 **/
alvy297f4162015-03-03 17:15:33 -060021
akmhoquefdbddb12014-05-02 18:35:19 -050022#ifndef NLSR_NAME_PREFIX_LIST_HPP
23#define NLSR_NAME_PREFIX_LIST_HPP
akmhoque53353462014-04-22 08:43:45 -050024
25#include <list>
26#include <string>
akmhoquefdbddb12014-05-02 18:35:19 -050027#include <boost/cstdint.hpp>
akmhoque31d1d4b2014-05-05 22:08:14 -050028#include <ndn-cxx/name.hpp>
akmhoquec8a10f72014-04-25 18:42:55 -050029
akmhoque53353462014-04-22 08:43:45 -050030
31namespace nlsr {
akmhoquec8a10f72014-04-25 18:42:55 -050032class NamePrefixList
akmhoque53353462014-04-22 08:43:45 -050033{
34
35public:
akmhoquec8a10f72014-04-25 18:42:55 -050036 NamePrefixList();
akmhoque53353462014-04-22 08:43:45 -050037
akmhoquec8a10f72014-04-25 18:42:55 -050038 ~NamePrefixList();
akmhoque53353462014-04-22 08:43:45 -050039
Nick G97e34942016-07-11 14:46:27 -050040 /*! \brief inserts name into NamePrefixList
41 \retval true If the name was successfully inserted.
42 \retval false If the name could not be inserted.
alvy297f4162015-03-03 17:15:33 -060043 */
44 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050045 insert(const ndn::Name& name);
akmhoque53353462014-04-22 08:43:45 -050046
Nick G97e34942016-07-11 14:46:27 -050047 /*! \brief removes name from NamePrefixList
48 \retval true If the name is removed
49 \retval false If the name failed to be removed.
alvy297f4162015-03-03 17:15:33 -060050 */
51 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050052 remove(const ndn::Name& name);
akmhoque53353462014-04-22 08:43:45 -050053
54 void
55 sort();
56
akmhoque31d1d4b2014-05-05 22:08:14 -050057 size_t
akmhoque53353462014-04-22 08:43:45 -050058 getSize()
59 {
60 return m_nameList.size();
61 }
62
akmhoque31d1d4b2014-05-05 22:08:14 -050063 std::list<ndn::Name>&
akmhoque53353462014-04-22 08:43:45 -050064 getNameList()
65 {
66 return m_nameList;
67 }
68
69 void
akmhoque674b0b12014-05-20 14:33:28 -050070 writeLog();
71
akmhoque53353462014-04-22 08:43:45 -050072private:
akmhoque31d1d4b2014-05-05 22:08:14 -050073 std::list<ndn::Name> m_nameList;
akmhoque53353462014-04-22 08:43:45 -050074
75};
76
Nick Gordonfad8e252016-08-11 14:21:38 -050077} // namespace nlsr
akmhoque53353462014-04-22 08:43:45 -050078
akmhoquefdbddb12014-05-02 18:35:19 -050079#endif //NLSR_NAME_PREFIX_LIST_HPP