OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
logger::LocalIdsScopeGuard Class Reference

#include <Logger.h>

+ Collaboration diagram for logger::LocalIdsScopeGuard:

Public Member Functions

 LocalIdsScopeGuard (ThreadLocalIds const prev_local_ids, ThreadLocalIds const thread_local_ids)
 LocalIdsScopeGuard (LocalIdsScopeGuard &&rhs)
LocalIdsScopeGuardoperator= (LocalIdsScopeGuard &&rhs)
 ~LocalIdsScopeGuard ()

Private Member Functions

 LocalIdsScopeGuard (LocalIdsScopeGuard const &)=default
LocalIdsScopeGuardoperator= (LocalIdsScopeGuard const &)=default

Private Attributes

ThreadLocalIds prev_local_ids_
ThreadLocalIds thread_local_ids_
bool enabled_

Detailed Description

Definition at line 152 of file Logger.h.

Constructor & Destructor Documentation

logger::LocalIdsScopeGuard::LocalIdsScopeGuard ( LocalIdsScopeGuard const &  )
logger::LocalIdsScopeGuard::LocalIdsScopeGuard ( ThreadLocalIds const  prev_local_ids,
ThreadLocalIds const  thread_local_ids 

Definition at line 167 of file Logger.h.

169  : prev_local_ids_(prev_local_ids)
171  , enabled_(true) {}
ThreadLocalIds thread_local_ids_
Definition: Logger.h:156
ThreadLocalIds prev_local_ids_
Definition: Logger.h:153
ThreadLocalIds thread_local_ids()
Definition: Logger.cpp:880
logger::LocalIdsScopeGuard::LocalIdsScopeGuard ( LocalIdsScopeGuard &&  rhs)

Definition at line 177 of file Logger.h.

References enabled_.

177  : LocalIdsScopeGuard(rhs) {
178  // clang-format on
179  rhs.enabled_ = false;
180  }
LocalIdsScopeGuard(LocalIdsScopeGuard const &)=default
logger::LocalIdsScopeGuard::~LocalIdsScopeGuard ( )

Definition at line 544 of file Logger.cpp.

References CHECK_EQ, enabled_, logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), prev_local_ids_, logger::ThreadLocalIds::request_id_, logger::ThreadLocalIds::thread_id_, and thread_local_ids_.

544  {
545  if (enabled_) {
546 #ifndef NDEBUG
549 #endif
551  }
552 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
ThreadLocalIds thread_local_ids_
Definition: Logger.h:156
RequestId request_id_
Definition: Logger.h:137
ThreadLocalIds prev_local_ids_
Definition: Logger.h:153
thread_local ThreadLocalIds g_thread_local_ids(0, 0)
ThreadId thread_id_
Definition: Logger.h:138

+ Here is the call graph for this function:

Member Function Documentation

LocalIdsScopeGuard& logger::LocalIdsScopeGuard::operator= ( LocalIdsScopeGuard const &  )
LocalIdsScopeGuard& logger::LocalIdsScopeGuard::operator= ( LocalIdsScopeGuard &&  rhs)

Definition at line 181 of file Logger.h.

References enabled_.

181  {
182  *this = rhs;
183  rhs.enabled_ = false;
184  return *this;
185  }

Member Data Documentation

bool logger::LocalIdsScopeGuard::enabled_

Definition at line 158 of file Logger.h.

Referenced by LocalIdsScopeGuard(), operator=(), and ~LocalIdsScopeGuard().

ThreadLocalIds logger::LocalIdsScopeGuard::prev_local_ids_

Definition at line 153 of file Logger.h.

Referenced by ~LocalIdsScopeGuard().

ThreadLocalIds logger::LocalIdsScopeGuard::thread_local_ids_

Definition at line 156 of file Logger.h.

Referenced by ~LocalIdsScopeGuard().

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