NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
strategy-choice-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_STRATEGY_CHOICE_ENTRY_HPP
27 #define NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
28 
29 #include "common.hpp"
30 
31 namespace nfd {
32 
33 class NameTree;
34 namespace name_tree {
35 class Entry;
36 }
37 namespace fw {
38 class Strategy;
39 }
40 
41 namespace strategy_choice {
42 
45 class Entry : noncopyable
46 {
47 public:
48  Entry(const Name& prefix);
49 
50  const Name&
51  getPrefix() const;
52 
53  const Name&
54  getStrategyName() const;
55 
57  getStrategy() const;
58 
59  void
60  setStrategy(fw::Strategy& strategy);
61 
62 private:
63  Name m_prefix;
64  fw::Strategy* m_strategy;
65 
66  shared_ptr<name_tree::Entry> m_nameTreeEntry;
67  friend class nfd::NameTree;
68  friend class nfd::name_tree::Entry;
69 };
70 
71 
72 inline const Name&
74 {
75  return m_prefix;
76 }
77 
78 inline fw::Strategy&
79 Entry::getStrategy() const
80 {
81  BOOST_ASSERT(m_strategy != nullptr);
82  return *m_strategy;
83 }
84 
85 inline void
86 Entry::setStrategy(fw::Strategy& strategy)
87 {
88  m_strategy = &strategy;
89 }
90 
91 } // namespace strategy_choice
92 } // namespace nfd
93 
94 #endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
const Name & getPrefix() const
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
Class Name Tree.
Definition: name-tree.hpp:79
Name abstraction to represent an absolute name.
Definition: name.hpp:46
represents a Strategy Choice entry
represents a forwarding strategy
Definition: strategy.hpp:38
NameTree
Definition: name-tree.cpp:36
Name Tree Entry Class.