mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Friends
m::Timer::Measurement Struct Reference

#include <Timer.hpp>

Collaboration diagram for m::Timer::Measurement:
[legend]

Public Member Functions

 Measurement (std::string name, time_point begin=time_point(), time_point end=time_point())
 
void clear ()
 Clear this Measurement, rendering it unused.
 
void start ()
 Start this Measurement by setting the start time point to NOW.
 
void stop ()
 Stop this Measurement by setting the end time point to NOW.
 
bool is_unused () const
 Returns true iff the Measurement is unused, i.e.
 
bool has_started () const
 Returns true iff this Measurement has begun.
 
bool has_ended () const
 Returns true iff this Measurement has ended.
 
bool is_active () const
 Returns true iff this Measurement is currently in process.
 
bool is_finished () const
 Returns true iff this Measurement has completed.
 
duration duration () const
 Returns the duration of a finished Measurement.
 
void dump (std::ostream &out) const
 
void dump () const
 

Data Fields

std::string name
 the name of this Measurement
 
time_point begin
 
time_point end
 the begin and end time points of this Measurement
 

Friends

std::ostream & operator<< (std::ostream &out, const Measurement &M)
 

Detailed Description

Definition at line 43 of file Timer.hpp.

Constructor & Destructor Documentation

◆ Measurement()

m::Timer::Measurement::Measurement ( std::string  name,
time_point  begin = time_point(),
time_point  end = time_point() 
)
inlineexplicit

Definition at line 48 of file Timer.hpp.

Member Function Documentation

◆ clear()

void m::Timer::Measurement::clear ( )
inline

Clear this Measurement, rendering it unused.

Definition at line 55 of file Timer.hpp.

References begin, and end.

◆ dump() [1/2]

void Timer::Measurement::dump ( ) const

Definition at line 24 of file Timer.cpp.

References m::Timer::dump().

◆ dump() [2/2]

void Timer::Measurement::dump ( std::ostream &  out) const

Definition at line 23 of file Timer.cpp.

◆ duration()

duration m::Timer::Measurement::duration ( ) const
inline

Returns the duration of a finished Measurement.

Definition at line 85 of file Timer.hpp.

References begin, end, is_finished(), and M_insist.

◆ has_ended()

bool m::Timer::Measurement::has_ended ( ) const
inline

Returns true iff this Measurement has ended.

Definition at line 78 of file Timer.hpp.

References end.

Referenced by is_active(), is_finished(), and is_unused().

◆ has_started()

bool m::Timer::Measurement::has_started ( ) const
inline

Returns true iff this Measurement has begun.

Definition at line 76 of file Timer.hpp.

References begin.

Referenced by is_active(), is_finished(), and is_unused().

◆ is_active()

bool m::Timer::Measurement::is_active ( ) const
inline

Returns true iff this Measurement is currently in process.

Definition at line 80 of file Timer.hpp.

References m::and, has_ended(), and has_started().

Referenced by stop().

◆ is_finished()

bool m::Timer::Measurement::is_finished ( ) const
inline

Returns true iff this Measurement has completed.

Definition at line 82 of file Timer.hpp.

References m::and, has_ended(), and has_started().

Referenced by duration().

◆ is_unused()

bool m::Timer::Measurement::is_unused ( ) const
inline

Returns true iff the Measurement is unused, i.e.

has not started (and hence also not finished).

Definition at line 70 of file Timer.hpp.

References has_ended(), has_started(), and M_insist.

Referenced by start().

◆ start()

void m::Timer::Measurement::start ( )
inline

Start this Measurement by setting the start time point to NOW.

Definition at line 58 of file Timer.hpp.

References begin, is_unused(), and M_insist.

◆ stop()

void m::Timer::Measurement::stop ( )
inline

Stop this Measurement by setting the end time point to NOW.

Definition at line 64 of file Timer.hpp.

References end, is_active(), and M_insist.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const Measurement M 
)
friend

Field Documentation

◆ begin

time_point m::Timer::Measurement::begin

Definition at line 46 of file Timer.hpp.

Referenced by clear(), duration(), has_started(), and start().

◆ end

time_point m::Timer::Measurement::end

the begin and end time points of this Measurement

Definition at line 46 of file Timer.hpp.

Referenced by clear(), duration(), has_ended(), and stop().

◆ name

std::string m::Timer::Measurement::name

the name of this Measurement

Definition at line 45 of file Timer.hpp.


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