OmniSciDB  c0231cc57d
 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 342 of file Logger.h.

Constructor & Destructor Documentation

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

Definition at line 346 of file Logger.h.

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

Definition at line 349 of file Logger.h.

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

Definition at line 477 of file Logger.cpp.

References logger::g_query_id, and id_.

477  {
478  if (id_) {
479  // Ideally this CHECK would be enabled, but it's too heavy for a destructor.
480  // Would be ok for DEBUG mode.
481  // CHECK(g_query_id.compare_exchange_strong(id_, 0));
482  g_query_id = 0;
483  }
484 }
thread_local std::atomic< QueryId > g_query_id
Definition: Logger.cpp:471

Member Function Documentation

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

Definition at line 356 of file Logger.h.

References id_.

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

Definition at line 350 of file Logger.h.

References id_.

350  {
351  id_ = that.id_;
352  that.id_ = 0;
353  return *this;
354  }

Member Data Documentation

QueryId logger::QidScopeGuard::id_
private

Definition at line 343 of file Logger.h.

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


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