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 } // namespace name_tree
40 
41 class Pit;
42 
43 namespace pit {
44 
47 typedef std::list< InRecord> InRecordCollection;
48 
51 typedef std::list<OutRecord> OutRecordCollection;
52 
65 };
66 
69 class Entry : public StrategyInfoHost, noncopyable
70 {
71 public:
72  explicit
73  Entry(const Interest& interest);
74 
75  const Interest&
76  getInterest() const;
77 
80  const Name&
81  getName() const;
82 
89  bool
90  canForwardTo(const Face& face) const;
91 
101  bool
102  violatesScope(const Face& face) const;
103 
107  int
108  findNonce(uint32_t nonce, const Face& face) const;
109 
110 public: // InRecord
111  const InRecordCollection&
112  getInRecords() const;
113 
119  bool
120  hasLocalInRecord() const;
121 
129  insertOrUpdateInRecord(shared_ptr<Face> face, const Interest& interest);
130 
134  InRecordCollection::const_iterator
135  getInRecord(const Face& face) const;
136 
138  void
139  deleteInRecord(const Face& face);
140 
142  void
143  deleteInRecords();
144 
145 public: // OutRecord
146  const OutRecordCollection&
147  getOutRecords() const;
148 
155  insertOrUpdateOutRecord(shared_ptr<Face> face, const Interest& interest);
156 
161  getOutRecord(const Face& face);
162 
164  void
165  deleteOutRecord(const Face& face);
166 
169  bool
170  hasUnexpiredOutRecords() const;
171 
172 public:
175 
176 private:
177  shared_ptr<const Interest> m_interest;
178  InRecordCollection m_inRecords;
179  OutRecordCollection m_outRecords;
180 
181  static const Name LOCALHOST_NAME;
182  static const Name LOCALHOP_NAME;
183 
184  shared_ptr<name_tree::Entry> m_nameTreeEntry;
185 
186  friend class nfd::NameTree;
187  friend class nfd::name_tree::Entry;
188  friend class nfd::Pit;
189 };
190 
191 inline const Interest&
192 Entry::getInterest() const
193 {
194  return *m_interest;
195 }
196 
197 inline const InRecordCollection&
198 Entry::getInRecords() const
199 {
200  return m_inRecords;
201 }
202 
203 inline const OutRecordCollection&
204 Entry::getOutRecords() const
205 {
206  return m_outRecords;
207 }
208 
209 } // namespace pit
210 } // namespace nfd
211 
212 #endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
std::list< InRecord > InRecordCollection
represents an unordered collection of InRecords
Definition: pit-entry.hpp:47
in-record of other face
Definition: pit-entry.hpp:60
scheduler::EventId m_stragglerTimer
Definition: pit-entry.hpp:174
base class for an entity onto which StrategyInfo objects may be placed
represents an Interest packet
Definition: interest.hpp:45
represents the Interest Table
Definition: pit.hpp:48
Table::const_iterator iterator
Definition: cs-internal.hpp:41
std::shared_ptr< ns3::EventId > EventId
Definition: scheduler.hpp:39
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
represents a PIT entry
Definition: pit-entry.hpp:69
Class Name Tree.
Definition: name-tree.hpp:79
out-record of same face
Definition: pit-entry.hpp:62
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:51
in-record of same face
Definition: pit-entry.hpp:58
NameTree
Definition: name-tree.cpp:36
out-record of other face
Definition: pit-entry.hpp:64
DuplicateNonceWhere
indicates where duplicate Nonces are found
Definition: pit-entry.hpp:55
scheduler::EventId m_unsatisfyTimer
Definition: pit-entry.hpp:173
Name Tree Entry Class.