ATLAS Offline Software
|
Store an ElementLink
index for non-vector containers.
More...
#include <IndexHolder.h>
Public Member Functions | |
IndexHolder () | |
Constructor. More... | |
IndexHolder (const T &t) | |
Copy constructor. More... | |
bool | isValid () const |
Return valid flag. More... | |
void | reset () |
Reset the index to a null value. More... | |
operator const T & () const | |
Retrieve the index. More... | |
Private Attributes | |
T | m_index |
The stored index. More... | |
bool | m_valid |
True if the index is valid. More... | |
Store an ElementLink
index for non-vector containers.
When we store an index to a vector container, we use -1 as an invalid index value. However, in the general case where we have a container with an index of arbitrary type, we don't have a distinguished value we can use to represent invalid. So for that case, we need to store an additional valid flag along with the index. Things are factored like this so that we can avoid storing the flag for the common case of indexing a vector.
Definition at line 32 of file IndexHolder.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Reset the index to a null value.
Definition at line 45 of file IndexHolder.h.
|
private |
The stored index.
Definition at line 54 of file IndexHolder.h.
|
private |
True if the index is valid.
Definition at line 57 of file IndexHolder.h.