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-accessor.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
27 
28 namespace nfd {
29 
30 using fw::Strategy;
31 
33  StrategyChoice& strategyChoice,
34  Strategy* strategy)
35  : m_measurements(measurements)
36  , m_strategyChoice(strategyChoice)
37  , m_strategy(strategy)
38 {
39 }
40 
42 {
43 }
44 
45 shared_ptr<measurements::Entry>
46 MeasurementsAccessor::filter(const shared_ptr<measurements::Entry>& entry)
47 {
48  if (!static_cast<bool>(entry)) {
49  return entry;
50  }
51 
52  Strategy& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
53  if (&effectiveStrategy == m_strategy) {
54  return entry;
55  }
56  return shared_ptr<measurements::Entry>();
57 }
58 
59 } // namespace nfd
fw::Strategy & findEffectiveStrategy(const Name &prefix) const
get effective strategy for prefix
represents the Strategy Choice table
MeasurementsAccessor(Measurements &measurements, StrategyChoice &strategyChoice, fw::Strategy *strategy)