OmniSciDB  a5dc49c757
 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 994 of file DBHandler.h.

Member Function Documentation

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

Definition at line 1007 of file DBHandler.h.

References CHECK.

Referenced by DBHandler::sql_execute_impl().

1007  {
1008  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1009  const auto ret = was_deferred_copy_from.insert(std::make_pair(session_id, state));
1010  CHECK(ret.second);
1011  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:995
#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 998 of file DBHandler.h.

998  {
999  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1000  auto itr = was_deferred_copy_from.find(session_id);
1001  if (itr == was_deferred_copy_from.end()) {
1002  return std::nullopt;
1003  }
1004  return itr->second;
1005  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:995
void DBHandler::DeferredCopyFromSessions::remove ( const std::string &  session_id)
inline

Definition at line 1013 of file DBHandler.h.

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

1013  {
1014  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1015  was_deferred_copy_from.erase(session_id);
1016  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:995

+ Here is the caller graph for this function:

Member Data Documentation

std::mutex DBHandler::DeferredCopyFromSessions::deferred_copy_from_mutex

Definition at line 996 of file DBHandler.h.

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

Definition at line 995 of file DBHandler.h.


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