OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
logger::QidScopeGuard Class Reference

#include <Logger.h>

Public Member Functions

 QidScopeGuard (QueryId const id)
 
 QidScopeGuard (QidScopeGuard const &)=delete
 
QidScopeGuardoperator= (QidScopeGuard const &)=delete
 
 QidScopeGuard (QidScopeGuard &&that)
 
QidScopeGuardoperator= (QidScopeGuard &&that)
 
 ~QidScopeGuard ()
 
QueryId id () const
 

Private Attributes

QueryId id_
 

Detailed Description

Definition at line 325 of file Logger.h.

Constructor & Destructor Documentation

logger::QidScopeGuard::QidScopeGuard ( QueryId const  id)
inline

Definition at line 329 of file Logger.h.

329 : id_{id} {}
logger::QidScopeGuard::QidScopeGuard ( QidScopeGuard const )
delete
logger::QidScopeGuard::QidScopeGuard ( QidScopeGuard &&  that)
inline

Definition at line 332 of file Logger.h.

332 : id_(that.id_) { that.id_ = 0; }
logger::QidScopeGuard::~QidScopeGuard ( )

Definition at line 458 of file Logger.cpp.

References logger::g_query_id, and id_.

458  {
459  if (id_) {
460  // Ideally this CHECK would be enabled, but it's too heavy for a destructor.
461  // Would be ok for DEBUG mode.
462  // CHECK(g_query_id.compare_exchange_strong(id_, 0));
463  g_query_id = 0;
464  }
465 }
thread_local std::atomic< QueryId > g_query_id
Definition: Logger.cpp:452

Member Function Documentation

QueryId logger::QidScopeGuard::id ( ) const
inline

Definition at line 339 of file Logger.h.

References id_.

339 { return id_; }
QidScopeGuard& logger::QidScopeGuard::operator= ( QidScopeGuard const )
delete
QidScopeGuard& logger::QidScopeGuard::operator= ( QidScopeGuard &&  that)
inline

Definition at line 333 of file Logger.h.

References id_.

333  {
334  id_ = that.id_;
335  that.id_ = 0;
336  return *this;
337  }

Member Data Documentation

QueryId logger::QidScopeGuard::id_
private

Definition at line 326 of file Logger.h.

Referenced by id(), operator=(), and ~QidScopeGuard().


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