nlsr-runner.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NLSR_NLSR_RUNNER_HPP
23 #define NLSR_NLSR_RUNNER_HPP
24 
25 #include "nlsr.hpp"
26 
27 #include <ndn-cxx/face.hpp>
28 #include <ndn-cxx/util/scheduler.hpp>
29 
30 // boost needs to be included after ndn-cxx, otherwise there will be conflict with _1, _2, ...
31 #include <boost/asio.hpp>
32 
33 namespace nlsr {
34 
45 {
46 public:
47  class Error : public std::runtime_error
48  {
49  public:
50  explicit
51  Error(const std::string& what)
52  : std::runtime_error(what)
53  {
54  }
55  };
56 
57  NlsrRunner(std::string& configFileName, bool isDaemonProcess);
58 
71  void
72  run();
73 
74  static void
75  printUsage(const std::string& programName);
76 
77 private:
78  boost::asio::io_service m_ioService;
79  ndn::Scheduler m_scheduler;
80  ndn::Face m_face;
81  ndn::KeyChain m_keyChain;
82  Nlsr m_nlsr;
83 };
84 
85 } // namespace nlsr
86 
87 #endif // NLSR_NLSR_RUNNER_HPP
Error(const std::string &what)
Definition: nlsr-runner.hpp:51
A wrapper class to instantiate and configure an NLSR object.
Definition: nlsr-runner.hpp:44
STL namespace.
NlsrRunner(std::string &configFileName, bool isDaemonProcess)
Definition: nlsr-runner.cpp:31
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void run()
Instantiate, configure, and start the NLSR process.
Definition: nlsr-runner.cpp:41
static void printUsage(const std::string &programName)
Definition: nlsr-runner.cpp:85