ATLAS Offline Software
Loading...
Searching...
No Matches
IdentifierHash Class Reference

This is a "hash" representation of an Identifier. More...

#include <IdentifierHash.h>

Collaboration diagram for IdentifierHash:

Public Types

using value_type = unsigned int

Public Member Functions

 IdentifierHash ()=default
 Default methods.
 IdentifierHash (value_type value)
 Initialization with value.
bool is_valid () const
 Check if id is in a valid state.
IdentifierHashoperator= (value_type value)
 Assignment operators.
IdentifierHashoperator+= (value_type value)
IdentifierHashoperator-= (value_type value)
 operator value_type () const
value_type 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

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 value_type()

IdentifierHash::operator value_type ( ) const

Get the value

◆ operator+=()

IdentifierHash & IdentifierHash::operator+= ( value_type value)

◆ operator-=()

IdentifierHash & IdentifierHash::operator-= ( value_type value)

◆ operator=()

IdentifierHash & IdentifierHash::operator= ( value_type value)

Assignment operators.

◆ value()

value_type IdentifierHash::value ( ) const

Member Data Documentation

◆ m_max_value

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: