NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
pit-entry.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_TABLE_PIT_ENTRY_HPP
27 #define NFD_DAEMON_TABLE_PIT_ENTRY_HPP
28 
29 #include "pit-in-record.hpp"
30 #include "pit-out-record.hpp"
31 #include "core/scheduler.hpp"
32 
33 namespace nfd {
34 
35 class NameTree;
36 
37 namespace name_tree {
38 class Entry;
39 }
40 
41 namespace pit {
42 
45 typedef std::list< InRecord> InRecordCollection;
46 
49 typedef std::list<OutRecord> OutRecordCollection;
50 
63 };
64 
67 class Entry : public StrategyInfoHost, noncopyable
68 {
69 public:
70  explicit
71  Entry(const Interest& interest);
72 
73  const Interest&
74  getInterest() const;
75 
78  const Name&
79  getName() const;
80 
87  bool
88  canForwardTo(const Face& face) const;
89 
99  bool
100  violatesScope(const Face& face) const;
101 
105  int
106  findNonce(uint32_t nonce, const Face& face) const;
107 
108 public: // InRecord
109  const InRecordCollection&
110  getInRecords() const;
111 
117  bool
118  hasLocalInRecord() const;
119 
127  insertOrUpdateInRecord(shared_ptr<Face> face, const Interest& interest);
128 
132  InRecordCollection::const_iterator
133  getInRecord(const Face& face) const;
134 
136  void
137  deleteInRecords();
138 
139 public: // OutRecord
140  const OutRecordCollection&
141  getOutRecords() const;
142 
149  insertOrUpdateOutRecord(shared_ptr<Face> face, const Interest& interest);
150 
154  OutRecordCollection::const_iterator
155  getOutRecord(const Face& face) const;
156 
158  void
159  deleteOutRecord(const Face& face);
160 
163  bool
164  hasUnexpiredOutRecords() const;
165 
166 public:
169 
170 private:
171  shared_ptr<const Interest> m_interest;
172  InRecordCollection m_inRecords;
173  OutRecordCollection m_outRecords;
174 
175  static const Name LOCALHOST_NAME;
176  static const Name LOCALHOP_NAME;
177 
178  shared_ptr<name_tree::Entry> m_nameTreeEntry;
179 
180  friend class nfd::NameTree;
181  friend class nfd::name_tree::Entry;
182 };
183 
184 inline const Interest&
185 Entry::getInterest() const
186 {
187  return *m_interest;
188 }
189 
190 inline const InRecordCollection&
191 Entry::getInRecords() const
192 {
193  return m_inRecords;
194 }
195 
196 inline const OutRecordCollection&
197 Entry::getOutRecords() const
198 {
199  return m_outRecords;
200 }
201 
202 } // namespace pit
203 } // namespace nfd
204 
205 #endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
std::list< InRecord > InRecordCollection
represents an unordered collection of InRecords
Definition: pit-entry.hpp:45
in-record of other face
Definition: pit-entry.hpp:58
scheduler::EventId m_stragglerTimer
Definition: pit-entry.hpp:168
base class for an entity onto which StrategyInfo objects may be placed
represents an Interest packet
Definition: interest.hpp:45
std::shared_ptr< ns3::EventId > EventId
Definition: scheduler.hpp:39
represents a face
Definition: face.hpp:57
Table::const_iterator iterator
Definition: cs-internal.hpp:41
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
represents a PIT entry
Definition: pit-entry.hpp:67
Class Name Tree.
Definition: name-tree.hpp:79
out-record of same face
Definition: pit-entry.hpp:60
Name abstraction to represent an absolute name.
Definition: name.hpp:46
std::list< OutRecord > OutRecordCollection
represents an unordered collection of OutRecords
Definition: pit-entry.hpp:49
in-record of same face
Definition: pit-entry.hpp:56
NameTree
Definition: name-tree.cpp:36
out-record of other face
Definition: pit-entry.hpp:62
DuplicateNonceWhere
indicates where duplicate Nonces are found
Definition: pit-entry.hpp:53
scheduler::EventId m_unsatisfyTimer
Definition: pit-entry.hpp:167
Name Tree Entry Class.