smats  0.0.1
Satisfability Modulo Arithmetic Theories Symbols
Loading...
Searching...
No Matches
smats::IterationStats Class Reference

#include <stats.h>

Inheritance diagram for smats::IterationStats:
smats::Stats

Public Member Functions

 IterationStats (bool enabled, std::string class_name, std::string name_time="Time spent in Operations", std::string iterations_name="Total # of Iterations")
 
 IterationStats (const IterationStats &other)
 
IterationStatsoperator= (const IterationStats &other)
 
IterationStatsoperator+= (const IterationStats &other)
 
IterationStats operator+ (const IterationStats &other) const
 
std::string to_segment_string () const override
 
std::string to_string () const override
 
void increase ()
 
unsigned int iterations () const
 
void operator++ ()
 
void operator++ (int)
 
- Public Member Functions inherited from smats::Stats
 Stats (bool enabled, std::string class_name, std::string name_time="Time spent in Operations")
 
 Stats (const Stats &other)=default
 
Statsoperator= (const Stats &other)=default
 
Statsoperator+= (const Stats &other)
 
Stats operator+ (const Stats &other) const
 
bool enabled () const
 
Timerm_timer ()
 
const Timertimer () const
 

Private Attributes

std::atomic< unsigned int > iterations_
 Number of iterations.
 
std::string iterations_name_
 Prompt to specify the number of iterations.
 

Additional Inherited Members

- Protected Attributes inherited from smats::Stats
bool enabled_
 Whether the stats measuring is enabled.
 
std::string class_name_
 Name of the class the stats are measuring.
 
std::string operations_name_
 Prompt to specify what operation the time has been measured of.
 

Detailed Description

Measure the statistics of the software.

Namely, measure the time spent in operations and the number of iterations.

Constructor & Destructor Documentation

◆ IterationStats()

smats::IterationStats::IterationStats ( bool enabled,
std::string class_name,
std::string name_time = "Time spent in Operations",
std::string iterations_name = "Total # of Iterations" )
explicit

Construct a new IterationStats object.

The enabled flag is used to enable or disable the stats measuring. The class_name is the name of the class the stats are measuring, while the name_time is the prompt to specify what operation the time has been measured of, and the iterations_name is the prompt to specify the number of iterations.

Parameters
enabledwhether the stats measuring is enabled
class_namename of the class the stats are measuring
name_timeprompt to specify what operation the time has been measured of
iterations_nameprompt to specify the number of iterations

Member Function Documentation

◆ increase()

void smats::IterationStats::increase ( )

Increase the iteration counter by one.

Note
The iteration counter is atomic.

◆ to_segment_string()

std::string smats::IterationStats::to_segment_string ( ) const
nodiscardoverridevirtual

Convert the current state of the object to a formatted string, only including the specific part the Stat object is concerned about

Returns
string representing a partial state of the Stats

Reimplemented from smats::Stats.

◆ to_string()

std::string smats::IterationStats::to_string ( ) const
nodiscardoverridevirtual

Convert the current state of the object to a formatted string

Returns
string representing the state of the Stats

Reimplemented from smats::Stats.


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