NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
service.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_RIB_SERVICE_HPP
27 #define NFD_RIB_SERVICE_HPP
28 
29 #include "core/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 #include <ndn-cxx/mgmt/dispatcher.hpp>
36 
37 namespace nfd {
38 namespace rib {
39 
40 class RibManager;
41 
45 class Service : 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 
63  Service(const std::string& configFile, ndn::KeyChain& keyChain);
64 
73  Service(const ConfigSection& config, ndn::KeyChain& keyChain);
74 
78  ~Service();
79 
85  void
86  initialize();
87 
88 private:
89  void
90  initializeLogging();
91 
96  shared_ptr<ndn::Transport>
97  getLocalNfdTransport();
98 
99 private:
100  std::string m_configFile;
101  ConfigSection m_configSection;
102 
103  ndn::KeyChain& m_keyChain;
104  unique_ptr<ndn::Face> m_face;
105  unique_ptr<ndn::mgmt::Dispatcher> m_dispatcher;
106  unique_ptr<RibManager> m_ribManager;
107 };
108 
109 } // namespace rib
110 } // namespace nfd
111 
112 #endif // NFD_RIB_SERVICE_HPP
initializes and executes NFD-RIB service thread
Definition: service.hpp:45
STL namespace.
void initialize()
Perform initialization of NFD-RIB instance.
Definition: service.cpp:63
Error(const std::string &what)
Definition: service.hpp:52
Service(const std::string &configFile, ndn::KeyChain &keyChain)
create NFD-RIB service
Definition: service.cpp:43
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
boost::property_tree::ptree ConfigSection
a config file section
~Service()
Destructor.
Definition: service.cpp:55
ndn security v2 KeyChain
Definition: key-chain.cpp:76