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

Indexes to attribute name, type name and object value for the persistent storage of an attribute list. The attribute and type names are stored in individual vectors, but the object value is stored in one of serveral type-specific vectors. More...

#include <AttrListIndexes.h>

Collaboration diagram for AttrListIndexes:

Public Member Functions

 AttrListIndexes ()
 
 AttrListIndexes (unsigned short nameIndex, unsigned short typeIndex, unsigned short objIndex)
 
 AttrListIndexes (unsigned short typeIndex, unsigned short objIndex)
 
 AttrListIndexes (unsigned int combinedIndex)
 
unsigned short nameIndex () const
 Index into attribute name vector. More...
 
unsigned short typeIndex () const
 Index into the type name vector. More...
 
unsigned short objIndex () const
 Index into the type-specific value vectors - type index identifies which one. More...
 
unsigned int combinedIndex () const
 Access to the bit-packed value. More...
 
bool isValid () const
 Uninitialized index is NOT valid. More...
 
void setCombinedIndex (unsigned int combinedIndex)
 
void setAttrIndex (unsigned short nameIndex)
 
void setTypeIndex (unsigned short typeIndex)
 
void setObjIndex (unsigned short index)
 

Private Attributes

unsigned short m_typeIndex
 
unsigned short m_objIndex
 

Detailed Description

Indexes to attribute name, type name and object value for the persistent storage of an attribute list. The attribute and type names are stored in individual vectors, but the object value is stored in one of serveral type-specific vectors.

Author
RD Schaffer
Id
AttrListIndexes.h,v 1.2 2008-10-13 15:12:05 schaffer Exp

Definition at line 19 of file AttrListIndexes.h.

Constructor & Destructor Documentation

◆ AttrListIndexes() [1/4]

AttrListIndexes::AttrListIndexes ( )
inline

Definition at line 58 of file AttrListIndexes.h.

59  :
60  m_typeIndex(0xFFFF),
61  m_objIndex(0xFFFF)
62 {}

◆ AttrListIndexes() [2/4]

AttrListIndexes::AttrListIndexes ( unsigned short  nameIndex,
unsigned short  typeIndex,
unsigned short  objIndex 
)
inline

Definition at line 65 of file AttrListIndexes.h.

66  :
67  // m_typeIndex: 10 bits nameIndex + 6 bits typeIndex:
68  m_typeIndex( ((nameIndex & 0x03FF) << 6) | (typeIndex & 0x003F)),
70 {}

◆ AttrListIndexes() [3/4]

AttrListIndexes::AttrListIndexes ( unsigned short  typeIndex,
unsigned short  objIndex 
)
inline

Definition at line 74 of file AttrListIndexes.h.

75  :
76  m_typeIndex(typeIndex & 0x003F),
78 {}

◆ AttrListIndexes() [4/4]

AttrListIndexes::AttrListIndexes ( unsigned int  combinedIndex)
inline

Definition at line 81 of file AttrListIndexes.h.

82 {
84 }

Member Function Documentation

◆ combinedIndex()

unsigned int AttrListIndexes::combinedIndex ( ) const
inline

Access to the bit-packed value.

Definition at line 110 of file AttrListIndexes.h.

111 {
112  // Concatenate type and obj indexes
113  unsigned int result = (m_typeIndex << 16) + m_objIndex;
114  return (result);
115 }

◆ isValid()

bool AttrListIndexes::isValid ( ) const
inline

Uninitialized index is NOT valid.

Definition at line 119 of file AttrListIndexes.h.

120 {
121  // is valid if both type and obj indexes are not default values
122  return (m_typeIndex != 0xFFFF && m_objIndex != 0xFFFF);
123 }

◆ nameIndex()

unsigned short AttrListIndexes::nameIndex ( ) const
inline

Index into attribute name vector.

Definition at line 89 of file AttrListIndexes.h.

90 {
91  return ((m_typeIndex >> 6) & 0x03FF);
92 }

◆ objIndex()

unsigned short AttrListIndexes::objIndex ( ) const
inline

Index into the type-specific value vectors - type index identifies which one.

Definition at line 103 of file AttrListIndexes.h.

104 {
105  return (m_objIndex);
106 }

◆ setAttrIndex()

void AttrListIndexes::setAttrIndex ( unsigned short  nameIndex)
inline

Definition at line 137 of file AttrListIndexes.h.

138 {
139  // add in only the attribute index, keeping the type index
140  m_typeIndex = ((index & 0x03FF) << 6) | (m_typeIndex & 0x003F);
141 }

◆ setCombinedIndex()

void AttrListIndexes::setCombinedIndex ( unsigned int  combinedIndex)
inline

Definition at line 128 of file AttrListIndexes.h.

129 {
130  // Extract type and obj indexes
131  m_typeIndex = combinedIndex >> 16;
132  m_objIndex = combinedIndex & 0xFFFF;
133 }

◆ setObjIndex()

void AttrListIndexes::setObjIndex ( unsigned short  index)
inline

Definition at line 154 of file AttrListIndexes.h.

155 {
156  m_objIndex = index;
157 }

◆ setTypeIndex()

void AttrListIndexes::setTypeIndex ( unsigned short  typeIndex)
inline

Definition at line 146 of file AttrListIndexes.h.

147 {
148  // add in only the type index, keeping the attribute index
149  m_typeIndex = (m_typeIndex & 0x03FF) | (index & 0x003F);
150 }

◆ typeIndex()

unsigned short AttrListIndexes::typeIndex ( ) const
inline

Index into the type name vector.

Definition at line 96 of file AttrListIndexes.h.

97 {
98  return (m_typeIndex & 0x003F);
99 }

Member Data Documentation

◆ m_objIndex

unsigned short AttrListIndexes::m_objIndex
private

Definition at line 50 of file AttrListIndexes.h.

◆ m_typeIndex

unsigned short AttrListIndexes::m_typeIndex
private

Definition at line 49 of file AttrListIndexes.h.


The documentation for this class was generated from the following file:
get_generator_info.result
result
Definition: get_generator_info.py:21
index
Definition: index.py:1
AttrListIndexes::objIndex
unsigned short objIndex() const
Index into the type-specific value vectors - type index identifies which one.
Definition: AttrListIndexes.h:103
AttrListIndexes::setCombinedIndex
void setCombinedIndex(unsigned int combinedIndex)
Definition: AttrListIndexes.h:128
AttrListIndexes::typeIndex
unsigned short typeIndex() const
Index into the type name vector.
Definition: AttrListIndexes.h:96
AttrListIndexes::m_objIndex
unsigned short m_objIndex
Definition: AttrListIndexes.h:50
AttrListIndexes::nameIndex
unsigned short nameIndex() const
Index into attribute name vector.
Definition: AttrListIndexes.h:89
DeMoScan.index
string index
Definition: DeMoScan.py:364
AttrListIndexes::combinedIndex
unsigned int combinedIndex() const
Access to the bit-packed value.
Definition: AttrListIndexes.h:110
AttrListIndexes::m_typeIndex
unsigned short m_typeIndex
Definition: AttrListIndexes.h:49