NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
registered-prefix.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_DETAIL_REGISTERED_PREFIX_HPP
23 #define NDN_DETAIL_REGISTERED_PREFIX_HPP
24 
25 #include "../common.hpp"
26 #include "../name.hpp"
27 #include "../interest.hpp"
28 
32 
33 namespace ndn {
34 
38 class RegisteredPrefix : noncopyable
39 {
40 public:
41  RegisteredPrefix(const Name& prefix,
42  shared_ptr<InterestFilterRecord> filter,
43  const nfd::CommandOptions& options)
44  : m_prefix(prefix)
45  , m_filter(filter)
46  , m_options(options)
47  {
48  }
49 
50  const Name&
51  getPrefix() const
52  {
53  return m_prefix;
54  }
55 
56  const shared_ptr<InterestFilterRecord>&
57  getFilter() const
58  {
59  return m_filter;
60  }
61 
62  const nfd::CommandOptions&
64  {
65  return m_options;
66  }
67 
68 private:
69  Name m_prefix;
70  shared_ptr<InterestFilterRecord> m_filter;
71  nfd::CommandOptions m_options;
72 };
73 
77 class RegisteredPrefixId;
78 
83 {
84 public:
85  explicit
86  MatchRegisteredPrefixId(const RegisteredPrefixId* registeredPrefixId)
87  : m_id(registeredPrefixId)
88  {
89  }
90 
91  bool
92  operator()(const shared_ptr<RegisteredPrefix>& registeredPrefix) const
93  {
94  return reinterpret_cast<const RegisteredPrefixId*>(registeredPrefix.get()) == m_id;
95  }
96 
97 private:
98  const RegisteredPrefixId* m_id;
99 };
100 
101 } // namespace ndn
102 
103 #endif // NDN_DETAIL_REGISTERED_PREFIX_HPP
Copyright (c) 2011-2015 Regents of the University of California.
const shared_ptr< InterestFilterRecord > & getFilter() const
bool operator()(const shared_ptr< RegisteredPrefix > &registeredPrefix) const
MatchRegisteredPrefixId(const RegisteredPrefixId *registeredPrefixId)
stores information about a prefix registered in NDN forwarder
const nfd::CommandOptions & getCommandOptions() const
const Name & getPrefix() const
contains options for ControlCommand execution
Name abstraction to represent an absolute name.
Definition: name.hpp:46
RegisteredPrefix(const Name &prefix, shared_ptr< InterestFilterRecord > filter, const nfd::CommandOptions &options)
Functor to match RegisteredPrefixId.