0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::ReferenceManager Class Reference

Holds references to operations that are to be manually removed. More...

#include <ReferenceManager.h>

Collaboration diagram for Hypertable::ReferenceManager:
Collaboration graph
[legend]

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...
 

Detailed Description

Holds references to operations that are to be manually removed.

Definition at line 41 of file ReferenceManager.h.

Member Function Documentation

bool Hypertable::ReferenceManager::add ( OperationPtr  operation)
inline

Adds an operation.

Adds operation to m_map using it's ID as the key.

Parameters
operationSmart pointer to operation to add
Returns
true if successfully added, false if not added because operation already exists in m_map.

Definition at line 49 of file ReferenceManager.h.

void Hypertable::ReferenceManager::clear ( )
inline

Clears all referenced operations.

Clears m_map.

Definition at line 80 of file ReferenceManager.h.

OperationPtr Hypertable::ReferenceManager::get ( int64_t  id)
inline

Fetches an operation given its id.

Looks up id in m_map and returns the operation to which it maps.

Returns
Operation associated with id, nullptr if not found

Definition at line 61 of file ReferenceManager.h.

void Hypertable::ReferenceManager::remove ( OperationPtr  operation)
inline

Remove an operation.

Parameters
operationOperation for which to remove.

Definition at line 71 of file ReferenceManager.h.

Member Data Documentation

std::unordered_map<int64_t, OperationPtr> Hypertable::ReferenceManager::m_map
private

Reference map.

Definition at line 91 of file ReferenceManager.h.

std::mutex Hypertable::ReferenceManager::m_mutex
private

Mutex for serializing concurrent access

Definition at line 88 of file ReferenceManager.h.


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