dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
dlinear::Stats Class Reference

Dataclass collecting statistics about some operation or process. More...

#include <Stats.h>

Inheritance diagram for dlinear::Stats:
dlinear::IterationStats

Public Member Functions

 Stats (bool enabled, std::string class_name, std::string name_time="Time spent in Operations")
 Construct a Stats object.
 
bool enabled () const
 Check whether the stats is enabled.
 
Timerm_timer ()
 Get read-write access to the timer of the stats.
 
const Timertimer () const
 Get read-only access to the timer of the stats.
 
virtual std::string ToSegmentString () const
 Convert the current state of the object to a formatted string, only including the specific part the Stat object is concerned about.
 
virtual std::string ToString () const
 Convert the current state of the object to a formatted string.
 

Protected Attributes

bool enabled_
 Flag to enable/disable the collection of statistics.
 
std::string class_name_
 Name of the class running the operation the Stats object is collecting statistics for.
 
std::string operations_name_
 Name of the operation the Stats object is collecting statistics for.
 

Private Attributes

Timer timer_
 Timer object to measure the cumulative time spent in the operation.
 

Detailed Description

Dataclass collecting statistics about some operation or process.

At its more basic level, it collects the cumulative time spent in a given operation.

Definition at line 23 of file Stats.h.

Constructor & Destructor Documentation

◆ Stats()

dlinear::Stats::Stats ( bool enabled,
std::string class_name,
std::string name_time = "Time spent in Operations" )
explicit

Construct a Stats object.

Parameters
enabledwhether the Stats object should be enabled or not. Its value is propagated to the timer_
class_namename of the class running the operation the Stats object is collecting statistics for
name_timename of the operation the Stats object is collecting statistics for

Definition at line 19 of file Stats.cpp.

Member Function Documentation

◆ enabled()

bool dlinear::Stats::enabled ( ) const
inlinenodiscard

Check whether the stats is enabled.

Returns
true if the stats is enabled
false if the stats is not enabled

Definition at line 48 of file Stats.h.

◆ m_timer()

Timer & dlinear::Stats::m_timer ( )
inlinenodiscard

Get read-write access to the timer of the stats.

Returns
timer of the stats

Definition at line 50 of file Stats.h.

◆ timer()

const Timer & dlinear::Stats::timer ( ) const
inlinenodiscard

Get read-only access to the timer of the stats.

Returns
timer of the stats

Definition at line 52 of file Stats.h.

◆ ToSegmentString()

std::string dlinear::Stats::ToSegmentString ( ) const
nodiscardvirtual

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 in dlinear::IterationStats.

Definition at line 22 of file Stats.cpp.

◆ ToString()

std::string dlinear::Stats::ToString ( ) const
nodiscardvirtual

Convert the current state of the object to a formatted string.

Returns
string representing the state of the Stats

Reimplemented in dlinear::IterationStats.

Definition at line 25 of file Stats.cpp.


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