HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Junxiao Shi | 4370fde | 2016-02-24 12:20:46 -0700 | [diff] [blame] | 3 | * Copyright (c) 2014-2016, Regents of the University of California, |
Alexander Afanasyev | 319f2c8 | 2015-01-07 14:56:53 -0800 | [diff] [blame] | 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis. |
Alexander Afanasyev | 9bcbc7c | 2014-04-06 19:37:37 -0700 | [diff] [blame] | 10 | * |
| 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 13 | * |
| 14 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Junxiao Shi | ee5a444 | 2014-07-27 17:13:43 -0700 | [diff] [blame] | 24 | */ |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 25 | |
Alexander Afanasyev | 613e2a9 | 2014-04-15 13:36:58 -0700 | [diff] [blame] | 26 | #ifndef NFD_DAEMON_TABLE_NAME_TREE_HPP |
| 27 | #define NFD_DAEMON_TABLE_NAME_TREE_HPP |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 28 | |
Junxiao Shi | 029401f | 2016-08-05 12:55:14 +0000 | [diff] [blame^] | 29 | #include "name-tree-iterator.hpp" |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 30 | |
| 31 | namespace nfd { |
| 32 | namespace name_tree { |
| 33 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 34 | /** \brief Compute the hash value of the given name prefix's WIRE FORMAT |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 35 | */ |
Haowei Yuan | f52dac7 | 2014-03-24 23:35:03 -0500 | [diff] [blame] | 36 | size_t |
| 37 | computeHash(const Name& prefix); |
| 38 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 39 | /** \brief Incrementally compute hash values |
| 40 | * \return Return a vector of hash values, starting from the root prefix |
Haowei Yuan | f52dac7 | 2014-03-24 23:35:03 -0500 | [diff] [blame] | 41 | */ |
| 42 | std::vector<size_t> |
| 43 | computeHashSet(const Name& prefix); |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 44 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 45 | /** \brief shared name-based index for FIB, PIT, Measurements, and StrategyChoice |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 46 | */ |
| 47 | class NameTree : noncopyable |
| 48 | { |
| 49 | public: |
Junxiao Shi | 029401f | 2016-08-05 12:55:14 +0000 | [diff] [blame^] | 50 | typedef Iterator const_iterator; |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 51 | |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 52 | explicit |
Haowei Yuan | f52dac7 | 2014-03-24 23:35:03 -0500 | [diff] [blame] | 53 | NameTree(size_t nBuckets = 1024); |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 54 | |
| 55 | ~NameTree(); |
| 56 | |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 57 | public: // information |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 58 | /** \brief Get the number of occupied entries in the Name Tree |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 59 | */ |
| 60 | size_t |
| 61 | size() const; |
| 62 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 63 | /** \brief Get the number of buckets in the Name Tree (NPHT) |
| 64 | * |
| 65 | * The number of buckets is the one that used to create the hash |
| 66 | * table, i.e., m_nBuckets. |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 67 | */ |
| 68 | size_t |
| 69 | getNBuckets() const; |
| 70 | |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 71 | /** \return Name Tree Entry on which a table entry is attached |
| 72 | */ |
| 73 | template<typename ENTRY> |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 74 | shared_ptr<Entry> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 75 | getEntry(const ENTRY& tableEntry) const; |
| 76 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 77 | /** \brief Dump all the information stored in the Name Tree for debugging. |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 78 | */ |
| 79 | void |
| 80 | dump(std::ostream& output) const; |
| 81 | |
| 82 | public: // mutation |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 83 | /** \brief Look for the Name Tree Entry that contains this name prefix. |
| 84 | * |
| 85 | * Starts from the shortest name prefix, and then increase the |
| 86 | * number of name components by one each time. All non-existing Name Tree |
| 87 | * Entries will be created. |
| 88 | * |
| 89 | * \param prefix The querying name prefix. |
| 90 | * \return The pointer to the Name Tree Entry that contains this full name prefix. |
| 91 | * \note Existing iterators are unaffected. |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 92 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 93 | shared_ptr<Entry> |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 94 | lookup(const Name& prefix); |
| 95 | |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 96 | /** \brief get NameTree entry from FIB entry |
| 97 | * |
| 98 | * This is equivalent to .lookup(fibEntry.getPrefix()) |
| 99 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 100 | shared_ptr<Entry> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 101 | lookup(const fib::Entry& fibEntry) const; |
| 102 | |
| 103 | /** \brief get NameTree entry from PIT entry |
| 104 | * |
| 105 | * This is equivalent to .lookup(pitEntry.getName()). |
| 106 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 107 | shared_ptr<Entry> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 108 | lookup(const pit::Entry& pitEntry); |
| 109 | |
| 110 | /** \brief get NameTree entry from Measurements entry |
| 111 | * |
| 112 | * This is equivalent to .lookup(measurementsEntry.getName()) |
| 113 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 114 | shared_ptr<Entry> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 115 | lookup(const measurements::Entry& measurementsEntry) const; |
| 116 | |
| 117 | /** \brief get NameTree entry from StrategyChoice entry |
| 118 | * |
| 119 | * This is equivalent to .lookup(strategyChoiceEntry.getName()) |
| 120 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 121 | shared_ptr<Entry> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 122 | lookup(const strategy_choice::Entry& strategyChoiceEntry) const; |
| 123 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 124 | /** \brief Delete a Name Tree Entry if this entry is empty. |
| 125 | * \param entry The entry to be deleted if empty. |
| 126 | * \note This function must be called after a table entry is detached from Name Tree |
| 127 | * entry. The function deletes a Name Tree entry if nothing is attached to it and |
| 128 | * it has no children, then repeats the same process on its ancestors. |
| 129 | * \note Existing iterators, except those pointing to deleted entries, are unaffected. |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 130 | */ |
| 131 | bool |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 132 | eraseEntryIfEmpty(shared_ptr<Entry> entry); |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 133 | |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 134 | public: // matching |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 135 | /** \brief Exact match lookup for the given name prefix. |
| 136 | * \return nullptr if this prefix is not found; otherwise return the Name Tree Entry address |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 137 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 138 | shared_ptr<Entry> |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 139 | findExactMatch(const Name& prefix) const; |
| 140 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 141 | /** \brief Longest prefix matching for the given name |
| 142 | * |
| 143 | * Starts from the full name string, reduce the number of name component |
| 144 | * by one each time, until an Entry is found. |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 145 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 146 | shared_ptr<Entry> |
Junxiao Shi | 4063184 | 2014-03-01 13:52:37 -0700 | [diff] [blame] | 147 | findLongestPrefixMatch(const Name& prefix, |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 148 | const EntrySelector& entrySelector = AnyEntry()) const; |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 149 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 150 | shared_ptr<Entry> |
| 151 | findLongestPrefixMatch(shared_ptr<Entry> entry, |
| 152 | const EntrySelector& entrySelector = AnyEntry()) const; |
HangZhang | cb4fc83 | 2014-03-11 16:57:11 +0800 | [diff] [blame] | 153 | |
Junxiao Shi | 4370fde | 2016-02-24 12:20:46 -0700 | [diff] [blame] | 154 | /** \brief longest prefix matching for Interest name of the PIT entry |
| 155 | * |
| 156 | * This is equivalent to .findLongestPrefixMatch(pitEntry.getName(), AnyEntry()). |
| 157 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 158 | shared_ptr<Entry> |
Junxiao Shi | 4370fde | 2016-02-24 12:20:46 -0700 | [diff] [blame] | 159 | findLongestPrefixMatch(const pit::Entry& pitEntry) const; |
| 160 | |
Junxiao Shi | 2b73ca3 | 2014-11-17 19:16:08 -0700 | [diff] [blame] | 161 | /** \brief Enumerate all the name prefixes that satisfy the prefix and entrySelector |
| 162 | * \return an unspecified type that have .begin() and .end() methods |
| 163 | * and is usable with range-based for |
| 164 | * |
| 165 | * Example: |
| 166 | * \code{.cpp} |
| 167 | * auto&& allMatches = nt.findAllMatches(Name("/A/B/C")); |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 168 | * for (const Entry& nte : allMatches) { |
Junxiao Shi | 2b73ca3 | 2014-11-17 19:16:08 -0700 | [diff] [blame] | 169 | * ... |
| 170 | * } |
| 171 | * \endcode |
Alexander Afanasyev | 09fc3d9 | 2015-01-03 02:02:37 -0800 | [diff] [blame] | 172 | * \note Iteration order is implementation-specific and is undefined |
| 173 | * \note The returned iterator may get invalidated when NameTree is modified |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 174 | */ |
Junxiao Shi | 5ccd0c2 | 2014-12-02 23:54:42 -0700 | [diff] [blame] | 175 | boost::iterator_range<const_iterator> |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 176 | findAllMatches(const Name& prefix, |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 177 | const EntrySelector& entrySelector = AnyEntry()) const; |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 178 | |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 179 | public: // enumeration |
Junxiao Shi | 60607c7 | 2014-11-26 22:40:36 -0700 | [diff] [blame] | 180 | /** \brief Enumerate all entries, optionally filtered by an EntrySelector. |
| 181 | * \return an unspecified type that have .begin() and .end() methods |
| 182 | * and is usable with range-based for |
| 183 | * |
| 184 | * Example: |
| 185 | * \code{.cpp} |
| 186 | * auto&& enumerable = nt.fullEnumerate(); |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 187 | * for (const Entry& nte : enumerable) { |
Junxiao Shi | 60607c7 | 2014-11-26 22:40:36 -0700 | [diff] [blame] | 188 | * ... |
| 189 | * } |
| 190 | * \endcode |
Alexander Afanasyev | 09fc3d9 | 2015-01-03 02:02:37 -0800 | [diff] [blame] | 191 | * \note Iteration order is implementation-specific and is undefined |
| 192 | * \note The returned iterator may get invalidated when NameTree is modified |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 193 | */ |
Junxiao Shi | 5ccd0c2 | 2014-12-02 23:54:42 -0700 | [diff] [blame] | 194 | boost::iterator_range<const_iterator> |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 195 | fullEnumerate(const EntrySelector& entrySelector = AnyEntry()) const; |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 196 | |
Junxiao Shi | 60607c7 | 2014-11-26 22:40:36 -0700 | [diff] [blame] | 197 | /** \brief Enumerate all entries under a prefix, optionally filtered by an EntrySubTreeSelector. |
| 198 | * \return an unspecified type that have .begin() and .end() methods |
| 199 | * and is usable with range-based for |
| 200 | * |
| 201 | * Example: |
| 202 | * \code{.cpp} |
| 203 | * auto&& enumerable = nt.partialEnumerate(Name("/A/B/C")); |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 204 | * for (const Entry& nte : enumerable) { |
Junxiao Shi | 60607c7 | 2014-11-26 22:40:36 -0700 | [diff] [blame] | 205 | * ... |
| 206 | * } |
| 207 | * \endcode |
Alexander Afanasyev | 09fc3d9 | 2015-01-03 02:02:37 -0800 | [diff] [blame] | 208 | * \note Iteration order is implementation-specific and is undefined |
| 209 | * \note The returned iterator may get invalidated when NameTree is modified |
Junxiao Shi | 60607c7 | 2014-11-26 22:40:36 -0700 | [diff] [blame] | 210 | */ |
Junxiao Shi | 5ccd0c2 | 2014-12-02 23:54:42 -0700 | [diff] [blame] | 211 | boost::iterator_range<const_iterator> |
Junxiao Shi | 4063184 | 2014-03-01 13:52:37 -0700 | [diff] [blame] | 212 | partialEnumerate(const Name& prefix, |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 213 | const EntrySubTreeSelector& entrySubTreeSelector = AnyEntrySubTree()) const; |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 214 | |
Alexander Afanasyev | 09fc3d9 | 2015-01-03 02:02:37 -0800 | [diff] [blame] | 215 | /** \brief Get an iterator pointing to the first NameTree entry |
| 216 | * \note Iteration order is implementation-specific and is undefined |
| 217 | * \note The returned iterator may get invalidated when NameTree is modified |
| 218 | */ |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 219 | const_iterator |
| 220 | begin() const; |
| 221 | |
Alexander Afanasyev | 09fc3d9 | 2015-01-03 02:02:37 -0800 | [diff] [blame] | 222 | /** \brief Get an iterator referring to the past-the-end FIB entry |
| 223 | * \note Iteration order is implementation-specific and is undefined |
| 224 | * \note The returned iterator may get invalidated when NameTree is modified |
| 225 | */ |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 226 | const_iterator |
| 227 | end() const; |
| 228 | |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 229 | private: |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 230 | /** \brief Create a Name Tree Entry if it does not exist, or return the existing |
| 231 | * Name Tree Entry address. |
| 232 | * |
| 233 | * Called by lookup() only. |
| 234 | * |
| 235 | * \return The first item is the Name Tree Entry address, the second item is |
| 236 | * a bool value indicates whether this is an old entry (false) or a new |
| 237 | * entry (true). |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 238 | */ |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 239 | std::pair<shared_ptr<Entry>, bool> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 240 | insert(const Name& prefix); |
| 241 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 242 | /** \brief Resize the hash table size when its load factor reaches a threshold. |
| 243 | * |
| 244 | * As we are currently using a hand-written hash table implementation |
| 245 | * for the Name Tree, the hash table resize() function should be kept in the |
| 246 | * name-tree.hpp file. |
| 247 | * \param newNBuckets The number of buckets for the new hash table. |
Alexander Afanasyev | b303324 | 2014-08-04 11:09:05 -0700 | [diff] [blame] | 248 | */ |
| 249 | void |
| 250 | resize(size_t newNBuckets); |
| 251 | |
| 252 | private: |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 253 | size_t m_nItems; ///< Number of items being stored |
| 254 | size_t m_nBuckets; ///< Number of hash buckets |
| 255 | size_t m_minNBuckets; ///< Minimum number of hash buckets |
| 256 | double m_enlargeLoadFactor; |
| 257 | size_t m_enlargeThreshold; |
| 258 | int m_enlargeFactor; |
| 259 | double m_shrinkLoadFactor; |
| 260 | size_t m_shrinkThreshold; |
| 261 | double m_shrinkFactor; |
| 262 | Node** m_buckets; ///< Name Tree Buckets in the NPHT |
Junxiao Shi | 029401f | 2016-08-05 12:55:14 +0000 | [diff] [blame^] | 263 | |
| 264 | friend class FullEnumerationImpl; |
| 265 | friend class PartialEnumerationImpl; |
| 266 | friend class PrefixMatchImpl; |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 267 | }; |
| 268 | |
| 269 | inline size_t |
| 270 | NameTree::size() const |
| 271 | { |
| 272 | return m_nItems; |
| 273 | } |
| 274 | |
| 275 | inline size_t |
| 276 | NameTree::getNBuckets() const |
| 277 | { |
| 278 | return m_nBuckets; |
| 279 | } |
| 280 | |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 281 | template<typename ENTRY> |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 282 | inline shared_ptr<Entry> |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 283 | NameTree::getEntry(const ENTRY& tableEntry) const |
HangZhang | cb4fc83 | 2014-03-11 16:57:11 +0800 | [diff] [blame] | 284 | { |
Junxiao Shi | b184e53 | 2016-05-26 18:09:57 +0000 | [diff] [blame] | 285 | return tableEntry.m_nameTreeEntry.lock(); |
HangZhang | cb4fc83 | 2014-03-11 16:57:11 +0800 | [diff] [blame] | 286 | } |
| 287 | |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 288 | inline NameTree::const_iterator |
| 289 | NameTree::begin() const |
| 290 | { |
Junxiao Shi | 60607c7 | 2014-11-26 22:40:36 -0700 | [diff] [blame] | 291 | return fullEnumerate().begin(); |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | inline NameTree::const_iterator |
| 295 | NameTree::end() const |
| 296 | { |
Junxiao Shi | 029401f | 2016-08-05 12:55:14 +0000 | [diff] [blame^] | 297 | return Iterator(); |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 298 | } |
| 299 | |
Junxiao Shi | 2570f3e | 2016-07-27 02:48:29 +0000 | [diff] [blame] | 300 | } // namespace name_tree |
| 301 | |
| 302 | using name_tree::NameTree; |
| 303 | |
HYuan | a9b8575 | 2014-02-26 02:32:30 -0600 | [diff] [blame] | 304 | } // namespace nfd |
| 305 | |
Alexander Afanasyev | 613e2a9 | 2014-04-15 13:36:58 -0700 | [diff] [blame] | 306 | #endif // NFD_DAEMON_TABLE_NAME_TREE_HPP |