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
measurements.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_TABLE_MEASUREMENTS_HPP
27 #define NFD_DAEMON_TABLE_MEASUREMENTS_HPP
28 
29 #include "measurements-entry.hpp"
30 #include "name-tree.hpp"
31 
32 namespace nfd {
33 
34 namespace fib {
35 class Entry;
36 }
37 
38 namespace pit {
39 class Entry;
40 }
41 
42 
46 class Measurements : noncopyable
47 {
48 public:
49  explicit
50  Measurements(NameTree& nametree);
51 
54  shared_ptr<measurements::Entry>
55  get(const Name& name);
56 
59  shared_ptr<measurements::Entry>
60  get(const fib::Entry& fibEntry);
61 
64  shared_ptr<measurements::Entry>
65  get(const pit::Entry& pitEntry);
66 
70  shared_ptr<measurements::Entry>
71  getParent(const measurements::Entry& child);
72 
75  shared_ptr<measurements::Entry>
76  findLongestPrefixMatch(const Name& name) const;
77 
80  shared_ptr<measurements::Entry>
81  findExactMatch(const Name& name) const;
82 
83  static time::nanoseconds
85 
90  void
91  extendLifetime(measurements::Entry& entry, const time::nanoseconds& lifetime);
92 
93  size_t
94  size() const;
95 
96 private:
97  void
98  cleanup(measurements::Entry& entry);
99 
100  shared_ptr<measurements::Entry>
101  get(name_tree::Entry& nte);
102 
103 private:
104  NameTree& m_nameTree;
105  size_t m_nItems;
106  static const time::nanoseconds s_defaultLifetime;
107 };
108 
109 inline time::nanoseconds
111 {
112  return time::seconds(4);
113 }
114 
115 inline size_t
117 {
118  return m_nItems;
119 }
120 
121 } // namespace nfd
122 
123 #endif // NFD_DAEMON_TABLE_MEASUREMENTS_HPP
shared_ptr< measurements::Entry > getParent(const measurements::Entry &child)
find or insert a Measurements entry for child's parent
represents a FIB entry
Definition: fib-entry.hpp:53
represents a Measurements entry
represents a PIT entry
Definition: pit-entry.hpp:67
Class Name Tree.
Definition: name-tree.hpp:79
shared_ptr< measurements::Entry > findExactMatch(const Name &name) const
perform an exact match
static time::nanoseconds getInitialLifetime()
shared_ptr< measurements::Entry > findLongestPrefixMatch(const Name &name) const
perform a longest prefix match
Measurements(NameTree &nametree)
void extendLifetime(measurements::Entry &entry, const time::nanoseconds &lifetime)
extend lifetime of an entry
size_t size() const
Name Tree Entry Class.