Sierra Toolkit  Version of the Day
stk_classic::diag::Timer::Metric< T > Struct Template Reference

#include <Timer.hpp>

Inheritance diagram for stk_classic::diag::Timer::Metric< T >:

Public Member Functions

void reset ()
 
MetricTraits< T >::Type addLap ()
 
void checkpoint () const
 
MetricTraits< T >::Type getLap () const
 
MetricTraits< T >::Type getStart () const
 
MetricTraits< T >::Type getStop () const
 
MetricTraits< T >::Type getAccumulatedLap (bool arg_checkpoint=false) const
 
Writerdump (Writer &dout) const
 

Public Attributes

MetricTraits< T >::Type m_lapStart
 Most recent start time/count.
 
MetricTraits< T >::Type m_lapStop
 Most recent stop or lap time/count.
 
MetricTraits< T >::Type m_accumulatedLap
 Accumulated time/count.
 
MetricTraits< T >::Type m_checkpoint
 Checkpointed time/count.
 

Detailed Description

template<typename T>
struct stk_classic::diag::Timer::Metric< T >

Class Metric maintains the metric data for the timer or counter. The start and stop times maintain the current lap time. When a lap completes, its time/count is accumlated to the total. The total time/count can be stored in the checkpoint member variable. The total can be retrieved as either absolute time/count the diffence from the checkpoint value.

Definition at line 205 of file Timer.hpp.

Member Function Documentation

◆ reset()

template<typename T>
void stk_classic::diag::Timer::Metric< T >::reset ( )
inline

Member function reset resets the metric values to zero.

Definition at line 218 of file Timer.hpp.

◆ addLap()

template<typename T>
MetricTraits<T>::Type stk_classic::diag::Timer::Metric< T >::addLap ( )
inline

Member function addLap adds the most recently completed lap to the total.

Returns
a T value of the total.

Definition at line 227 of file Timer.hpp.

◆ checkpoint()

template<typename T>
void stk_classic::diag::Timer::Metric< T >::checkpoint ( ) const
inline

Member function checkpoint checkpoints the metrics by storing the total time in the checkpoint value.

Definition at line 236 of file Timer.hpp.

◆ getLap()

template<typename T>
MetricTraits<T>::Type stk_classic::diag::Timer::Metric< T >::getLap ( ) const
inline

Member function getLap returns the value of the most recently lap.

Returns
a T value of the most recent lap.

Definition at line 246 of file Timer.hpp.

◆ getStart()

template<typename T>
MetricTraits<T>::Type stk_classic::diag::Timer::Metric< T >::getStart ( ) const
inline

Member function getStart returns the start value of the most recent lap.

Returns
a T value of the start of the most recent lap.

Definition at line 255 of file Timer.hpp.

◆ getStop()

template<typename T>
MetricTraits<T>::Type stk_classic::diag::Timer::Metric< T >::getStop ( ) const
inline

Member function getStop returns the stop value of the most recent lap.

Returns
a T value of the stop of the most recent lap.

Definition at line 264 of file Timer.hpp.

◆ getAccumulatedLap()

template<typename T>
MetricTraits<T>::Type stk_classic::diag::Timer::Metric< T >::getAccumulatedLap ( bool  arg_checkpoint = false) const
inline

Member function getAccumulatedLap returns the accumulated value of the metric. If the checkpoint parameter if true, the value returned is the difference between the accumulated value and the checkpointed value.

Parameters
checkpointa bool value of true of the checkpointed value is to be returned.
Returns
a T value of the accumulated or the checkpoint difference.

Definition at line 279 of file Timer.hpp.

◆ dump()

template<class T >
template Writer & stk_classic::diag::Timer::Metric< T >::dump ( Writer dout) const

Member function dump prints the value of the Metric to the diagnostic writer.

Parameters
douta Writer reference to the diagnostic writer to write to.
Returns
a Writer reference to the diagnostic writer.

Definition at line 848 of file Timer.cpp.


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