Go to the documentation of this file.
9 #ifndef SQUID_BASE_INSTANCE_ID_H
10 #define SQUID_BASE_INSTANCE_ID_H
45 template <
class Class,
class ValueType = InstanceIdDefaultValueType>
59 std::ostream &
print(std::ostream &)
const;
77 #define InstanceIdDefinitions3(Class, pfx, ValueType, ...) \
78 template<> const char * \
79 InstanceId<Class, ValueType>::prefix() const { \
82 template<> std::ostream & \
83 InstanceId<Class, ValueType>::print(std::ostream &os) const { \
84 return os << pfx << value; \
87 InstanceId<Class, ValueType>::change() { \
88 static auto Last = Value(); \
89 value = ++Last ? Last : ++Last; \
93 #define InstanceIdDefinitions(...) InstanceIdDefinitions3(__VA_ARGS__, InstanceIdDefaultValueType)
96 template <
class Class,
class ValueType>
Value value
instance identifier
ValueType Value
id storage type
unsigned int InstanceIdDefaultValueType
const char * prefix() const
ScopedId(const char *s, uint64_t v)
InstanceId & operator=(const InstanceId &)
not implemented
std::ostream & print(std::ostream &) const
writes a compact text representation of the ID
std::ostream & operator<<(std::ostream &os, const ScopedId &id)
bool operator==(const InstanceId &o) const
InstanceId(const InstanceId &)
not implemented; IDs are unique
bool operator!=(const InstanceId &o) const