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 namespace name_tree {
36 class Entry;
37 } // namespace name_tree
38 
39 namespace pit {
40 
43 typedef std::list<InRecord> InRecordCollection;
44 
47 typedef std::list<OutRecord> OutRecordCollection;
48 
57 class Entry : public StrategyInfoHost, noncopyable
58 {
59 public:
60  explicit
61  Entry(const Interest& interest);
62 
68  const Interest&
69  getInterest() const
70  {
71  return *m_interest;
72  }
73 
76  const Name&
77  getName() const
78  {
79  return m_interest->getName();
80  }
81 
86  bool
87  canMatch(const Interest& interest, size_t nEqualNameComps = 0) const;
88 
89 public: // in-record
92  const InRecordCollection&
93  getInRecords() const
94  {
95  return m_inRecords;
96  }
97 
103  bool
104  hasInRecords() const
105  {
106  return !m_inRecords.empty();
107  }
108 
111  {
112  return m_inRecords.begin();
113  }
114 
115  InRecordCollection::const_iterator
116  in_begin() const
117  {
118  return m_inRecords.begin();
119  }
120 
123  {
124  return m_inRecords.end();
125  }
126 
127  InRecordCollection::const_iterator
128  in_end() const
129  {
130  return m_inRecords.end();
131  }
132 
137  getInRecord(const Face& face);
138 
143  insertOrUpdateInRecord(Face& face, const Interest& interest);
144 
147  void
148  deleteInRecord(const Face& face);
149 
152  void
153  clearInRecords();
154 
155 public: // out-record
158  const OutRecordCollection&
160  {
161  return m_outRecords;
162  }
163 
170  bool
172  {
173  return !m_outRecords.empty();
174  }
175 
178  {
179  return m_outRecords.begin();
180  }
181 
182  OutRecordCollection::const_iterator
183  out_begin() const
184  {
185  return m_outRecords.begin();
186  }
187 
190  {
191  return m_outRecords.end();
192  }
193 
194  OutRecordCollection::const_iterator
195  out_end() const
196  {
197  return m_outRecords.end();
198  }
199 
204  getOutRecord(const Face& face);
205 
210  insertOrUpdateOutRecord(Face& face, const Interest& interest);
211 
214  void
215  deleteOutRecord(const Face& face);
216 
217 public:
227  scheduler::EventId m_unsatisfyTimer;
228 
237  scheduler::EventId m_stragglerTimer;
238 
239 private:
240  shared_ptr<const Interest> m_interest;
241  InRecordCollection m_inRecords;
242  OutRecordCollection m_outRecords;
243 
244  name_tree::Entry* m_nameTreeEntry;
245 
246  friend class name_tree::Entry;
247 };
248 
249 } // namespace pit
250 } // namespace nfd
251 
252 #endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
const InRecordCollection & getInRecords() const
Definition: pit-entry.hpp:93
bool hasInRecords() const
Definition: pit-entry.hpp:104
OutRecordCollection::const_iterator out_begin() const
Definition: pit-entry.hpp:183
base class for an entity onto which StrategyInfo items may be placed
bool hasOutRecords() const
Definition: pit-entry.hpp:171
OutRecordCollection::const_iterator out_end() const
Definition: pit-entry.hpp:195
scheduler::EventId m_unsatisfyTimer
unsatisfy timer
Definition: pit-entry.hpp:227
InRecordCollection::const_iterator in_begin() const
Definition: pit-entry.hpp:116
scheduler::EventId m_stragglerTimer
straggler timer
Definition: pit-entry.hpp:237
std::list< InRecord > InRecordCollection
an unordered collection of in-records
Definition: pit-entry.hpp:43
Table::const_iterator iterator
Definition: cs-internal.hpp:41
InRecordCollection::const_iterator in_end() const
Definition: pit-entry.hpp:128
an Interest table entry
Definition: pit-entry.hpp:57
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
InRecordCollection::iterator in_end()
Definition: pit-entry.hpp:122
const Interest & getInterest() const
Definition: pit-entry.hpp:69
an entry in the name tree
std::list< OutRecord > OutRecordCollection
an unordered collection of out-records
Definition: pit-entry.hpp:47
OutRecordCollection::iterator out_begin()
Definition: pit-entry.hpp:177
OutRecordCollection::iterator out_end()
Definition: pit-entry.hpp:189
const OutRecordCollection & getOutRecords() const
Definition: pit-entry.hpp:159
const Name & getName() const
Definition: pit-entry.hpp:77
InRecordCollection::iterator in_begin()
Definition: pit-entry.hpp:110