Camargue
|
Hash map for node pairs representing edges. More...
#include <edgehash.hpp>
Classes | |
struct | eh_impl |
Public Member Functions | |
EdgeHash (int size) | |
An EdgeHash for approximately size elements. | |
EdgeHash (const EdgeHash &eh)=delete | |
No copy constructor. | |
EdgeHash & | operator= (const EdgeHash &eh)=delete |
No copy assign. | |
void | add (int end1, int end2, int val) |
Add a pair. More... | |
void | set (int end1, int end2, int val) |
Set val for existing pair. More... | |
void | erase (int end1, int end2) |
Delete a pair. More... | |
std::vector< Graph::Edge > | get_all () |
Get a vector of all the edges. | |
void | clear () |
Clear all the edges from the hash. | |
int | get_val (int end1, int end2) |
Get the val for an edge. | |
Private Attributes | |
std::unique_ptr< eh_impl > | eh_pimpl |
The hash table implementation. More... | |
Hash map for node pairs representing edges.
void CMR::util::EdgeHash::add | ( | int | end1, |
int | end2, | ||
int | val | ||
) |
Add a pair.
Add the edge with endpoints end1
and end2
to the EdgeHash, with lookup value set to val
.
void CMR::util::EdgeHash::erase | ( | int | end1, |
int | end2 | ||
) |
Delete a pair.
Erase the edge with endpoints end1
end2
from the EdgeHash.
void CMR::util::EdgeHash::set | ( | int | end1, |
int | end2, | ||
int | val | ||
) |
Set val for existing pair.
If the edge with endpoints end1
end2
is already in the EdgeHash, set its value to val
.
|
private |
The hash table implementation.
Pimpl idiom firewall.