OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
logger::Duration Class Reference
+ Collaboration diagram for logger::Duration:

Public Member Functions

 Duration (DurationTree *const duration_tree, int const depth, DebugTimerParams const debug_timer_params)
 
bool stop ()
 
template<typename Units = std::chrono::milliseconds>
Units::rep relative_start_time () const
 
template<typename Units = std::chrono::milliseconds>
Units::rep value () const
 
DebugTimerParams const * operator-> () const
 

Public Attributes

int const depth_
 
DebugTimerParams const debug_timer_params_
 

Private Attributes

DurationTree *const duration_tree_
 
Clock::time_point const start_
 
Clock::time_point stop_
 

Detailed Description

Definition at line 566 of file Logger.cpp.

Constructor & Destructor Documentation

logger::Duration::Duration ( DurationTree *const  duration_tree,
int const  depth,
DebugTimerParams const  debug_timer_params 
)
inline

Definition at line 575 of file Logger.cpp.

578  : duration_tree_(duration_tree)
579  , start_(Clock::now())
580  , depth_(depth)
581  , debug_timer_params_(debug_timer_params) {}
Clock::time_point const start_
Definition: Logger.cpp:568
int const depth_
Definition: Logger.cpp:572
DurationTree *const duration_tree_
Definition: Logger.cpp:567
DebugTimerParams const debug_timer_params_
Definition: Logger.cpp:573

Member Function Documentation

DebugTimerParams const* logger::Duration::operator-> ( ) const
inline

Definition at line 589 of file Logger.cpp.

References debug_timer_params_.

589 { return &debug_timer_params_; }
DebugTimerParams const debug_timer_params_
Definition: Logger.cpp:573
template<typename Units >
Units::rep logger::Duration::relative_start_time ( ) const

Definition at line 634 of file Logger.cpp.

References duration_tree_, start_, and logger::DurationTree::start_.

Referenced by logger::JsonEncoder::operator()(), and logger::operator<<().

634  {
635  return std::chrono::duration_cast<Units>(start_ - duration_tree_->start_).count();
636 }
Clock::time_point const start_
Definition: Logger.cpp:568
Clock::time_point const start_
Definition: Logger.cpp:601
DurationTree *const duration_tree_
Definition: Logger.cpp:567

+ Here is the caller graph for this function:

bool logger::Duration::stop ( )

Set stop_, decrement DurationTree::current_depth_. Return true iff this Duration represents the root timer (see docs).

Definition at line 627 of file Logger.cpp.

References logger::DurationTree::decrementDepth(), depth_, duration_tree_, and stop_.

627  {
628  stop_ = Clock::now();
630  return depth_ == 0;
631 }
int const depth_
Definition: Logger.cpp:572
DurationTree *const duration_tree_
Definition: Logger.cpp:567
Clock::time_point stop_
Definition: Logger.cpp:569

+ Here is the call graph for this function:

template<typename Units >
Units::rep logger::Duration::value ( ) const

Definition at line 639 of file Logger.cpp.

References start_, and stop_.

Referenced by logger::JsonEncoder::operator()(), and logger::operator<<().

639  {
640  return std::chrono::duration_cast<Units>(stop_ - start_).count();
641 }
Clock::time_point const start_
Definition: Logger.cpp:568
Clock::time_point stop_
Definition: Logger.cpp:569

+ Here is the caller graph for this function:

Member Data Documentation

DebugTimerParams const logger::Duration::debug_timer_params_

Definition at line 573 of file Logger.cpp.

Referenced by operator->().

int const logger::Duration::depth_
DurationTree* const logger::Duration::duration_tree_
private

Definition at line 567 of file Logger.cpp.

Referenced by relative_start_time(), and stop().

Clock::time_point const logger::Duration::start_
private

Definition at line 568 of file Logger.cpp.

Referenced by relative_start_time(), and value().

Clock::time_point logger::Duration::stop_
private

Definition at line 569 of file Logger.cpp.

Referenced by stop(), and value().


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