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
strategy-choice-publisher.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
27 #include "core/logger.hpp"
29 
30 #include <ndn-cxx/management/nfd-strategy-choice.hpp>
31 
32 namespace nfd {
33 
34 NFD_LOG_INIT("StrategyChoicePublisher");
35 
36 
38  AppFace& face,
39  const Name& prefix,
40  ndn::KeyChain& keyChain)
41  : SegmentPublisher(face, prefix, keyChain)
42  , m_strategyChoice(strategyChoice)
43 {
44 
45 }
46 
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  {
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
provides a publisher of Status Dataset or other segmented octet stream
represents the Strategy Choice table
virtual size_t generate(ndn::EncodingBuffer &outBuffer)
In a derived class, write the octets into outBuffer.
StrategyChoicePublisher(const StrategyChoice &strategyChoice, AppFace &face, const Name &prefix, ndn::KeyChain &keyChain)
const_iterator begin() const
const_iterator end() const
#define NFD_LOG_INIT(name)
Definition: logger.hpp:33