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

Identifiable container index to a contained object. More...

#include <IdentContIndex.h>

Collaboration diagram for IdentContIndex:

Public Member Functions

 IdentContIndex ()
 Constructors.
 IdentContIndex (unsigned short collHash, unsigned short objIndex)
 IdentContIndex (unsigned int hashAndIndex)
unsigned short collHash () const
 Accessor to hash, obj index and combined index.
unsigned short objIndex () const
 object index in collection
unsigned int hashAndIndex () const
 combined index
bool isValid () const
 check that both fields are set
void setHashAndIndex (unsigned int hashAndIndex)
 Setters of hash, obj index and combined index.
void setCollHash (unsigned short hash)
 set object index in collection
void setObjIndex (unsigned short index)
 set combined index

Private Attributes

unsigned short m_collHash
unsigned short m_objIndex

Detailed Description

Identifiable container index to a contained object.

IdentContIndex is a helper class used in conjunction with IdentContIndexingPolicy to create a compound index to an object in an identifiable container. The index is composed of the hash id of the collection and the index of a object in the collection. An IdentContIndex provides an unsigned int compound, composed of two 16 bit hash id and collection index.

Author
RD Schaffer
Id
IdentContIndex.h,v 1.2 2007-06-14 22:41:47 ssnyder Exp

Definition at line 22 of file IdentContIndex.h.

Constructor & Destructor Documentation

◆ IdentContIndex() [1/3]

IdentContIndex::IdentContIndex ( )
inline

Constructors.

Definition at line 63 of file IdentContIndex.h.

64 :
65 m_collHash(0xFFFF),
66 m_objIndex(0xFFFF)
67{}
unsigned short m_collHash
unsigned short m_objIndex

◆ IdentContIndex() [2/3]

IdentContIndex::IdentContIndex ( unsigned short collHash,
unsigned short objIndex )
inline

Definition at line 70 of file IdentContIndex.h.

71 :
74{}
unsigned short objIndex() const
object index in collection
unsigned short collHash() const
Accessor to hash, obj index and combined index.

◆ IdentContIndex() [3/3]

IdentContIndex::IdentContIndex ( unsigned int hashAndIndex)
inline

Definition at line 77 of file IdentContIndex.h.

78{
80}
void setHashAndIndex(unsigned int hashAndIndex)
Setters of hash, obj index and combined index.
unsigned int hashAndIndex() const
combined index

Member Function Documentation

◆ collHash()

unsigned short IdentContIndex::collHash ( ) const
inline

Accessor to hash, obj index and combined index.

collection hash id

Definition at line 85 of file IdentContIndex.h.

86{
87 return (m_collHash);
88}

◆ hashAndIndex()

unsigned int IdentContIndex::hashAndIndex ( ) const
inline

combined index

Definition at line 99 of file IdentContIndex.h.

100{
101 // Concatenate hash and index
102 unsigned int result = (m_collHash << 16) + m_objIndex;
103 return (result);
104}

◆ isValid()

bool IdentContIndex::isValid ( ) const
inline

check that both fields are set

Definition at line 108 of file IdentContIndex.h.

109{
110 // is valid if both hash and index are not default values
111 return (m_collHash != 0xFFFF && m_objIndex != 0xFFFF);
112}

◆ objIndex()

unsigned short IdentContIndex::objIndex ( ) const
inline

object index in collection

Definition at line 92 of file IdentContIndex.h.

93{
94 return (m_objIndex);
95}

◆ setCollHash()

void IdentContIndex::setCollHash ( unsigned short hash)
inline

set object index in collection

Definition at line 126 of file IdentContIndex.h.

◆ setHashAndIndex()

void IdentContIndex::setHashAndIndex ( unsigned int hashAndIndex)
inline

Setters of hash, obj index and combined index.

set collection hash id

Definition at line 117 of file IdentContIndex.h.

118{
119 // Extract hash and index
120 m_collHash = static_cast<unsigned short> (hashAndIndex >> 16);
121 m_objIndex = static_cast<unsigned short> (hashAndIndex & 0xFFFF);
122}

◆ setObjIndex()

void IdentContIndex::setObjIndex ( unsigned short index)
inline

set combined index

Definition at line 133 of file IdentContIndex.h.

134{
136}
str index
Definition DeMoScan.py:362

Member Data Documentation

◆ m_collHash

unsigned short IdentContIndex::m_collHash
private

Definition at line 54 of file IdentContIndex.h.

◆ m_objIndex

unsigned short IdentContIndex::m_objIndex
private

Definition at line 55 of file IdentContIndex.h.


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