Jeff Thompson | 25b4e61 | 2013-10-10 16:03:24 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 2 | /** |
Jeff Thompson | 7687dc0 | 2013-09-13 11:54:07 -0700 | [diff] [blame] | 3 | * Copyright (C) 2013 Regents of the University of California. |
| 4 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 5 | * See COPYING for copyright and distribution information. |
| 6 | */ |
| 7 | |
Jeff Thompson | 25b4e61 | 2013-10-10 16:03:24 -0700 | [diff] [blame] | 8 | #include <ndn-cpp/face.hpp> |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 9 | |
Jeff Thompson | b982b6d | 2013-07-15 18:15:45 -0700 | [diff] [blame] | 10 | using namespace std; |
| 11 | |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 12 | namespace ndn { |
Jeff Thompson | 9657bda | 2013-07-16 16:23:41 -0700 | [diff] [blame] | 13 | |
Jeff Thompson | 62992e4 | 2013-10-07 18:50:51 -0700 | [diff] [blame] | 14 | uint64_t |
Jeff Thompson | 978c152 | 2013-11-12 23:03:10 -0800 | [diff] [blame] | 15 | Face::expressInterest |
| 16 | (const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout, |
| 17 | WireFormat& wireFormat) |
Jeff Thompson | fb29cda | 2013-08-24 10:26:54 -0700 | [diff] [blame] | 18 | { |
| 19 | if (interestTemplate) |
Jeff Thompson | 1109514 | 2013-10-01 16:20:28 -0700 | [diff] [blame] | 20 | return node_.expressInterest(Interest |
Jeff Thompson | fb29cda | 2013-08-24 10:26:54 -0700 | [diff] [blame] | 21 | (name, interestTemplate->getMinSuffixComponents(), interestTemplate->getMaxSuffixComponents(), |
| 22 | interestTemplate->getPublisherPublicKeyDigest(), interestTemplate->getExclude(), |
| 23 | interestTemplate->getChildSelector(), interestTemplate->getAnswerOriginKind(), |
Jeff Thompson | 978c152 | 2013-11-12 23:03:10 -0800 | [diff] [blame] | 24 | interestTemplate->getScope(), interestTemplate->getInterestLifetimeMilliseconds()), onData, onTimeout, wireFormat); |
Jeff Thompson | fb29cda | 2013-08-24 10:26:54 -0700 | [diff] [blame] | 25 | else |
Jeff Thompson | 978c152 | 2013-11-12 23:03:10 -0800 | [diff] [blame] | 26 | return node_.expressInterest(Interest(name, 4000.0), onData, onTimeout, wireFormat); |
Jeff Thompson | fb29cda | 2013-08-24 10:26:54 -0700 | [diff] [blame] | 27 | } |
| 28 | |
Jeff Thompson | 0050abe | 2013-09-17 12:50:25 -0700 | [diff] [blame] | 29 | void |
| 30 | Face::shutdown() |
Jeff Thompson | 517ffa8 | 2013-08-05 16:04:34 -0700 | [diff] [blame] | 31 | { |
Jeff Thompson | bf50a1a | 2013-08-20 18:01:01 -0700 | [diff] [blame] | 32 | node_.shutdown(); |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | } |