ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
IdentContIndex Class Reference

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

#include <IdentContIndex.h>

Collaboration diagram for IdentContIndex:

Public Member Functions

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

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 {}

◆ IdentContIndex() [2/3]

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

Definition at line 70 of file IdentContIndex.h.

71  :
74 {}

◆ IdentContIndex() [3/3]

IdentContIndex::IdentContIndex ( unsigned int  hashAndIndex)
inline

Definition at line 77 of file IdentContIndex.h.

78 {
80 }

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.

127 {
128  m_collHash = hash;
129 }

◆ 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 {
135  m_objIndex = index;
136 }

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:
get_generator_info.result
result
Definition: get_generator_info.py:21
IdentContIndex::m_objIndex
unsigned short m_objIndex
Definition: IdentContIndex.h:55
IdentContIndex::hashAndIndex
unsigned int hashAndIndex() const
combined index
Definition: IdentContIndex.h:99
IdentContIndex::objIndex
unsigned short objIndex() const
object index in collection
Definition: IdentContIndex.h:92
DeMoScan.index
string index
Definition: DeMoScan.py:364
IdentContIndex::setHashAndIndex
void setHashAndIndex(unsigned int hashAndIndex)
Setters of hash, obj index and combined index.
Definition: IdentContIndex.h:117
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
IdentContIndex::m_collHash
unsigned short m_collHash
Definition: IdentContIndex.h:54
IdentContIndex::collHash
unsigned short collHash() const
Accessor to hash, obj index and combined index.
Definition: IdentContIndex.h:85