status-report.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_TOOLS_NFDC_STATUS_REPORT_HPP
27 #define NFD_TOOLS_NFDC_STATUS_REPORT_HPP
28 
29 #include "module.hpp"
30 
31 namespace nfd {
32 namespace tools {
33 namespace nfdc {
34 
35 using ndn::Face;
36 using ndn::security::KeyChain;
37 using ndn::Validator;
38 
39 enum class ReportFormat {
40  XML = 1,
41  TEXT = 2
42 };
43 
45 parseReportFormat(const std::string& s);
46 
47 std::ostream&
48 operator<<(std::ostream& os, ReportFormat fmt);
49 
52 class StatusReport : noncopyable
53 {
54 public:
55 #ifdef WITH_TESTS
56  virtual
57  ~StatusReport() = default;
58 #endif
59 
67  uint32_t
68  collect(Face& face, KeyChain& keyChain, Validator& validator, const CommandOptions& options);
69 
73  void
74  formatXml(std::ostream& os) const;
75 
79  void
80  formatText(std::ostream& os) const;
81 
82 private:
84  processEvents(Face& face);
85 
86 public:
89  std::vector<unique_ptr<Module>> sections;
90 };
91 
92 } // namespace nfdc
93 } // namespace tools
94 } // namespace nfd
95 
96 #endif // NFD_TOOLS_NFDC_STATUS_REPORT_HPP
ReportFormat parseReportFormat(const std::string &s)
std::vector< unique_ptr< Module > > sections
modules through which status is collected
void formatXml(std::ostream &os) const
print an XML report
uint32_t collect(Face &face, KeyChain &keyChain, Validator &validator, const CommandOptions &options)
collect status via chosen sections
std::ostream & operator<<(std::ostream &os, ArgValueType vt)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
collects and prints NFD status report
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014-2016, Regents of the University of California, Arizona Board of Regents...
Definition: common.hpp:37
void formatText(std::ostream &os) const
print a text report