STXXL
1.4-dev
|
This class provides a statistical counter that can easily be deactivated using a typedef to dummy_custom_stats_counter.
It's basically a wrapper for a unsigned long long value.
Definition at line 32 of file custom_stats.h.
Public Types | |
typedef ValueType | value_type |
The counter's value type. More... | |
Public Member Functions | |
custom_stats_counter () | |
The constructor. Initializes the counter to 0. More... | |
std::string | as_memory_amount (const value_type &byte_per_element) const |
Return the counter value interpreted as a memory amount in IEC units as a string. More... | |
operator value_type () const | |
Cast to counter_type: Returns the counter's value as a regular integer value. More... | |
custom_stats_counter & | operator++ () |
Increases the counter by 1 (prefix). More... | |
custom_stats_counter | operator++ (int) |
Increases the counter by 1 (postfix). More... | |
custom_stats_counter & | operator+= (const value_type &right) |
Increases the counter by right. More... | |
custom_stats_counter & | operator= (const value_type &other) |
Assignment operator. More... | |
void | set_max (const value_type &other) |
Set the counter to other if other is larger than the current counter value. More... | |
Protected Attributes | |
value_type | m_value |
The counter's value. More... | |
typedef ValueType stxxl::custom_stats_counter< ValueType >::value_type |
The counter's value type.
Definition at line 36 of file custom_stats.h.
|
inline |
The constructor. Initializes the counter to 0.
Definition at line 44 of file custom_stats.h.
|
inline |
Return the counter value interpreted as a memory amount in IEC units as a string.
For that purpose the counter value is multiplied with the byte_per_element argument.
byte_per_element | The memory amount per "counter element". |
Definition at line 92 of file custom_stats.h.
References stxxl::format_IEC_size().
|
inline |
Cast to counter_type: Returns the counter's value as a regular integer value.
This can be used as a getter as well as for printing with std::out.
Definition at line 101 of file custom_stats.h.
|
inline |
Increases the counter by 1 (prefix).
Definition at line 56 of file custom_stats.h.
|
inline |
Increases the counter by 1 (postfix).
Definition at line 62 of file custom_stats.h.
|
inline |
Increases the counter by right.
right | The corresponding integer value |
Definition at line 50 of file custom_stats.h.
|
inline |
Assignment operator.
other | The corresponding integer value |
Definition at line 70 of file custom_stats.h.
|
inline |
Set the counter to other if other is larger than the current counter value.
other | The corresponding integer value |
Definition at line 81 of file custom_stats.h.
References max().
|
protected |
The counter's value.
Definition at line 40 of file custom_stats.h.