NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
strategy-choice-publisher.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
strategy-choice-publisher.hpp
"
27
#include "
core/logger.hpp
"
28
#include "
table/strategy-choice.hpp
"
29
30
#include <ndn-cxx/management/nfd-strategy-choice.hpp>
31
32
namespace
nfd {
33
34
NFD_LOG_INIT
(
"StrategyChoicePublisher"
);
35
36
37
StrategyChoicePublisher::StrategyChoicePublisher
(
const
StrategyChoice
& strategyChoice,
38
AppFace
& face,
39
const
Name
& prefix,
40
ndn::KeyChain& keyChain)
41
:
SegmentPublisher
(face, prefix, keyChain)
42
, m_strategyChoice(strategyChoice)
43
{
44
45
}
46
47
StrategyChoicePublisher::~StrategyChoicePublisher
()
48
{
49
50
}
51
52
size_t
53
StrategyChoicePublisher::generate
(ndn::EncodingBuffer& outBuffer)
54
{
55
size_t
totalLength = 0;
56
57
for
(
StrategyChoice::const_iterator
i = m_strategyChoice.
begin
();
58
i != m_strategyChoice.
end
();
59
++i)
60
{
61
ndn::nfd::StrategyChoice
entry;
62
63
entry.setName(i->getPrefix())
64
.setStrategy(i->getStrategyName());
65
66
totalLength += entry.wireEncode(outBuffer);
67
}
68
69
return
totalLength;
70
}
71
72
}
// namespace nfd
nfd::SegmentPublisher
provides a publisher of Status Dataset or other segmented octet stream
Definition:
segment-publisher.hpp:40
nfd::AppFace
Definition:
app-face.hpp:37
nfd::StrategyChoice
represents the Strategy Choice table
Definition:
strategy-choice.hpp:45
logger.hpp
nfd::StrategyChoicePublisher::generate
virtual size_t generate(ndn::EncodingBuffer &outBuffer)
In a derived class, write the octets into outBuffer.
Definition:
strategy-choice-publisher.cpp:53
strategy-choice.hpp
nfd::StrategyChoice
StrategyChoice
Definition:
strategy-choice.cpp:37
nfd::StrategyChoicePublisher::StrategyChoicePublisher
StrategyChoicePublisher(const StrategyChoice &strategyChoice, AppFace &face, const Name &prefix, ndn::KeyChain &keyChain)
Definition:
strategy-choice-publisher.cpp:37
ns3::ndn::Name
Name
Definition:
ndn-common.cpp:25
nfd::StrategyChoicePublisher::~StrategyChoicePublisher
virtual ~StrategyChoicePublisher()
Definition:
strategy-choice-publisher.cpp:47
nfd::StrategyChoice::begin
const_iterator begin() const
Definition:
strategy-choice.cpp:278
strategy-choice-publisher.hpp
nfd::StrategyChoice::end
const_iterator end() const
Definition:
strategy-choice.hpp:179
NFD_LOG_INIT
#define NFD_LOG_INIT(name)
Definition:
logger.hpp:33
nfd::StrategyChoice::const_iterator
Definition:
strategy-choice.hpp:105
ndnSIM
NFD
daemon
mgmt
strategy-choice-publisher.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7