Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StatsCounter< ValueType_, true > Class Template Reference

Detailed Description

template<typename ValueType_>
class thrill::common::StatsCounter< ValueType_, true >

Definition at line 36 of file stats_counter.hpp.

#include <stats_counter.hpp>

Public Types

using ValueType = ValueType_
 The counter's value type. More...
 

Public Member Functions

 StatsCounter (const ValueType &initial=ValueType())
 The constructor. Initializes the counter to 0. More...
 
 operator ValueType () const
 Cast to counter_type: Returns the counter's value as a regular integer value. More...
 
StatsCounteroperator++ ()
 Increases the counter by 1 (prefix). More...
 
StatsCounter operator++ (int)
 Increases the counter by 1 (postfix). More...
 
StatsCounteroperator+= (const ValueType &right)
 Increases the counter by right. More...
 
bool Real () const
 Whether the counter is active. More...
 
void set_max (const ValueType &other)
 
ValueType value () const
 

Private Attributes

ValueType value_
 The counter's value. More...
 

Member Typedef Documentation

using ValueType = ValueType_

The counter's value type.

Definition at line 40 of file stats_counter.hpp.

Constructor & Destructor Documentation

StatsCounter ( const ValueType initial = ValueType())
inline

The constructor. Initializes the counter to 0.

Definition at line 48 of file stats_counter.hpp.

Member Function Documentation

operator ValueType ( ) const
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 85 of file stats_counter.hpp.

StatsCounter& operator++ ( )
inline

Increases the counter by 1 (prefix).

Definition at line 62 of file stats_counter.hpp.

StatsCounter operator++ ( int  )
inline

Increases the counter by 1 (postfix).

Definition at line 68 of file stats_counter.hpp.

StatsCounter& operator+= ( const ValueType right)
inline

Increases the counter by right.

Definition at line 56 of file stats_counter.hpp.

bool Real ( ) const
inline

Whether the counter is active.

Definition at line 53 of file stats_counter.hpp.

void set_max ( const ValueType other)
inline

Set the counter to other if other is larger than the current counter value.

Definition at line 76 of file stats_counter.hpp.

References thrill::common::max().

ValueType value ( ) const
inline

Definition at line 90 of file stats_counter.hpp.

Member Data Documentation

ValueType value_
private

The counter's value.

Definition at line 44 of file stats_counter.hpp.


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