delpi  0.0.1
DElta-complete LP solver
Loading...
Searching...
No Matches
delpi::Stats Class Reference

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

#include <Stats.h>

Inheritance diagram for delpi::Stats:
delpi::IterationStats

Public Member Functions

 Stats (bool enabled, std::string class_name, std::string name_time="Time spent in Operations")
 Construct a Stats object.
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 22 of file Stats.h.

Constructor & Destructor Documentation

◆ Stats()

delpi::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 20 of file Stats.cpp.

Member Function Documentation

◆ ToSegmentString()

std::string delpi::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 delpi::IterationStats.

Definition at line 23 of file Stats.cpp.

◆ ToString()

std::string delpi::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 delpi::IterationStats.

Definition at line 26 of file Stats.cpp.


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