OmniSciDB  6686921089
 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 484 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 496 of file Logger.cpp.

502  : duration_tree_(duration_tree)
503  , start_(Clock::now())
504  , depth_(depth)
505  , severity_(severity)
506  , file_(file)
507  , line_(line)
508  , name_(name) {}
Clock::time_point const start_
Definition: Logger.cpp:486
string name
Definition: setup.in.py:72
char const *const name_
Definition: Logger.cpp:494
int const line_
Definition: Logger.cpp:493
int const depth_
Definition: Logger.cpp:490
DurationTree *const duration_tree_
Definition: Logger.cpp:485
tuple line
Definition: parse_ast.py:10
char const *const file_
Definition: Logger.cpp:492
Severity const severity_
Definition: Logger.cpp:491

Member Function Documentation

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

Definition at line 561 of file Logger.cpp.

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

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

561  {
562  return std::chrono::duration_cast<Units>(start_ - duration_tree_->start_).count();
563 }
Clock::time_point const start_
Definition: Logger.cpp:486
Clock::time_point const start_
Definition: Logger.cpp:527
int count
DurationTree *const duration_tree_
Definition: Logger.cpp:485

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

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

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

554  {
555  stop_ = Clock::now();
557  return depth_ == 0;
558 }
int const depth_
Definition: Logger.cpp:490
DurationTree *const duration_tree_
Definition: Logger.cpp:485
Clock::time_point stop_
Definition: Logger.cpp:487

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

References count, start_, and stop_.

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

566  {
567  return std::chrono::duration_cast<Units>(stop_ - start_).count();
568 }
Clock::time_point const start_
Definition: Logger.cpp:486
int count
Clock::time_point stop_
Definition: Logger.cpp:487

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

Referenced by relative_start_time(), and stop().

char const* const logger::Duration::file_

Definition at line 492 of file Logger.cpp.

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

int const logger::Duration::line_

Definition at line 493 of file Logger.cpp.

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

char const* const logger::Duration::name_

Definition at line 494 of file Logger.cpp.

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

Severity const logger::Duration::severity_

Definition at line 491 of file Logger.cpp.

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

Definition at line 486 of file Logger.cpp.

Referenced by relative_start_time(), and value().

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

Definition at line 487 of file Logger.cpp.

Referenced by stop(), and value().


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