OmniSciDB  b28c0d5765
 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 *duration_tree, int depth, Severity severity, char const *file, int line, char const *name)
 
bool stop ()
 
template<typename Units = std::chrono::milliseconds>
Units::rep relative_start_time () const
 
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 502 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 514 of file Logger.cpp.

520  : duration_tree_(duration_tree)
521  , start_(Clock::now())
522  , depth_(depth)
523  , severity_(severity)
524  , file_(file)
525  , line_(line)
526  , name_(name) {}
Clock::time_point const start_
Definition: Logger.cpp:504
char const *const name_
Definition: Logger.cpp:512
int const line_
Definition: Logger.cpp:511
int const depth_
Definition: Logger.cpp:508
DurationTree *const duration_tree_
Definition: Logger.cpp:503
tuple line
Definition: parse_ast.py:10
char const *const file_
Definition: Logger.cpp:510
string name
Definition: setup.in.py:72
Severity const severity_
Definition: Logger.cpp:509

Member Function Documentation

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

Definition at line 579 of file Logger.cpp.

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

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

579  {
580  return std::chrono::duration_cast<Units>(start_ - duration_tree_->start_).count();
581 }
Clock::time_point const start_
Definition: Logger.cpp:504
Clock::time_point const start_
Definition: Logger.cpp:545
DurationTree *const duration_tree_
Definition: Logger.cpp:503

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

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

Referenced by logger::DebugTimer::stop(), and logger::DebugTimer::stopAndGetJson().

572  {
573  stop_ = Clock::now();
575  return depth_ == 0;
576 }
int const depth_
Definition: Logger.cpp:508
DurationTree *const duration_tree_
Definition: Logger.cpp:503
Clock::time_point stop_
Definition: Logger.cpp:505

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 584 of file Logger.cpp.

References start_, and stop_.

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

584  {
585  return std::chrono::duration_cast<Units>(stop_ - start_).count();
586 }
Clock::time_point const start_
Definition: Logger.cpp:504
Clock::time_point stop_
Definition: Logger.cpp:505

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 503 of file Logger.cpp.

Referenced by relative_start_time(), and stop().

char const* const logger::Duration::file_

Definition at line 510 of file Logger.cpp.

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

int const logger::Duration::line_

Definition at line 511 of file Logger.cpp.

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

char const* const logger::Duration::name_

Definition at line 512 of file Logger.cpp.

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

Severity const logger::Duration::severity_

Definition at line 509 of file Logger.cpp.

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

Definition at line 504 of file Logger.cpp.

Referenced by relative_start_time(), and value().

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

Definition at line 505 of file Logger.cpp.

Referenced by stop(), and value().


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