Scroom  0.14
Scroom::Utils::Counter Class Reference

#include <utilities.hh>

Collaboration diagram for Scroom::Utils::Counter:
Collaboration graph

Public Member Functions

void registerCount (const Count::Ptr &count)
 
void unregisterCount (const Count::Ptr &count)
 
void dump ()
 
std::list< Count::PtrgetCounts ()
 

Static Public Member Functions

static Counterinstance ()
 

Private Member Functions

 Counter ()
 

Private Attributes

std::list< Count::Ptrcounts
 
boost::mutex mut
 

Constructor & Destructor Documentation

◆ Counter()

Counter::Counter ( )
private
54 { g_timeout_add_seconds(10, timedDumpCounts, this); }

Referenced by instance().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ dump()

void Counter::dump ( )
69 {
70  boost::unique_lock<boost::mutex> const lock(mut);
71  std::stringstream out;
72 
73  out << counts.size();
74  for(Count::Ptr const& count: counts)
75  {
76  out << ", " << count->name << ", " << count->count;
77  }
78  spdlog::trace("{}", out.str());
79 }

Referenced by Scroom::Utils::dumpCounts().

Here is the caller graph for this function:

◆ getCounts()

std::list< Count::Ptr > Counter::getCounts ( )
82 {
83  boost::unique_lock<boost::mutex> const lock(mut);
84  return counts;
85 }

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

◆ instance()

Counter * Counter::instance ( )
static
49 {
50  static auto* me = new Counter();
51  return me;
52 }

Referenced by BOOST_AUTO_TEST_CASE(), Scroom::Utils::Count::create(), and Scroom::Utils::dumpCounts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerCount()

void Counter::registerCount ( const Count::Ptr count)
57 {
58  boost::unique_lock<boost::mutex> const lock(mut);
59  counts.push_back(count);
60 }

Referenced by Scroom::Utils::Count::create().

Here is the caller graph for this function:

◆ unregisterCount()

void Counter::unregisterCount ( const Count::Ptr count)
63 {
64  boost::unique_lock<boost::mutex> const lock(mut);
65  counts.remove(count);
66 }

Member Data Documentation

◆ counts

std::list<Count::Ptr> Scroom::Utils::Counter::counts
private

◆ mut

boost::mutex Scroom::Utils::Counter::mut
private

The documentation for this class was generated from the following files:
Scroom::Utils::Counter::mut
boost::mutex mut
Definition: utilities.hh:165
Scroom::Utils::Counter::Counter
Counter()
Definition: counter.cc:54
Scroom::Utils::Count::Ptr
boost::shared_ptr< Count > Ptr
Definition: utilities.hh:129
Scroom::Utils::Counter::counts
std::list< Count::Ptr > counts
Definition: utilities.hh:164
timedDumpCounts
gboolean timedDumpCounts(gpointer data)
Definition: counter.cc:25
out
SampleIterator< uint8_t > out(output, 0, bps)