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 
82 public: // in-record
85  const InRecordCollection&
86  getInRecords() const
87  {
88  return m_inRecords;
89  }
90 
96  bool
97  hasInRecords() const
98  {
99  return !m_inRecords.empty();
100  }
101 
104  {
105  return m_inRecords.begin();
106  }
107 
108  InRecordCollection::const_iterator
109  in_begin() const
110  {
111  return m_inRecords.begin();
112  }
113 
116  {
117  return m_inRecords.end();
118  }
119 
120  InRecordCollection::const_iterator
121  in_end() const
122  {
123  return m_inRecords.end();
124  }
125 
130  getInRecord(const Face& face);
131 
136  insertOrUpdateInRecord(Face& face, const Interest& interest);
137 
140  void
141  deleteInRecord(const Face& face);
142 
145  void
146  clearInRecords();
147 
148 public: // out-record
151  const OutRecordCollection&
153  {
154  return m_outRecords;
155  }
156 
163  bool
165  {
166  return !m_outRecords.empty();
167  }
168 
171  {
172  return m_outRecords.begin();
173  }
174 
175  OutRecordCollection::const_iterator
176  out_begin() const
177  {
178  return m_outRecords.begin();
179  }
180 
183  {
184  return m_outRecords.end();
185  }
186 
187  OutRecordCollection::const_iterator
188  out_end() const
189  {
190  return m_outRecords.end();
191  }
192 
197  getOutRecord(const Face& face);
198 
203  insertOrUpdateOutRecord(Face& face, const Interest& interest);
204 
207  void
208  deleteOutRecord(const Face& face);
209 
210 public:
220  scheduler::EventId m_unsatisfyTimer;
221 
230  scheduler::EventId m_stragglerTimer;
231 
232 private:
233  shared_ptr<const Interest> m_interest;
234  InRecordCollection m_inRecords;
235  OutRecordCollection m_outRecords;
236 
237  name_tree::Entry* m_nameTreeEntry;
238 
239  friend class name_tree::Entry;
240 };
241 
242 } // namespace pit
243 } // namespace nfd
244 
245 #endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
void deleteInRecord(const Face &face)
delete the in-record for face if it exists
Definition: pit-entry.cpp:60
const InRecordCollection & getInRecords() const
Definition: pit-entry.hpp:86
bool hasInRecords() const
Definition: pit-entry.hpp:97
OutRecordCollection::iterator getOutRecord(const Face &face)
get the out-record for face
Definition: pit-entry.cpp:76
OutRecordCollection::const_iterator out_begin() const
Definition: pit-entry.hpp:176
base class for an entity onto which StrategyInfo items may be placed
bool hasOutRecords() const
Definition: pit-entry.hpp:164
OutRecordCollection::const_iterator out_end() const
Definition: pit-entry.hpp:188
scheduler::EventId m_unsatisfyTimer
unsatisfy timer
Definition: pit-entry.hpp:220
InRecordCollection::const_iterator in_begin() const
Definition: pit-entry.hpp:109
scheduler::EventId m_stragglerTimer
straggler timer
Definition: pit-entry.hpp:230
void deleteOutRecord(const Face &face)
delete the out-record for face if it exists
Definition: pit-entry.cpp:97
InRecordCollection::iterator insertOrUpdateInRecord(Face &face, const Interest &interest)
insert or update an in-record
Definition: pit-entry.cpp:46
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:121
void clearInRecords()
delete all in-records
Definition: pit-entry.cpp:70
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
OutRecordCollection::iterator insertOrUpdateOutRecord(Face &face, const Interest &interest)
insert or update an out-record
Definition: pit-entry.cpp:83
InRecordCollection::iterator in_end()
Definition: pit-entry.hpp:115
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:170
Entry(const Interest &interest)
Definition: pit-entry.cpp:32
InRecordCollection::iterator getInRecord(const Face &face)
get the in-record for face
Definition: pit-entry.cpp:39
OutRecordCollection::iterator out_end()
Definition: pit-entry.hpp:182
const OutRecordCollection & getOutRecords() const
Definition: pit-entry.hpp:152
const Name & getName() const
Definition: pit-entry.hpp:77
InRecordCollection::iterator in_begin()
Definition: pit-entry.hpp:103