OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBHandler::DeferredCopyFromSessions Struct Reference

Public Member Functions

std::optional
< DeferredCopyFromState
operator() (const std::string &session_id)
 
void add (const std::string &session_id, const DeferredCopyFromState &state)
 
void remove (const std::string &session_id)
 

Public Attributes

std::unordered_map
< std::string,
DeferredCopyFromState
was_deferred_copy_from
 
std::mutex deferred_copy_from_mutex
 

Detailed Description

Definition at line 986 of file DBHandler.h.

Member Function Documentation

void DBHandler::DeferredCopyFromSessions::add ( const std::string &  session_id,
const DeferredCopyFromState state 
)
inline

Definition at line 999 of file DBHandler.h.

References CHECK.

Referenced by DBHandler::sql_execute_impl().

999  {
1000  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1001  const auto ret = was_deferred_copy_from.insert(std::make_pair(session_id, state));
1002  CHECK(ret.second);
1003  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:987
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

std::optional<DeferredCopyFromState> DBHandler::DeferredCopyFromSessions::operator() ( const std::string &  session_id)
inline

Definition at line 990 of file DBHandler.h.

990  {
991  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
992  auto itr = was_deferred_copy_from.find(session_id);
993  if (itr == was_deferred_copy_from.end()) {
994  return std::nullopt;
995  }
996  return itr->second;
997  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:987
void DBHandler::DeferredCopyFromSessions::remove ( const std::string &  session_id)
inline

Definition at line 1005 of file DBHandler.h.

Referenced by DBHandler::process_deferred_copy_from(), and DBHandler::sql_execute().

1005  {
1006  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1007  was_deferred_copy_from.erase(session_id);
1008  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:987

+ Here is the caller graph for this function:

Member Data Documentation

std::mutex DBHandler::DeferredCopyFromSessions::deferred_copy_from_mutex

Definition at line 988 of file DBHandler.h.

std::unordered_map<std::string, DeferredCopyFromState> DBHandler::DeferredCopyFromSessions::was_deferred_copy_from

Definition at line 987 of file DBHandler.h.


The documentation for this struct was generated from the following file: