stats-collector.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
21 #include "stats-collector.hpp"
22 #include "logger.hpp"
23 #include <fstream>
24 
25 namespace nlsr {
26 
28  : m_lsdb(lsdb)
29  , m_hp(hp)
30 {
31  m_lsaIncrementConn =
32  this->m_lsdb.lsaIncrementSignal.connect(std::bind(&StatsCollector::statsIncrement,
33  this, _1));
34 
35  m_helloIncrementConn =
36  this->m_hp.hpIncrementSignal.connect(std::bind(&StatsCollector::statsIncrement,
37  this, _1));
38 }
39 
41 {
42  m_lsaIncrementConn.disconnect();
43  m_helloIncrementConn.disconnect();
44 }
45 
46 void
47 StatsCollector::statsIncrement(Statistics::PacketType pType)
48 {
49  m_stats.increment(pType);
50 }
51 
52 } // namespace nlsr
ndn::util::signal::Signal< HelloProtocol, Statistics::PacketType > hpIncrementSignal
StatsCollector(Lsdb &lsdb, HelloProtocol &hp)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
ndn::util::signal::Signal< Lsdb, Statistics::PacketType > lsaIncrementSignal
Definition: lsdb.hpp:385
void increment(PacketType)
Definition: statistics.cpp:43