ant
A2 ant: class-based analysis framework
ant::ProgressCounter Struct Reference

#include <ProgressCounter.h>

+ Collaboration diagram for ant::ProgressCounter:

Public Types

using Updater_t = std::function< void(std::chrono::duration< double >)>
 

Public Member Functions

 ProgressCounter (Updater_t updater)
 
 ~ProgressCounter ()
 
double GetTotalSecs () const
 

Static Public Member Functions

static void Tick ()
 
static std::string TimeToStr (double secs)
 TimeToStr converts seconds to HH:MM:SS string. More...
 

Static Public Attributes

static long int Interval = 0
 Interval for progress output in seconds. More...
 

Protected Types

using clock_t = std::chrono::steady_clock
 
using timepoint_t = std::chrono::time_point< clock_t >
 
using registry_t = std::list< const ProgressCounter * >
 

Protected Attributes

Updater_t Updater
 
timepoint_t first_now = clock_t::now()
 

Static Protected Attributes

static registry_t registry
 
static timepoint_t last_now = ProgressCounter::clock_t::now()
 

Member Typedef Documentation

◆ clock_t

using ant::ProgressCounter::clock_t = std::chrono::steady_clock
protected

◆ registry_t

using ant::ProgressCounter::registry_t = std::list<const ProgressCounter*>
protected

◆ timepoint_t

using ant::ProgressCounter::timepoint_t = std::chrono::time_point<clock_t>
protected

◆ Updater_t

using ant::ProgressCounter::Updater_t = std::function<void(std::chrono::duration<double>)>

Constructor & Destructor Documentation

◆ ProgressCounter()

ProgressCounter::ProgressCounter ( ProgressCounter::Updater_t  updater)

◆ ~ProgressCounter()

ProgressCounter::~ProgressCounter ( )

Member Function Documentation

◆ GetTotalSecs()

double ProgressCounter::GetTotalSecs ( ) const

◆ Tick()

void ProgressCounter::Tick ( )
static

◆ TimeToStr()

string ProgressCounter::TimeToStr ( double  secs)
static

TimeToStr converts seconds to HH:MM:SS string.

Parameters
secsseconds to convert
Returns
string with format HH:MM:SS

Member Data Documentation

◆ first_now

timepoint_t ant::ProgressCounter::first_now = clock_t::now()
protected

◆ Interval

long int ProgressCounter::Interval = 0
static

Interval for progress output in seconds.

◆ last_now

ProgressCounter::timepoint_t ProgressCounter::last_now = ProgressCounter::clock_t::now()
staticprotected

◆ registry

ProgressCounter::registry_t ProgressCounter::registry
staticprotected

◆ Updater

Updater_t ant::ProgressCounter::Updater
protected

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