#include <InstanceId.h>

Inheritance diagram for InstanceId< Class >:
Collaboration diagram for InstanceId< Class >:

Public Types

typedef unsigned int 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
 prints class-pecific prefix followed by ID value; More...
 
const char * prefix () const
 returns the class-pecific prefix More...
 

Public Attributes

Value value = 0
 instance identifier More...
 

Private Member Functions

 InstanceId (const InstanceId &)
 not implemented; IDs are unique More...
 
InstanceIdoperator= (const InstanceId &)
 not implemented More...
 

Detailed Description

template<class Class>
class InstanceId< Class >

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 storage type parameter to support configurable Value types?

    : add creation/destruction debugging?

Definition at line 23 of file InstanceId.h.

Member Typedef Documentation

◆ Value

template<class Class>
typedef unsigned int InstanceId< Class >::Value
Todo:
: parameterize?

Definition at line 26 of file InstanceId.h.

Constructor & Destructor Documentation

◆ InstanceId() [1/2]

template<class Class>
InstanceId< Class >::InstanceId ( )
inline

Definition at line 28 of file InstanceId.h.

◆ InstanceId() [2/2]

template<class Class>
InstanceId< Class >::InstanceId ( const InstanceId< Class > &  )
private

Member Function Documentation

◆ change()

template<class Class>
void InstanceId< Class >::change ( )

◆ operator Value()

template<class Class>
InstanceId< Class >::operator Value ( ) const
inline

Definition at line 30 of file InstanceId.h.

◆ operator!=()

template<class Class>
bool InstanceId< Class >::operator!= ( const InstanceId< Class > &  o) const
inline

Definition at line 32 of file InstanceId.h.

◆ operator=()

template<class Class>
InstanceId& InstanceId< Class >::operator= ( const InstanceId< Class > &  )
private

◆ operator==()

template<class Class>
bool InstanceId< Class >::operator== ( const InstanceId< Class > &  o) const
inline

Definition at line 31 of file InstanceId.h.

◆ prefix()

template<class Class>
const char* InstanceId< Class >::prefix ( ) const

◆ print()

template<class Class>
std::ostream& InstanceId< Class >::print ( std::ostream &  ) const
Todo:
: use HEX for value printing?

Referenced by InstanceId< AsyncJob >::operator!=().

Member Data Documentation

◆ value

template<class Class>
Value InstanceId< Class >::value = 0

The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors