#include <InstanceId.h>
Public Types | |
typedef ValueType | Value |
id storage type More... | |
Public Member Functions | |
InstanceId () | |
operator Value () const | |
bool | operator== (const InstanceId &o) const |
bool | operator!= (const InstanceId &o) const |
void | change () |
std::ostream & | print (std::ostream &) const |
writes a compact text representation of the ID More... | |
const char * | prefix () const |
ScopedId | detach () const |
Public Attributes | |
Value | value = Value() |
instance identifier More... | |
Private Member Functions | |
InstanceId (const InstanceId &) | |
not implemented; IDs are unique More... | |
InstanceId & | operator= (const InstanceId &) |
not implemented More... | |
Detailed Description
class InstanceId< Class, ValueType >
Identifier for class instances
- unique IDs for a large number of concurrent instances, but may wrap;
- useful for debugging and insecure request/response matching;
- sequential IDs within a class except when wrapping;
- always positive IDs. TODO: add creation/destruction debugging?
Definition at line 46 of file InstanceId.h.
Member Typedef Documentation
◆ Value
typedef ValueType InstanceId< Class, ValueType >::Value |
Definition at line 49 of file InstanceId.h.
Constructor & Destructor Documentation
◆ InstanceId() [1/2]
|
inline |
Definition at line 51 of file InstanceId.h.
References InstanceId< Class, ValueType >::change().
◆ InstanceId() [2/2]
|
private |
Member Function Documentation
◆ change()
void InstanceId< Class, ValueType >::change | ( | ) |
Referenced by InstanceId< Class, ValueType >::InstanceId().
◆ detach()
|
inline |
- Returns
- a copy of the ID usable outside our Class context
Definition at line 66 of file InstanceId.h.
References InstanceId< Class, ValueType >::prefix(), and InstanceId< Class, ValueType >::value.
◆ operator Value()
|
inline |
Definition at line 53 of file InstanceId.h.
References InstanceId< Class, ValueType >::value.
◆ operator!=()
|
inline |
Definition at line 55 of file InstanceId.h.
◆ operator=()
|
private |
◆ operator==()
|
inline |
Definition at line 54 of file InstanceId.h.
References InstanceId< Class, ValueType >::value.
◆ prefix()
const char * InstanceId< Class, ValueType >::prefix | ( | ) | const |
- Returns
- Class-specific nickname (with endless lifetime)
Referenced by InstanceId< Class, ValueType >::detach().
◆ print()
std::ostream & InstanceId< Class, ValueType >::print | ( | std::ostream & | ) | const |
Member Data Documentation
◆ value
Value InstanceId< Class, ValueType >::value = Value() |
Definition at line 69 of file InstanceId.h.
Referenced by Format::Format::assemble(), InstanceId< Class, ValueType >::detach(), InstanceId< Class, ValueType >::operator Value(), operator<<(), and InstanceId< Class, ValueType >::operator==().
The documentation for this class was generated from the following file:
- src/base/InstanceId.h