OmniSciDB  a5dc49c757
 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 572 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 581 of file Logger.cpp.

584  : duration_tree_(duration_tree)
585  , start_(Clock::now())
586  , depth_(depth)
587  , debug_timer_params_(debug_timer_params) {}
Clock::time_point const start_
Definition: Logger.cpp:574
int const depth_
Definition: Logger.cpp:578
DurationTree *const duration_tree_
Definition: Logger.cpp:573
DebugTimerParams const debug_timer_params_
Definition: Logger.cpp:579

Member Function Documentation

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

Definition at line 595 of file Logger.cpp.

References debug_timer_params_.

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

Definition at line 640 of file Logger.cpp.

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

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

640  {
641  return std::chrono::duration_cast<Units>(start_ - duration_tree_->start_).count();
642 }
Clock::time_point const start_
Definition: Logger.cpp:574
Clock::time_point const start_
Definition: Logger.cpp:607
DurationTree *const duration_tree_
Definition: Logger.cpp:573

+ 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 633 of file Logger.cpp.

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

633  {
634  stop_ = Clock::now();
636  return depth_ == 0;
637 }
int const depth_
Definition: Logger.cpp:578
DurationTree *const duration_tree_
Definition: Logger.cpp:573
Clock::time_point stop_
Definition: Logger.cpp:575

+ Here is the call graph for this function:

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

Definition at line 645 of file Logger.cpp.

References start_, and stop_.

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

645  {
646  return std::chrono::duration_cast<Units>(stop_ - start_).count();
647 }
Clock::time_point const start_
Definition: Logger.cpp:574
Clock::time_point stop_
Definition: Logger.cpp:575

+ Here is the caller graph for this function:

Member Data Documentation

DebugTimerParams const logger::Duration::debug_timer_params_

Definition at line 579 of file Logger.cpp.

Referenced by operator->().

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

Definition at line 573 of file Logger.cpp.

Referenced by relative_start_time(), and stop().

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

Definition at line 574 of file Logger.cpp.

Referenced by relative_start_time(), and value().

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

Definition at line 575 of file Logger.cpp.

Referenced by stop(), and value().


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