stats-collector.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
21 #ifndef NLSR_STATS_COLLECTOR_HPP
22 #define NLSR_STATS_COLLECTOR_HPP
23 
24 #include "statistics.hpp"
25 #include "lsdb.hpp"
26 #include "hello-protocol.hpp"
27 #include <ndn-cxx/util/signal.hpp>
28 
29 namespace nlsr {
30 
31 // brief: a class designed to handle statistical signals in nlsr
32 
34 {
35 public:
36 
37  StatsCollector(Lsdb& lsdb, HelloProtocol& hp);
38 
40 
41  Statistics&
43  {
44  return m_stats;
45  }
46 
47 private:
48 
57  void
58  statsIncrement(Statistics::PacketType pType);
59 
60 private:
61 
62  Lsdb& m_lsdb;
63  HelloProtocol& m_hp;
64  Statistics m_stats;
65 
66  ndn::util::signal::ScopedConnection m_lsaIncrementConn;
67  ndn::util::signal::ScopedConnection m_helloIncrementConn;
68 };
69 
70 } // namespace nlsr
71 
72 #endif // NLSR_STATS_COLLECTOR_HPP
StatsCollector(Lsdb &lsdb, HelloProtocol &hp)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
Statistics & getStatistics()