#include <log.hh>
|
void | add (std::string const &tag) |
|
void | reset () |
|
void | reset (std::string const &tag) |
|
Definition at line 38 of file log.hh.
◆ container_t
◆ Counter() [1/2]
Log::Counter::Counter |
( |
| ) |
|
|
inlineprivate |
◆ Counter() [2/2]
Log::Counter::Counter |
( |
Counter const & | | ) |
|
|
private |
◆ operator=()
◆ get()
static Counter & Log::Counter::get |
( |
| ) |
|
|
inlinestatic |
Definition at line 53 of file log.hh.
54 {
56
57 return c;
58 }
◆ add()
void Log::Counter::add |
( |
std::string const & | tag | ) |
|
|
inline |
Definition at line 60 of file log.hh.
61 {
62 boost::mutex::scoped_lock lock(
m_mutex);
63
64 container_t::iterator
const it =
m_counters.find(tag);
65
67 ++it->second;
68 } else {
70 }
71 }
◆ reset() [1/2]
void Log::Counter::reset |
( |
| ) |
|
|
inline |
Definition at line 73 of file log.hh.
74 {
75 boost::mutex::scoped_lock lock(
m_mutex);
77 }
◆ reset() [2/2]
void Log::Counter::reset |
( |
std::string const & | tag | ) |
|
|
inline |
Definition at line 79 of file log.hh.
80 {
81 boost::mutex::scoped_lock lock(
m_mutex);
82
83 container_t::iterator
const it =
m_counters.find(tag);
84
86 it->second = 0;
87 }
88 }
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
Counter const & | c ) |
|
friend |
Definition at line 91 of file log.hh.
92 {
93 boost::mutex::scoped_lock lock(c.m_mutex);
94
95 for (
96 container_t::const_iterator it = c.m_counters.begin(), et = c.m_counters.end();
97 it != et;
98 ++it
99 ) {
100 stream << it->first << ": " << it->second << ", ";
101 }
102
103 return stream;
104 }
◆ m_counters
◆ m_mutex
boost::mutex Log::Counter::m_mutex |
|
mutableprivate |
The documentation for this class was generated from the following file: