nfd.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_NFD_HPP
27 #define NFD_DAEMON_NFD_HPP
28 
29 #include "core/config-file.hpp"
30 #include "core/scheduler.hpp"
31 
32 #include <ndn-cxx/security/key-chain.hpp>
33 #include <ndn-cxx/util/network-monitor.hpp>
34 
35 namespace ndn {
36 class Face;
37 namespace mgmt {
38 class Dispatcher;
39 } // namespace mgmt
40 } // namespace ndn
41 
42 namespace nfd {
43 
44 class Forwarder;
45 class CommandAuthenticator;
46 class FibManager;
47 class FaceManager;
48 class StrategyChoiceManager;
49 class ForwarderStatusManager;
50 
51 namespace face {
52 class Face;
53 } // namespace face
54 
59 class Nfd : noncopyable
60 {
61 public:
65  Nfd(const std::string& configFile, ndn::KeyChain& keyChain);
66 
74  Nfd(const ConfigSection& config, ndn::KeyChain& keyChain);
75 
79  ~Nfd();
80 
85  void
86  initialize();
87 
91  void
93 
94 private:
95  void
96  initializeLogging();
97 
98  void
99  initializeManagement();
100 
101  void
102  reloadConfigFileFaceSection();
103 
104 private:
105  std::string m_configFile;
106  ConfigSection m_configSection;
107 
108  unique_ptr<Forwarder> m_forwarder;
109 
110  ndn::KeyChain& m_keyChain;
111  shared_ptr<face::Face> m_internalFace;
112  shared_ptr<ndn::Face> m_internalClientFace;
113  unique_ptr<ndn::mgmt::Dispatcher> m_dispatcher;
114  shared_ptr<CommandAuthenticator> m_authenticator;
115  unique_ptr<ForwarderStatusManager> m_forwarderStatusManager;
116  unique_ptr<FaceManager> m_faceManager;
117  unique_ptr<FibManager> m_fibManager;
118  unique_ptr<StrategyChoiceManager> m_strategyChoiceManager;
119 
120  unique_ptr<ndn::util::NetworkMonitor> m_networkMonitor;
121  scheduler::ScopedEventId m_reloadConfigEvent;
122 };
123 
124 } // namespace nfd
125 
126 #endif // NFD_DAEMON_NFD_HPP
Copyright (c) 2014-2016, Regents of the University of California, Arizona Board of Regents...
Definition: nfd.hpp:35
~Nfd()
Destructor.
cancels an event automatically upon destruction
Definition: scheduler.hpp:54
void reloadConfigFile()
Reload configuration file and apply update (if any)
Definition: nfd.cpp:183
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
Nfd(const std::string &configFile, ndn::KeyChain &keyChain)
Create NFD instance using absolute or relative path to configFile.
Definition: nfd.cpp:60
boost::property_tree::ptree ConfigSection
Definition: config-file.hpp:35
void initialize()
Perform initialization of NFD instance After initialization, NFD instance can be started by invoking ...
Definition: nfd.cpp:80
Class representing NFD instance This class can be used to initialize all components of NFD...
Definition: nfd.hpp:59