Squid Web Cache master
Loading...
Searching...
No Matches
InstanceId.h File Reference
#include <iosfwd>
Include dependency graph for InstanceId.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ScopedId
 
class  InstanceId< Class, ValueType >
 

Macros

#define InstanceIdDefinitions3(Class, pfx, ValueType, ...)
 An InstanceIdDefinitions() helper. Avoid direct use.
 
#define InstanceIdDefinitions(...)   InstanceIdDefinitions3(__VA_ARGS__, InstanceIdDefaultValueType)
 convenience macro to instantiate Class-specific stuff in .cc files
 

Typedefs

typedef unsigned int InstanceIdDefaultValueType
 

Functions

std::ostream & operator<< (std::ostream &os, const ScopedId &id)
 
template<class Class , class ValueType >
std::ostream & operator<< (std::ostream &os, const InstanceId< Class, ValueType > &id)
 print the id
 

Macro Definition Documentation

◆ InstanceIdDefinitions

#define InstanceIdDefinitions (   ...)    InstanceIdDefinitions3(__VA_ARGS__, InstanceIdDefaultValueType)

Definition at line 90 of file InstanceId.h.

◆ InstanceIdDefinitions3

#define InstanceIdDefinitions3 (   Class,
  pfx,
  ValueType,
  ... 
)
Value:
template<> const char * \
InstanceId<Class, ValueType>::prefix() const { \
return pfx; \
} \
template<> std::ostream & \
InstanceId<Class, ValueType>::print(std::ostream &os) const { \
return os << pfx << value; \
} \
template<> void \
InstanceId<Class, ValueType>::change() { \
static auto Last = Value(); \
value = ++Last ? Last : ++Last; \
}

Definition at line 74 of file InstanceId.h.

Typedef Documentation

◆ InstanceIdDefaultValueType

typedef unsigned int InstanceIdDefaultValueType

Definition at line 37 of file InstanceId.h.

Function Documentation

◆ operator<<() [1/2]

template<class Class , class ValueType >
std::ostream & operator<< ( std::ostream &  os,
const InstanceId< Class, ValueType > &  id 
)
inline

Definition at line 95 of file InstanceId.h.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  os,
const ScopedId id 
)

Definition at line 14 of file InstanceId.cc.