NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
126  InRecordCollection::iterator
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 
148  OutRecordCollection::iterator
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&
186 {
187  return *m_interest;
188 }
189 
190 inline const InRecordCollection&
192 {
193  return m_inRecords;
194 }
195 
196 inline const OutRecordCollection&
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
InRecordCollection::const_iterator getInRecord(const Face &face) const
get the InRecord for face
Definition: pit-entry.cpp:145
OutRecordCollection::const_iterator getOutRecord(const Face &face) const
get the OutRecord for face
Definition: pit-entry.cpp:172
EventId m_stragglerTimer
Definition: pit-entry.hpp:168
bool canForwardTo(const Face &face) const
decides whether Interest can be forwarded to face
Definition: pit-entry.cpp:54
base class for an entity onto which StrategyInfo objects may be placed
int findNonce(uint32_t nonce, const Face &face) const
finds where a duplicate Nonce appears
Definition: pit-entry.cpp:99
InRecordCollection::iterator insertOrUpdateInRecord(shared_ptr< Face > face, const Interest &interest)
inserts a InRecord for face, and updates it with interest
Definition: pit-entry.cpp:131
bool hasLocalInRecord() const
determines whether any InRecord is a local Face
Definition: pit-entry.cpp:47
EventId m_unsatisfyTimer
Definition: pit-entry.hpp:167
std::shared_ptr< ns3::EventId > EventId
Definition: scheduler.hpp:39
represents a face
Definition: face.hpp:59
bool violatesScope(const Face &face) const
decides whether forwarding Interest to face would violate scope
Definition: pit-entry.cpp:78
const Interest & getInterest() const
Definition: pit-entry.hpp:185
represents a PIT entry
Definition: pit-entry.hpp:67
const InRecordCollection & getInRecords() const
Definition: pit-entry.hpp:191
Class Name Tree.
Definition: name-tree.hpp:79
out-record of same face
Definition: pit-entry.hpp:60
const Name & getName() const
Definition: pit-entry.cpp:41
void deleteOutRecord(const Face &face)
deletes one OutRecord for face if exists
Definition: pit-entry.cpp:179
Entry(const Interest &interest)
Definition: pit-entry.cpp:35
const OutRecordCollection & getOutRecords() const
Definition: pit-entry.hpp:197
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
void deleteInRecords()
deletes all InRecords
Definition: pit-entry.cpp:152
NameTree
Definition: name-tree.cpp:36
out-record of other face
Definition: pit-entry.hpp:62
OutRecordCollection::iterator insertOrUpdateOutRecord(shared_ptr< Face > face, const Interest &interest)
inserts a OutRecord for face, and updates it with interest
Definition: pit-entry.cpp:158
DuplicateNonceWhere
indicates where duplicate Nonces are found
Definition: pit-entry.hpp:53
bool hasUnexpiredOutRecords() const
Definition: pit-entry.cpp:189
Name Tree Entry Class.