ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
IdentifierHash Class Reference

This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to look-up "Identifiable"s stored in a simple vector. It is intended to be a continuous hash, i.e. it runs from 0 to N-1, where there are N different possible values for an Identifier(32) within a specific context. IdentifierHashes are created by default in an invalid state which can be checked with "is_valid" method. This allows some error checking. More...

#include <IdentifierHash.h>

Collaboration diagram for IdentifierHash:

Public Types

using value_type = unsigned int
 

Public Member Functions

 IdentifierHash ()=default
 Default methods. More...
 
 IdentifierHash (value_type value)
 Initialization with value. More...
 
bool is_valid () const
 Check if id is in a valid state. More...
 
IdentifierHashoperator= (value_type value)
 Assignment operators. More...
 
IdentifierHashoperator+= (unsigned int value)
 
IdentifierHashoperator-= (unsigned int value)
 
 operator unsigned int () const
 
unsigned int value () const
 

Private Attributes

value_type m_value = m_max_value
 

Static Private Attributes

static constexpr value_type m_max_value = 0xFFFFFFFF
 default value, and indicator of invalid state More...
 

Detailed Description

This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to look-up "Identifiable"s stored in a simple vector. It is intended to be a continuous hash, i.e. it runs from 0 to N-1, where there are N different possible values for an Identifier(32) within a specific context. IdentifierHashes are created by default in an invalid state which can be checked with "is_valid" method. This allows some error checking.

Author
schaffer
Date
2003-11-26

Definition at line 25 of file IdentifierHash.h.

Member Typedef Documentation

◆ value_type

using IdentifierHash::value_type = unsigned int

Definition at line 27 of file IdentifierHash.h.

Constructor & Destructor Documentation

◆ IdentifierHash() [1/2]

IdentifierHash::IdentifierHash ( )
default

Default methods.

◆ IdentifierHash() [2/2]

IdentifierHash::IdentifierHash ( value_type  value)

Initialization with value.

Member Function Documentation

◆ is_valid()

bool IdentifierHash::is_valid ( ) const

Check if id is in a valid state.

◆ operator unsigned int()

IdentifierHash::operator unsigned int ( ) const

Get the value

◆ operator+=()

IdentifierHash& IdentifierHash::operator+= ( unsigned int  value)

◆ operator-=()

IdentifierHash& IdentifierHash::operator-= ( unsigned int  value)

◆ operator=()

IdentifierHash& IdentifierHash::operator= ( value_type  value)

Assignment operators.

◆ value()

unsigned int IdentifierHash::value ( ) const

Member Data Documentation

◆ m_max_value

constexpr value_type IdentifierHash::m_max_value = 0xFFFFFFFF
staticconstexprprivate

default value, and indicator of invalid state

Definition at line 46 of file IdentifierHash.h.

◆ m_value

value_type IdentifierHash::m_value = m_max_value
private

Definition at line 48 of file IdentifierHash.h.


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