maliput
|
A container for a set of unique objects which keeps track of the original insertion order.
Its primary purpose is to assign a stable unique index to each element at time of insertion.
T | the inserted element type |
Hash | a hasher suitable for std::unordered_map (e.g., std::hash) |
KeyEqual | an equivalence relation suitable for std::unordered_map (e.g., std::equal_to) |
#include <include/maliput/utility/mesh.h>
Public Member Functions | |
UniqueIndexer ()=default | |
Creates an empty UniqueIndexer. More... | |
int | push_back (const T &thing) |
Pushes thing onto the back of this container, and returns the unique index for thing . More... | |
const std::vector< const T * > & | vector () const |
Returns a vector of all elements added to this container. More... | |
|
default |
Creates an empty UniqueIndexer.
int push_back | ( | const T & | thing | ) |
Pushes thing
onto the back of this container, and returns the unique index for thing
.
If thing
has already been added to the container, then this simply returns the original index for thing
.
const std::vector<const T*>& vector | ( | ) | const |
Returns a vector of all elements added to this container.
The index of any element in the vector equals the index generated when the element was added to the container.