A base class defining a common interface for all classes having a unique id.
More...
#include <OpenMS/CONCEPT/UniqueIdInterface.h>
|
| enum | { INVALID = 0
} |
| | This is the invalid unique id (cast it to a UInt64 if you like) More...
|
| |
|
| static bool | isValid (UInt64 unique_id) |
| | Returns true if the unique_id is valid, false otherwise.
|
| |
A base class defining a common interface for all classes having a unique id.
Have a look at RichPeak2D for an example how to extend a class to support unique ids.
- See also
- UniqueIdGenerator, RichPeak2D
◆ anonymous enum
This is the invalid unique id (cast it to a UInt64 if you like)
It is represented as an enum because static class members lead to bugs and linker errors all the time...
◆ UniqueIdInterface() [1/3]
Default constructor - the unique id will be invalid
◆ UniqueIdInterface() [2/3]
Copy constructor - copies the unique id.
◆ UniqueIdInterface() [3/3]
◆ ~UniqueIdInterface()
◆ clearUniqueId()
Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed, 0 otherwise.
◆ ensureUniqueId()
◆ getUniqueId()
◆ hasInvalidUniqueId()
| Size hasInvalidUniqueId |
( |
| ) |
const |
|
inline |
Returns whether the unique id is invalid. Returns 1 if the unique id is invalid, 0 otherwise.
◆ hasValidUniqueId()
| Size hasValidUniqueId |
( |
| ) |
const |
|
inline |
Returns whether the unique id is valid. Returns 1 if the unique id is valid, 0 otherwise.
◆ isValid()
| static bool isValid |
( |
UInt64 |
unique_id | ) |
|
|
inlinestatic |
◆ operator=() [1/2]
Move Assignment operator - copies the unique id.
◆ operator=() [2/2]
Assignment operator - copies the unique id.
◆ operator==()
◆ setUniqueId() [1/3]
Assigns a new, valid unique id. Always returns 1.
◆ setUniqueId() [2/3]
| void setUniqueId |
( |
const std::string & |
rhs | ) |
|
Mutable access to unique id.
This is designed to work well with id attributes in XML, which are prefixed with letters. The portion of the std::string after the last underscore is extracted and parsed as a UInt64. It must consist of digits only. For example, some_feature.setUniqueId("f_12345_00067890") is equivalent to some_feature.setUniqueId(67890)
◆ setUniqueId() [3/3]
| void setUniqueId |
( |
UInt64 |
rhs | ) |
|
|
inline |
Assigns the given unique id.
◆ swap()
◆ unique_id_