Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 2 | /** |
Junxiao Shi | 446de3c | 2016-07-25 22:38:16 +0000 | [diff] [blame] | 3 | * Copyright (c) 2013-2016 Regents of the University of California. |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 6 | * |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #ifndef NDN_DETAIL_FACE_IMPL_HPP |
| 23 | #define NDN_DETAIL_FACE_IMPL_HPP |
| 24 | |
| 25 | #include "../common.hpp" |
| 26 | #include "../face.hpp" |
| 27 | |
| 28 | #include "registered-prefix.hpp" |
| 29 | #include "pending-interest.hpp" |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 30 | #include "container-with-on-empty-signal.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 31 | |
| 32 | #include "../util/scheduler.hpp" |
| 33 | #include "../util/config-file.hpp" |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 34 | #include "../util/signal.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 35 | |
Junxiao Shi | 0fa2845 | 2014-12-13 22:02:36 -0700 | [diff] [blame] | 36 | #include "../transport/transport.hpp" |
| 37 | #include "../transport/unix-transport.hpp" |
| 38 | #include "../transport/tcp-transport.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 39 | |
Junxiao Shi | 0fa2845 | 2014-12-13 22:02:36 -0700 | [diff] [blame] | 40 | #include "../management/nfd-controller.hpp" |
| 41 | #include "../management/nfd-command-options.hpp" |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 42 | |
| 43 | #include "../lp/packet.hpp" |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 44 | #include "../lp/tags.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 45 | |
| 46 | namespace ndn { |
| 47 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 48 | using ndn::nfd::ControlParameters; |
| 49 | |
| 50 | /** |
| 51 | * @brief implementation detail of Face |
| 52 | */ |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 53 | class Face::Impl : noncopyable |
| 54 | { |
| 55 | public: |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 56 | typedef ContainerWithOnEmptySignal<shared_ptr<PendingInterest>> PendingInterestTable; |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 57 | typedef std::list<shared_ptr<InterestFilterRecord>> InterestFilterTable; |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 58 | typedef ContainerWithOnEmptySignal<shared_ptr<RegisteredPrefix>> RegisteredPrefixTable; |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 59 | |
| 60 | explicit |
| 61 | Impl(Face& face) |
| 62 | : m_face(face) |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 63 | , m_scheduler(m_face.getIoService()) |
| 64 | , m_processEventsTimeoutEvent(m_scheduler) |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 65 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 66 | auto postOnEmptyPitOrNoRegisteredPrefixes = [this] { |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 67 | this->m_face.getIoService().post([this] { this->onEmptyPitOrNoRegisteredPrefixes(); }); |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 68 | // without this extra "post", transport can get paused (-async_read) and then resumed |
| 69 | // (+async_read) from within onInterest/onData callback. After onInterest/onData |
| 70 | // finishes, there is another +async_read with the same memory block. A few of such |
| 71 | // async_read duplications can cause various effects and result in segfault. |
| 72 | }; |
| 73 | |
| 74 | m_pendingInterestTable.onEmpty.connect(postOnEmptyPitOrNoRegisteredPrefixes); |
| 75 | m_registeredPrefixTable.onEmpty.connect(postOnEmptyPitOrNoRegisteredPrefixes); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 76 | } |
| 77 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 78 | public: // consumer |
Junxiao Shi | a1ea506 | 2014-12-27 22:33:39 -0700 | [diff] [blame] | 79 | void |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 80 | asyncExpressInterest(shared_ptr<const Interest> interest, |
| 81 | const DataCallback& afterSatisfied, |
| 82 | const NackCallback& afterNacked, |
| 83 | const TimeoutCallback& afterTimeout) |
Junxiao Shi | a1ea506 | 2014-12-27 22:33:39 -0700 | [diff] [blame] | 84 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 85 | this->ensureConnected(true); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 86 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 87 | auto entry = m_pendingInterestTable.insert(make_shared<PendingInterest>( |
| 88 | interest, afterSatisfied, afterNacked, afterTimeout, ref(m_scheduler))).first; |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 89 | (*entry)->setDeleter([this, entry] { m_pendingInterestTable.erase(entry); }); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 90 | |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 91 | lp::Packet packet; |
| 92 | |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 93 | shared_ptr<lp::NextHopFaceIdTag> nextHopFaceIdTag = interest->getTag<lp::NextHopFaceIdTag>(); |
| 94 | if (nextHopFaceIdTag != nullptr) { |
| 95 | packet.add<lp::NextHopFaceIdField>(*nextHopFaceIdTag); |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 96 | } |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 97 | |
| 98 | packet.add<lp::FragmentField>(std::make_pair(interest->wireEncode().begin(), |
| 99 | interest->wireEncode().end())); |
| 100 | |
| 101 | m_face.m_transport->send(packet.wireEncode()); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | void |
| 105 | asyncRemovePendingInterest(const PendingInterestId* pendingInterestId) |
| 106 | { |
| 107 | m_pendingInterestTable.remove_if(MatchPendingInterestId(pendingInterestId)); |
| 108 | } |
| 109 | |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 110 | void |
Ilya Moiseenko | 56b0bf8 | 2015-11-08 11:14:28 -0500 | [diff] [blame] | 111 | asyncRemoveAllPendingInterests() |
| 112 | { |
| 113 | m_pendingInterestTable.clear(); |
| 114 | } |
| 115 | |
| 116 | void |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 117 | satisfyPendingInterests(const Data& data) |
| 118 | { |
| 119 | for (auto entry = m_pendingInterestTable.begin(); entry != m_pendingInterestTable.end(); ) { |
| 120 | if ((*entry)->getInterest()->matchesData(data)) { |
| 121 | shared_ptr<PendingInterest> matchedEntry = *entry; |
| 122 | entry = m_pendingInterestTable.erase(entry); |
| 123 | matchedEntry->invokeDataCallback(data); |
| 124 | } |
| 125 | else { |
| 126 | ++entry; |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void |
| 132 | nackPendingInterests(const lp::Nack& nack) |
| 133 | { |
| 134 | for (auto entry = m_pendingInterestTable.begin(); entry != m_pendingInterestTable.end(); ) { |
| 135 | const Interest& pendingInterest = *(*entry)->getInterest(); |
| 136 | if (pendingInterest == nack.getInterest()) { |
| 137 | shared_ptr<PendingInterest> matchedEntry = *entry; |
| 138 | entry = m_pendingInterestTable.erase(entry); |
| 139 | matchedEntry->invokeNackCallback(nack); |
| 140 | } |
| 141 | else { |
| 142 | ++entry; |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | public: // producer |
| 148 | void |
| 149 | asyncSetInterestFilter(shared_ptr<InterestFilterRecord> interestFilterRecord) |
| 150 | { |
| 151 | m_interestFilterTable.push_back(interestFilterRecord); |
| 152 | } |
| 153 | |
| 154 | void |
| 155 | asyncUnsetInterestFilter(const InterestFilterId* interestFilterId) |
| 156 | { |
| 157 | InterestFilterTable::iterator i = std::find_if(m_interestFilterTable.begin(), |
| 158 | m_interestFilterTable.end(), |
| 159 | MatchInterestFilterId(interestFilterId)); |
| 160 | if (i != m_interestFilterTable.end()) { |
| 161 | m_interestFilterTable.erase(i); |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | void |
| 166 | processInterestFilters(Interest& interest) |
| 167 | { |
| 168 | for (const auto& filter : m_interestFilterTable) { |
| 169 | if (filter->doesMatch(interest.getName())) { |
| 170 | filter->invokeInterestCallback(interest); |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | void |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 176 | asyncPutData(const shared_ptr<const Data>& data) |
| 177 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 178 | this->ensureConnected(true); |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 179 | |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 180 | lp::Packet packet; |
| 181 | |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 182 | shared_ptr<lp::CachePolicyTag> cachePolicyTag = data->getTag<lp::CachePolicyTag>(); |
| 183 | if (cachePolicyTag != nullptr) { |
| 184 | packet.add<lp::CachePolicyField>(*cachePolicyTag); |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 185 | } |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 186 | |
| 187 | packet.add<lp::FragmentField>(std::make_pair(data->wireEncode().begin(), |
| 188 | data->wireEncode().end())); |
| 189 | |
| 190 | m_face.m_transport->send(packet.wireEncode()); |
| 191 | } |
| 192 | |
| 193 | void |
| 194 | asyncPutNack(shared_ptr<const lp::Nack> nack) |
| 195 | { |
| 196 | this->ensureConnected(true); |
| 197 | |
| 198 | lp::Packet packet; |
| 199 | packet.add<lp::NackField>(nack->getHeader()); |
| 200 | |
| 201 | Block interest = nack->getInterest().wireEncode(); |
| 202 | packet.add<lp::FragmentField>(std::make_pair(interest.begin(), interest.end())); |
| 203 | |
| 204 | m_face.m_transport->send(packet.wireEncode()); |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 205 | } |
| 206 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 207 | public: // prefix registration |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 208 | const RegisteredPrefixId* |
| 209 | registerPrefix(const Name& prefix, |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 210 | shared_ptr<InterestFilterRecord> filter, |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 211 | const RegisterPrefixSuccessCallback& onSuccess, |
| 212 | const RegisterPrefixFailureCallback& onFailure, |
Alexander Afanasyev | 0866f51 | 2014-08-11 13:25:09 -0700 | [diff] [blame] | 213 | uint64_t flags, |
Junxiao Shi | 388ec25 | 2014-11-02 15:19:57 -0700 | [diff] [blame] | 214 | const nfd::CommandOptions& options) |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 215 | { |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 216 | ControlParameters params; |
| 217 | params.setName(prefix); |
| 218 | params.setFlags(flags); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 219 | |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 220 | auto prefixToRegister = make_shared<RegisteredPrefix>(prefix, filter, options); |
Alexander Afanasyev | 0866f51 | 2014-08-11 13:25:09 -0700 | [diff] [blame] | 221 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 222 | m_face.m_nfdController->start<nfd::RibRegisterCommand>( |
| 223 | params, |
| 224 | [=] (const ControlParameters&) { this->afterPrefixRegistered(prefixToRegister, onSuccess); }, |
| 225 | [=] (uint32_t code, const std::string& reason) { onFailure(prefixToRegister->getPrefix(), reason); }, |
| 226 | options); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 227 | |
| 228 | return reinterpret_cast<const RegisteredPrefixId*>(prefixToRegister.get()); |
| 229 | } |
| 230 | |
| 231 | void |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 232 | afterPrefixRegistered(shared_ptr<RegisteredPrefix> registeredPrefix, |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 233 | const RegisterPrefixSuccessCallback& onSuccess) |
| 234 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 235 | m_registeredPrefixTable.insert(registeredPrefix); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 236 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 237 | if (registeredPrefix->getFilter() != nullptr) { |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 238 | // it was a combined operation |
| 239 | m_interestFilterTable.push_back(registeredPrefix->getFilter()); |
| 240 | } |
| 241 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 242 | if (onSuccess != nullptr) { |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 243 | onSuccess(registeredPrefix->getPrefix()); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | void |
| 248 | asyncUnregisterPrefix(const RegisteredPrefixId* registeredPrefixId, |
| 249 | const UnregisterPrefixSuccessCallback& onSuccess, |
| 250 | const UnregisterPrefixFailureCallback& onFailure) |
| 251 | { |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 252 | auto i = std::find_if(m_registeredPrefixTable.begin(), |
| 253 | m_registeredPrefixTable.end(), |
| 254 | MatchRegisteredPrefixId(registeredPrefixId)); |
| 255 | if (i != m_registeredPrefixTable.end()) { |
| 256 | RegisteredPrefix& record = **i; |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 257 | const shared_ptr<InterestFilterRecord>& filter = record.getFilter(); |
| 258 | |
| 259 | if (filter != nullptr) { |
| 260 | // it was a combined operation |
| 261 | m_interestFilterTable.remove(filter); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 262 | } |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 263 | |
| 264 | ControlParameters params; |
| 265 | params.setName(record.getPrefix()); |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 266 | m_face.m_nfdController->start<nfd::RibUnregisterCommand>( |
| 267 | params, |
| 268 | [=] (const ControlParameters&) { this->finalizeUnregisterPrefix(i, onSuccess); }, |
| 269 | [=] (uint32_t code, const std::string& reason) { onFailure(reason); }, |
| 270 | record.getCommandOptions()); |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 271 | } |
Alexander Afanasyev | 851228a | 2014-10-20 15:55:28 -0400 | [diff] [blame] | 272 | else { |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 273 | if (onFailure != nullptr) { |
Alexander Afanasyev | 851228a | 2014-10-20 15:55:28 -0400 | [diff] [blame] | 274 | onFailure("Unrecognized PrefixId"); |
| 275 | } |
| 276 | } |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 277 | |
| 278 | // there cannot be two registered prefixes with the same id |
| 279 | } |
| 280 | |
| 281 | void |
| 282 | finalizeUnregisterPrefix(RegisteredPrefixTable::iterator item, |
| 283 | const UnregisterPrefixSuccessCallback& onSuccess) |
| 284 | { |
| 285 | m_registeredPrefixTable.erase(item); |
| 286 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 287 | if (onSuccess != nullptr) { |
Alexander Afanasyev | 9c57818 | 2014-05-14 17:28:28 -0700 | [diff] [blame] | 288 | onSuccess(); |
| 289 | } |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 290 | } |
| 291 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame^] | 292 | public: // IO routine |
| 293 | void |
| 294 | ensureConnected(bool wantResume) |
| 295 | { |
| 296 | if (!m_face.m_transport->isConnected()) |
| 297 | m_face.m_transport->connect(m_face.m_ioService, |
| 298 | [=] (const Block& wire) { m_face.onReceiveElement(wire); }); |
| 299 | |
| 300 | if (wantResume && !m_face.m_transport->isReceiving()) { |
| 301 | m_face.m_transport->resume(); |
| 302 | } |
| 303 | } |
| 304 | |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 305 | void |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 306 | onEmptyPitOrNoRegisteredPrefixes() |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 307 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 308 | if (m_pendingInterestTable.empty() && m_registeredPrefixTable.empty()) { |
| 309 | m_face.m_transport->pause(); |
| 310 | if (!m_ioServiceWork) { |
| 311 | m_processEventsTimeoutEvent.cancel(); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 312 | } |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | private: |
| 317 | Face& m_face; |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 318 | util::Scheduler m_scheduler; |
| 319 | util::scheduler::ScopedEventId m_processEventsTimeoutEvent; |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 320 | |
| 321 | PendingInterestTable m_pendingInterestTable; |
| 322 | InterestFilterTable m_interestFilterTable; |
| 323 | RegisteredPrefixTable m_registeredPrefixTable; |
| 324 | |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 325 | unique_ptr<boost::asio::io_service::work> m_ioServiceWork; // if thread needs to be preserved |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 326 | |
| 327 | friend class Face; |
| 328 | }; |
| 329 | |
| 330 | } // namespace ndn |
| 331 | |
| 332 | #endif // NDN_DETAIL_FACE_IMPL_HPP |