Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2014, Regents of the University of California. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 7 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 8 | * |
| 9 | * This file licensed under New BSD License. See COPYING for detailed information about |
| 10 | * ndn-cxx library copyright, permissions, and redistribution restrictions. |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #ifndef NDN_SELECTORS_HPP |
| 14 | #define NDN_SELECTORS_HPP |
| 15 | |
| 16 | #include "common.hpp" |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 17 | #include "key-locator.hpp" |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 18 | #include "exclude.hpp" |
| 19 | #include "encoding/encoding-buffer.hpp" |
| 20 | |
| 21 | namespace ndn { |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 22 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 23 | /** |
| 24 | * @brief Abstraction implementing Interest selectors |
| 25 | */ |
| 26 | class Selectors |
| 27 | { |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 28 | public: |
| 29 | Selectors() |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 30 | : m_minSuffixComponents(-1) |
| 31 | , m_maxSuffixComponents(-1) |
| 32 | , m_childSelector(-1) |
| 33 | , m_mustBeFresh(false) |
| 34 | { |
| 35 | } |
| 36 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 37 | /** @deprecated Selectors().setX(...).setY(...) |
| 38 | */ |
| 39 | Selectors(int minSuffixComponents, int maxSuffixComponents, |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 40 | const Exclude& exclude, |
| 41 | int childSelector, |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 42 | bool mustBeFresh) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 43 | : m_minSuffixComponents(minSuffixComponents) |
| 44 | , m_maxSuffixComponents(maxSuffixComponents) |
| 45 | , m_exclude(exclude) |
| 46 | , m_childSelector(childSelector) |
| 47 | , m_mustBeFresh(mustBeFresh) |
| 48 | { |
| 49 | } |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 50 | |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 51 | /** |
| 52 | * @brief Create from wire encoding |
| 53 | */ |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 54 | Selectors(const Block& wire) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 55 | { |
| 56 | wireDecode(wire); |
| 57 | } |
| 58 | |
| 59 | bool |
| 60 | empty() const; |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 61 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 62 | /** |
| 63 | * @brief Fast encoding or block size estimation |
| 64 | */ |
| 65 | template<bool T> |
| 66 | size_t |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 67 | wireEncode(EncodingImpl<T>& block) const; |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 68 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 69 | /** |
| 70 | * @brief Encode to a wire format |
| 71 | */ |
| 72 | const Block& |
| 73 | wireEncode() const; |
| 74 | |
| 75 | /** |
| 76 | * @brief Decode the input from wire format |
| 77 | */ |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 78 | void |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 79 | wireDecode(const Block& wire); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 80 | |
| 81 | /////////////////////////////////////////////////////////////////////////////// |
| 82 | /////////////////////////////////////////////////////////////////////////////// |
| 83 | /////////////////////////////////////////////////////////////////////////////// |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 84 | |
| 85 | int |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 86 | getMinSuffixComponents() const |
| 87 | { |
| 88 | return m_minSuffixComponents; |
| 89 | } |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 90 | |
| 91 | Selectors& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 92 | setMinSuffixComponents(int minSuffixComponents) |
| 93 | { |
| 94 | m_minSuffixComponents = minSuffixComponents; |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 95 | m_wire.reset(); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 96 | return *this; |
| 97 | } |
| 98 | |
| 99 | // |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 100 | |
| 101 | int |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 102 | getMaxSuffixComponents() const |
| 103 | { |
| 104 | return m_maxSuffixComponents; |
| 105 | } |
| 106 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 107 | Selectors& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 108 | setMaxSuffixComponents(int maxSuffixComponents) |
| 109 | { |
| 110 | m_maxSuffixComponents = maxSuffixComponents; |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 111 | m_wire.reset(); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 112 | return *this; |
| 113 | } |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 114 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 115 | // |
| 116 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 117 | const KeyLocator& |
| 118 | getPublisherPublicKeyLocator() const |
| 119 | { |
| 120 | return m_publisherPublicKeyLocator; |
| 121 | } |
| 122 | |
| 123 | Selectors& |
| 124 | setPublisherPublicKeyLocator(const KeyLocator& keyLocator) |
| 125 | { |
| 126 | m_publisherPublicKeyLocator = keyLocator; |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 127 | m_wire.reset(); |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 128 | return *this; |
| 129 | } |
| 130 | |
| 131 | // |
| 132 | |
| 133 | const Exclude& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 134 | getExclude() const |
| 135 | { |
| 136 | return m_exclude; |
| 137 | } |
| 138 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 139 | Selectors& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 140 | setExclude(const Exclude& exclude) |
| 141 | { |
| 142 | m_exclude = exclude; |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 143 | m_wire.reset(); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 144 | return *this; |
| 145 | } |
| 146 | |
| 147 | // |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 148 | |
| 149 | int |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 150 | getChildSelector() const |
| 151 | { |
| 152 | return m_childSelector; |
| 153 | } |
| 154 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 155 | Selectors& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 156 | setChildSelector(int childSelector) |
| 157 | { |
| 158 | m_childSelector = childSelector; |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 159 | m_wire.reset(); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 160 | return *this; |
| 161 | } |
| 162 | |
| 163 | // |
| 164 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 165 | int |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 166 | getMustBeFresh() const |
| 167 | { |
| 168 | return m_mustBeFresh; |
| 169 | } |
| 170 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 171 | Selectors& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 172 | setMustBeFresh(bool mustBeFresh) |
| 173 | { |
| 174 | m_mustBeFresh = mustBeFresh; |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 175 | m_wire.reset(); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 176 | return *this; |
| 177 | } |
| 178 | |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 179 | public: // EqualityComparable concept |
| 180 | bool |
| 181 | operator==(const Selectors& other) const |
| 182 | { |
| 183 | return wireEncode() == other.wireEncode(); |
| 184 | } |
| 185 | |
| 186 | bool |
| 187 | operator!=(const Selectors& other) const |
| 188 | { |
| 189 | return !(*this == other); |
| 190 | } |
| 191 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 192 | private: |
| 193 | int m_minSuffixComponents; |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 194 | int m_maxSuffixComponents; |
| 195 | KeyLocator m_publisherPublicKeyLocator; |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 196 | Exclude m_exclude; |
| 197 | int m_childSelector; |
| 198 | bool m_mustBeFresh; |
| 199 | |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 200 | mutable Block m_wire; |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 201 | }; |
| 202 | |
| 203 | inline bool |
| 204 | Selectors::empty() const |
| 205 | { |
| 206 | return |
| 207 | (m_minSuffixComponents < 0 && |
| 208 | m_maxSuffixComponents < 0 && |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 209 | m_publisherPublicKeyLocator.empty() && |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 210 | m_exclude.empty() && |
| 211 | m_childSelector < 0 && |
| 212 | !m_mustBeFresh); |
| 213 | } |
| 214 | |
| 215 | template<bool T> |
| 216 | inline size_t |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 217 | Selectors::wireEncode(EncodingImpl<T>& block) const |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 218 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 219 | size_t totalLength = 0; |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 220 | |
| 221 | // Selectors ::= SELECTORS-TYPE TLV-LENGTH |
| 222 | // MinSuffixComponents? |
| 223 | // MaxSuffixComponents? |
| 224 | // PublisherPublicKeyLocator? |
| 225 | // Exclude? |
| 226 | // ChildSelector? |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 227 | // MustBeFresh? |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 228 | |
| 229 | // (reverse encoding) |
| 230 | |
| 231 | // MustBeFresh |
| 232 | if (getMustBeFresh()) |
| 233 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 234 | totalLength += prependBooleanBlock(block, Tlv::MustBeFresh); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | // ChildSelector |
| 238 | if (getChildSelector() >= 0) |
| 239 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 240 | totalLength += prependNonNegativeIntegerBlock(block, Tlv::ChildSelector, getChildSelector()); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | // Exclude |
| 244 | if (!getExclude().empty()) |
| 245 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 246 | totalLength += getExclude().wireEncode(block); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 247 | } |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 248 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 249 | // PublisherPublicKeyLocator |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 250 | if (!getPublisherPublicKeyLocator().empty()) |
| 251 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 252 | totalLength += getPublisherPublicKeyLocator().wireEncode(block); |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 253 | } |
| 254 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 255 | // MaxSuffixComponents |
| 256 | if (getMaxSuffixComponents() >= 0) |
| 257 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 258 | totalLength += prependNonNegativeIntegerBlock(block, Tlv::MaxSuffixComponents, |
| 259 | getMaxSuffixComponents()); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | // MinSuffixComponents |
| 263 | if (getMinSuffixComponents() >= 0) |
| 264 | { |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 265 | totalLength += prependNonNegativeIntegerBlock(block, Tlv::MinSuffixComponents, |
| 266 | getMinSuffixComponents()); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 267 | } |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 268 | |
Alexander Afanasyev | fdbfc6d | 2014-04-14 15:12:11 -0700 | [diff] [blame] | 269 | totalLength += block.prependVarNumber(totalLength); |
| 270 | totalLength += block.prependVarNumber(Tlv::Selectors); |
| 271 | return totalLength; |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 272 | } |
| 273 | |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 274 | inline const Block& |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 275 | Selectors::wireEncode() const |
| 276 | { |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 277 | if (m_wire.hasWire()) |
| 278 | return m_wire; |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 279 | |
| 280 | EncodingEstimator estimator; |
| 281 | size_t estimatedSize = wireEncode(estimator); |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 282 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 283 | EncodingBuffer buffer(estimatedSize, 0); |
| 284 | wireEncode(buffer); |
| 285 | |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 286 | m_wire = buffer.block(); |
| 287 | return m_wire; |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | inline void |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 291 | Selectors::wireDecode(const Block& wire) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 292 | { |
| 293 | if (wire.type() != Tlv::Selectors) |
| 294 | throw Tlv::Error("Unexpected TLV type when decoding Selectors"); |
| 295 | |
| 296 | *this = Selectors(); |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 297 | |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 298 | m_wire = wire; |
| 299 | m_wire.parse(); |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 300 | |
| 301 | // MinSuffixComponents |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 302 | Block::element_const_iterator val = m_wire.find(Tlv::MinSuffixComponents); |
| 303 | if (val != m_wire.elements_end()) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 304 | { |
| 305 | m_minSuffixComponents = readNonNegativeInteger(*val); |
| 306 | } |
| 307 | |
| 308 | // MaxSuffixComponents |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 309 | val = m_wire.find(Tlv::MaxSuffixComponents); |
| 310 | if (val != m_wire.elements_end()) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 311 | { |
| 312 | m_maxSuffixComponents = readNonNegativeInteger(*val); |
| 313 | } |
| 314 | |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 315 | // PublisherPublicKeyLocator |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 316 | val = m_wire.find(Tlv::KeyLocator); |
| 317 | if (val != m_wire.elements_end()) |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 318 | { |
| 319 | m_publisherPublicKeyLocator.wireDecode(*val); |
| 320 | } |
| 321 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 322 | // Exclude |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 323 | val = m_wire.find(Tlv::Exclude); |
| 324 | if (val != m_wire.elements_end()) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 325 | { |
| 326 | m_exclude.wireDecode(*val); |
| 327 | } |
| 328 | |
| 329 | // ChildSelector |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 330 | val = m_wire.find(Tlv::ChildSelector); |
| 331 | if (val != m_wire.elements_end()) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 332 | { |
| 333 | m_childSelector = readNonNegativeInteger(*val); |
| 334 | } |
| 335 | |
| 336 | //MustBeFresh aka AnswerOriginKind |
Alexander Afanasyev | ff2d08f | 2014-04-07 18:28:25 -0700 | [diff] [blame] | 337 | val = m_wire.find(Tlv::MustBeFresh); |
| 338 | if (val != m_wire.elements_end()) |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 339 | { |
| 340 | m_mustBeFresh = true; |
| 341 | } |
| 342 | } |
Junxiao Shi | b332e78 | 2014-03-31 14:23:46 -0700 | [diff] [blame] | 343 | |
Alexander Afanasyev | c348f83 | 2014-02-17 16:35:17 -0800 | [diff] [blame] | 344 | } // namespace ndn |
| 345 | |
| 346 | #endif // NDN_SELECTORS_HPP |