Holds references to operations that are to be manually removed. More...
#include <ReferenceManager.h>

Public Member Functions | |
| bool | add (OperationPtr operation) |
| Adds an operation. More... | |
| OperationPtr | get (int64_t id) |
Fetches an operation given its id. More... | |
| void | remove (OperationPtr operation) |
| Remove an operation. More... | |
| void | clear () |
| Clears all referenced operations. More... | |
Private Attributes | |
| std::mutex | m_mutex |
| Mutex for serializing concurrent access More... | |
| std::unordered_map< int64_t, OperationPtr > | m_map |
| Reference map. More... | |
Holds references to operations that are to be manually removed.
Definition at line 41 of file ReferenceManager.h.
|
inline |
Adds an operation.
Adds operation to m_map using it's ID as the key.
| operation | Smart pointer to operation to add |
Definition at line 49 of file ReferenceManager.h.
|
inline |
|
inline |
Fetches an operation given its id.
Looks up id in m_map and returns the operation to which it maps.
id, nullptr if not found Definition at line 61 of file ReferenceManager.h.
|
inline |
Remove an operation.
| operation | Operation for which to remove. |
Definition at line 71 of file ReferenceManager.h.
|
private |
Reference map.
Definition at line 91 of file ReferenceManager.h.
|
private |
Mutex for serializing concurrent access
Definition at line 88 of file ReferenceManager.h.
1.8.8