Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
Scroom::Utils::Count Class Reference

#include <utilities.hh>

Collaboration diagram for Scroom::Utils::Count:
Collaboration graph

Public Types

using Ptr = std::shared_ptr< Count >
 

Public Member Functions

void ping ()
 
void inc ()
 
void dec ()
 

Static Public Member Functions

static Ptr create (const std::string &name)
 

Public Attributes

const std::string name
 
boost::mutex mut
 
long count {0}
 

Private Member Functions

 Count (std::string name)
 

Member Typedef Documentation

◆ Ptr

using Scroom::Utils::Count::Ptr = std::shared_ptr<Count>

Constructor & Destructor Documentation

◆ Count()

Count::Count ( std::string  name)
explicitprivate
35 : name(std::move(name_))
36
37{
38}
const std::string name
Definition utilities.hh:137

Member Function Documentation

◆ create()

Count::Ptr Count::create ( const std::string &  name)
static
41{
42 Ptr result = Ptr(new Count(name));
44 return result;
45}
Definition utilities.hh:132
std::shared_ptr< Count > Ptr
Definition utilities.hh:134
static Counter * instance()
Definition counter.cc:49
void registerCount(const Count::Ptr &count)
Definition counter.cc:57
SampleIterator< const uint8_t > result
Definition sampleiterator-tests.cc:94

Referenced by Scroom::Utils::Counted< C >::count_instance().

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

◆ dec()

void Scroom::Utils::Count::dec ( )
inline
151 {
152 boost::unique_lock<boost::mutex> const lock(mut);
153 --count;
154 ping();
155 }
void ping()
Definition utilities.hh:143
long count
Definition utilities.hh:139
boost::mutex mut
Definition utilities.hh:138
Here is the call graph for this function:

◆ inc()

void Scroom::Utils::Count::inc ( )
inline
145 {
146 boost::unique_lock<boost::mutex> const lock(mut);
147 ++count;
148 ping();
149 }
Here is the call graph for this function:

◆ ping()

void Scroom::Utils::Count::ping ( )
inline
143{ /* dumpCounts(); */ }

Referenced by dec(), and inc().

Here is the caller graph for this function:

Member Data Documentation

◆ count

long Scroom::Utils::Count::count {0}
139{0};

Referenced by dec(), and inc().

◆ mut

boost::mutex Scroom::Utils::Count::mut

Referenced by dec(), and inc().

◆ name

const std::string Scroom::Utils::Count::name

Referenced by create().


The documentation for this class was generated from the following files: