27 #ifndef Hypertable_Master_ReferenceManager_h
28 #define Hypertable_Master_ReferenceManager_h
33 #include <unordered_map>
50 std::lock_guard<std::mutex> lock(
m_mutex);
51 if (
m_map.find(operation->id()) !=
m_map.end())
53 m_map[operation->id()] = operation;
62 std::lock_guard<std::mutex> lock(
m_mutex);
63 auto iter =
m_map.find(
id);
64 if (iter ==
m_map.end())
66 return (*iter).second;
72 std::lock_guard<std::mutex> lock(
m_mutex);
73 auto iter =
m_map.find(operation->id());
74 if (iter !=
m_map.end())
81 std::lock_guard<std::mutex> lock(
m_mutex);
91 std::unordered_map<int64_t, OperationPtr>
m_map;
98 #endif // Hypertable_Master_ReferenceManager_h
std::unordered_map< int64_t, OperationPtr > m_map
Reference map.
Declarations for Operation.
Holds references to operations that are to be manually removed.
void clear()
Clears all referenced operations.
bool add(OperationPtr operation)
Adds an operation.
std::mutex m_mutex
Mutex for serializing concurrent access
std::shared_ptr< Operation > OperationPtr
Smart pointer to Operation.