NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
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  const StrategyChoice& strategyChoice,
34  const 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) const
47 {
48  if (entry == nullptr) {
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
represents the Measurements table
MeasurementsAccessor(Measurements &measurements, const StrategyChoice &strategyChoice, const fw::Strategy &strategy)
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
represents a forwarding strategy
Definition: strategy.hpp:38