OmniSciDB  29e35f4d58
logger::Duration Class Reference
+ Collaboration diagram for logger::Duration:

Public Member Functions

 Duration (DurationTree *duration_tree, int depth, Severity severity, char const *file, int line, char const *name)
 
bool stop ()
 
template<typename Units = std::chrono::milliseconds>
Units::rep value () const
 

Public Attributes

int const depth_
 
Severity const severity_
 
char const *const file_
 
int const line_
 
char const *const name_
 

Private Attributes

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

Detailed Description

Definition at line 408 of file Logger.cpp.

Constructor & Destructor Documentation

◆ Duration()

logger::Duration::Duration ( DurationTree duration_tree,
int  depth,
Severity  severity,
char const *  file,
int  line,
char const *  name 
)
inline

Definition at line 420 of file Logger.cpp.

426  : duration_tree_(duration_tree)
427  , start_(Clock::now())
428  , depth_(depth)
429  , severity_(severity)
430  , file_(file)
431  , line_(line)
432  , name_(name) {}
Clock::time_point const start_
Definition: Logger.cpp:410
char const *const name_
Definition: Logger.cpp:418
int const line_
Definition: Logger.cpp:417
int const depth_
Definition: Logger.cpp:414
DurationTree *const duration_tree_
Definition: Logger.cpp:409
char const *const file_
Definition: Logger.cpp:416
Severity const severity_
Definition: Logger.cpp:415

Member Function Documentation

◆ stop()

bool logger::Duration::stop ( )

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

Definition at line 473 of file Logger.cpp.

Referenced by logger::DebugTimer::stop().

473  {
474  stop_ = Clock::now();
476  return depth_ == 0;
477 }
int const depth_
Definition: Logger.cpp:414
DurationTree *const duration_tree_
Definition: Logger.cpp:409
Clock::time_point stop_
Definition: Logger.cpp:411
+ Here is the caller graph for this function:

◆ value()

template<typename Units = std::chrono::milliseconds>
Units::rep logger::Duration::value ( ) const
inline

Definition at line 435 of file Logger.cpp.

Referenced by logger::operator<<().

435  {
436  return std::chrono::duration_cast<Units>(stop_ - start_).count();
437  }
Clock::time_point const start_
Definition: Logger.cpp:410
Clock::time_point stop_
Definition: Logger.cpp:411
+ Here is the caller graph for this function:

Member Data Documentation

◆ depth_

int const logger::Duration::depth_

Definition at line 414 of file Logger.cpp.

Referenced by logger::operator<<().

◆ duration_tree_

DurationTree* const logger::Duration::duration_tree_
private

Definition at line 409 of file Logger.cpp.

◆ file_

char const* const logger::Duration::file_

Definition at line 416 of file Logger.cpp.

Referenced by logger::operator<<().

◆ line_

int const logger::Duration::line_

Definition at line 417 of file Logger.cpp.

Referenced by logger::operator<<().

◆ name_

char const* const logger::Duration::name_

Definition at line 418 of file Logger.cpp.

Referenced by logger::operator<<().

◆ severity_

Severity const logger::Duration::severity_

Definition at line 415 of file Logger.cpp.

◆ start_

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

Definition at line 410 of file Logger.cpp.

◆ stop_

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

Definition at line 411 of file Logger.cpp.


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