Robowflex
v0.1
Making MoveIt Easy
|
Adds functionality to uniquely ID a specific class as well as the "version" of that class, managed by an incrementing counter. More...
#include <id.h>
Public Types | |
using | Key = std::pair< std::string, std::size_t > |
A snapshot of the state of an ID. Can be compared against another ID. More... | |
Public Member Functions | |
ID () | |
Constructor. More... | |
const std::string & | getID () const |
Get the unique ID for this object. More... | |
std::size_t | getVersion () const |
Get the current version of this object. More... | |
Key | getKey () const |
Get this ID as a Key. More... | |
bool | operator== (const ID &b) const |
Compare with another ID object. More... | |
bool | operator== (const Key &b) const |
Compare with an ID Key. More... | |
Static Public Member Functions | |
static Key | getNullKey () |
Get a null key for initialization. More... | |
Protected Member Functions | |
void | incrementVersion () |
Increment the version number of this object. More... | |
Private Attributes | |
const std::string | id_ |
Unique object ID. More... | |
std::atomic_size_t | version_ |
Version number. More... | |
Adds functionality to uniquely ID a specific class as well as the "version" of that class, managed by an incrementing counter.
using robowflex::ID::Key = std::pair<std::string, std::size_t> |
ID::ID | ( | ) |
Constructor.
Definition at line 8 of file id.cpp.
const std::string & ID::getID | ( | ) | const |
ID::Key ID::getKey | ( | ) | const |
|
static |
std::size_t ID::getVersion | ( | ) | const |
|
protected |
bool ID::operator== | ( | const ID & | b | ) | const |
Compare with another ID object.
[in] | b | Object to compare against. |
bool ID::operator== | ( | const Key & | b | ) | const |
Compare with an ID Key.
[in] | b | Key to compare against. |
|
private |
|
private |