OmniSciDB  baf940c279
logger::DebugTimer Class Reference

#include <Logger.h>

+ Collaboration diagram for logger::DebugTimer:

Public Member Functions

 DebugTimer (Severity, char const *file, int line, char const *name)
 
 ~DebugTimer ()
 
void stop ()
 
std::string stopAndGetJson ()
 

Private Attributes

Durationduration_
 

Detailed Description

Definition at line 295 of file Logger.h.

Constructor & Destructor Documentation

◆ DebugTimer()

logger::DebugTimer::DebugTimer ( Severity  severity,
char const *  file,
int  line,
char const *  name 
)

Definition at line 691 of file Logger.cpp.

692  : duration_(newDuration(severity, file, line, name)) {}
Duration * newDuration(Severity severity, Ts &&... args)
Definition: Logger.cpp:530
Duration * duration_
Definition: Logger.h:296
name
Definition: setup.py:35

◆ ~DebugTimer()

logger::DebugTimer::~DebugTimer ( )

Definition at line 694 of file Logger.cpp.

References stop().

694  {
695  stop();
696 }
+ Here is the call graph for this function:

Member Function Documentation

◆ stop()

void logger::DebugTimer::stop ( )

Definition at line 698 of file Logger.cpp.

References duration_, logger::logAndEraseDurationTree(), and logger::Duration::stop().

Referenced by ~DebugTimer().

698  {
699  if (duration_) {
700  if (duration_->stop()) {
701  logAndEraseDurationTree(nullptr);
702  }
703  duration_ = nullptr;
704  }
705 }
Duration * duration_
Definition: Logger.h:296
void logAndEraseDurationTree(std::string *json_str)
Definition: Logger.cpp:675
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stopAndGetJson()

std::string logger::DebugTimer::stopAndGetJson ( )

Definition at line 707 of file Logger.cpp.

References duration_, json_str(), logger::logAndEraseDurationTree(), and logger::Duration::stop().

707  {
708  std::string json_str;
709  if (duration_) {
710  if (duration_->stop()) {
711  logAndEraseDurationTree(&json_str);
712  }
713  duration_ = nullptr;
714  }
715  return json_str;
716 }
const std::string json_str(const rapidjson::Value &obj) noexcept
Definition: JsonAccessors.h:44
Duration * duration_
Definition: Logger.h:296
void logAndEraseDurationTree(std::string *json_str)
Definition: Logger.cpp:675
+ Here is the call graph for this function:

Member Data Documentation

◆ duration_

Duration* logger::DebugTimer::duration_
private

Definition at line 296 of file Logger.h.

Referenced by stop(), and stopAndGetJson().


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