OmniSciDB  7bf56492aa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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

Definition at line 673 of file Logger.cpp.

674  : duration_(newDuration(severity, file, line, name)) {}
Duration * duration_
Definition: Logger.h:296
Duration * newDuration(Severity severity, Ts &&...args)
Definition: Logger.cpp:512
logger::DebugTimer::~DebugTimer ( )

Definition at line 676 of file Logger.cpp.

References stop().

676  {
677  stop();
678 }

+ Here is the call graph for this function:

Member Function Documentation

void logger::DebugTimer::stop ( )

Definition at line 680 of file Logger.cpp.

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

Referenced by ~DebugTimer().

680  {
681  if (duration_) {
682  if (duration_->stop()) {
683  logAndEraseDurationTree(nullptr);
684  }
685  duration_ = nullptr;
686  }
687 }
Duration * duration_
Definition: Logger.h:296
void logAndEraseDurationTree(std::string *json_str)
Definition: Logger.cpp:657

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 689 of file Logger.cpp.

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

689  {
690  std::string json_str;
691  if (duration_) {
692  if (duration_->stop()) {
693  logAndEraseDurationTree(&json_str);
694  }
695  duration_ = nullptr;
696  }
697  return json_str;
698 }
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:657

+ Here is the call graph for this function:

Member Data Documentation

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: