OmniSciDB  2e3a973ef4
DBHandler::GeoCopyFromSessions Struct Reference

Public Member Functions

std::optional< GeoCopyFromStateoperator() (const std::string &session_id)
 
void add (const std::string &session_id, const GeoCopyFromState &state)
 
void remove (const std::string &session_id)
 

Public Attributes

std::unordered_map< std::string, GeoCopyFromStatewas_geo_copy_from
 
std::mutex geo_copy_from_mutex
 

Detailed Description

Definition at line 799 of file DBHandler.h.

Member Function Documentation

◆ add()

void DBHandler::GeoCopyFromSessions::add ( const std::string &  session_id,
const GeoCopyFromState state 
)
inline

Definition at line 812 of file DBHandler.h.

References CHECK.

Referenced by DBHandler::sql_execute_impl().

812  {
813  std::lock_guard<std::mutex> map_lock(geo_copy_from_mutex);
814  const auto ret = was_geo_copy_from.insert(std::make_pair(session_id, state));
815  CHECK(ret.second);
816  }
std::unordered_map< std::string, GeoCopyFromState > was_geo_copy_from
Definition: DBHandler.h:800
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ operator()()

std::optional<GeoCopyFromState> DBHandler::GeoCopyFromSessions::operator() ( const std::string &  session_id)
inline

Definition at line 803 of file DBHandler.h.

803  {
804  std::lock_guard<std::mutex> map_lock(geo_copy_from_mutex);
805  auto itr = was_geo_copy_from.find(session_id);
806  if (itr == was_geo_copy_from.end()) {
807  return std::nullopt;
808  }
809  return itr->second;
810  }
std::unordered_map< std::string, GeoCopyFromState > was_geo_copy_from
Definition: DBHandler.h:800

◆ remove()

void DBHandler::GeoCopyFromSessions::remove ( const std::string &  session_id)
inline

Definition at line 818 of file DBHandler.h.

Referenced by DBHandler::sql_execute().

818  {
819  std::lock_guard<std::mutex> map_lock(geo_copy_from_mutex);
820  was_geo_copy_from.erase(session_id);
821  }
std::unordered_map< std::string, GeoCopyFromState > was_geo_copy_from
Definition: DBHandler.h:800
+ Here is the caller graph for this function:

Member Data Documentation

◆ geo_copy_from_mutex

std::mutex DBHandler::GeoCopyFromSessions::geo_copy_from_mutex

Definition at line 801 of file DBHandler.h.

◆ was_geo_copy_from

std::unordered_map<std::string, GeoCopyFromState> DBHandler::GeoCopyFromSessions::was_geo_copy_from

Definition at line 800 of file DBHandler.h.


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