OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 401 of file Logger.cpp.

Constructor & Destructor Documentation

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

Definition at line 413 of file Logger.cpp.

419  : duration_tree_(duration_tree)
420  , start_(Clock::now())
421  , depth_(depth)
422  , severity_(severity)
423  , file_(file)
424  , line_(line)
425  , name_(name) {}
Clock::time_point const start_
Definition: Logger.cpp:403
char const *const name_
Definition: Logger.cpp:411
int const line_
Definition: Logger.cpp:410
int const depth_
Definition: Logger.cpp:407
DurationTree *const duration_tree_
Definition: Logger.cpp:402
char const *const file_
Definition: Logger.cpp:409
Severity const severity_
Definition: Logger.cpp:408

Member Function Documentation

bool logger::Duration::stop ( )

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

Definition at line 466 of file Logger.cpp.

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

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

466  {
467  stop_ = Clock::now();
469  return depth_ == 0;
470 }
int const depth_
Definition: Logger.cpp:407
DurationTree *const duration_tree_
Definition: Logger.cpp:402
Clock::time_point stop_
Definition: Logger.cpp:404

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 428 of file Logger.cpp.

References start_, and stop_.

Referenced by logger::operator<<().

428  {
429  return std::chrono::duration_cast<Units>(stop_ - start_).count();
430  }
Clock::time_point const start_
Definition: Logger.cpp:403
Clock::time_point stop_
Definition: Logger.cpp:404

+ Here is the caller graph for this function:

Member Data Documentation

int const logger::Duration::depth_

Definition at line 407 of file Logger.cpp.

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

DurationTree* const logger::Duration::duration_tree_
private

Definition at line 402 of file Logger.cpp.

Referenced by stop().

char const* const logger::Duration::file_

Definition at line 409 of file Logger.cpp.

Referenced by logger::operator<<().

int const logger::Duration::line_

Definition at line 410 of file Logger.cpp.

Referenced by logger::operator<<().

char const* const logger::Duration::name_

Definition at line 411 of file Logger.cpp.

Referenced by logger::operator<<().

Severity const logger::Duration::severity_

Definition at line 408 of file Logger.cpp.

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

Definition at line 403 of file Logger.cpp.

Referenced by value().

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

Definition at line 404 of file Logger.cpp.

Referenced by stop(), and value().


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