NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nrd.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_RIB_NRD_HPP
27 #define NFD_RIB_NRD_HPP
28 
29 #include "common.hpp"
30 #include "core/config-file.hpp"
31 
32 #include <ndn-cxx/face.hpp>
33 #include <ndn-cxx/security/key-chain.hpp>
34 #include <ndn-cxx/transport/transport.hpp>
35 
36 namespace nfd {
37 namespace rib {
38 
39 class RibManager;
40 
45 class Nrd : noncopyable
46 {
47 public:
48  class Error : public std::runtime_error
49  {
50  public:
51  explicit
52  Error(const std::string& what)
53  : std::runtime_error(what)
54  {
55  }
56  };
57 
61  Nrd(const std::string& configFile, ndn::KeyChain& keyChain);
62 
70  Nrd(const ConfigSection& config, ndn::KeyChain& keyChain);
71 
75  ~Nrd();
76 
81  void
82  initialize();
83 
84 private:
85  void
86  initializeLogging();
87 
92  shared_ptr<ndn::Transport>
93  getLocalNfdTransport();
94 
95 private:
96  std::string m_configFile;
97  ConfigSection m_configSection;
98 
99  ndn::KeyChain& m_keyChain;
100  unique_ptr<ndn::Face> m_face;
101  unique_ptr<RibManager> m_ribManager;
102 };
103 
104 } // namespace rib
105 } // namespace nfd
106 
107 #endif // NFD_RIB_NRD_HPP
The packet signing interface.
Definition: key-chain.hpp:48
STL namespace.
Nrd(const std::string &configFile, ndn::KeyChain &keyChain)
Create NRD instance using absolute or relative path to configFile.
Definition: nrd.cpp:43
Class representing NRD (NFD RIB Manager) instance This class can be used to initialize all components...
Definition: nrd.hpp:45
Error(const std::string &what)
Definition: nrd.hpp:52
~Nrd()
Destructor.
Definition: nrd.cpp:55
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
boost::property_tree::ptree ConfigSection
void initialize()
Perform initialization of NFD instance After initialization, NFD instance can be started by invoking ...
Definition: nrd.cpp:63