ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
IOVDbTPCnv
IOVDbTPCnv
AttrListIndexes.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef IOVDBTPCNV_ATTRLISTINDEXES_H
6
# define IOVDBTPCNV_ATTRLISTINDEXES_H
7
18
19
class
AttrListIndexes
20
{
21
public
:
22
AttrListIndexes
();
23
AttrListIndexes
(
unsigned
short
nameIndex
,
unsigned
short
typeIndex
,
unsigned
short
objIndex
);
24
AttrListIndexes
(
unsigned
short
typeIndex
,
unsigned
short
objIndex
);
25
AttrListIndexes
(
unsigned
int
combinedIndex
);
26
28
unsigned
short
nameIndex
()
const
;
29
31
unsigned
short
typeIndex
()
const
;
32
35
unsigned
short
objIndex
()
const
;
36
38
unsigned
int
combinedIndex
()
const
;
39
41
bool
isValid
()
const
;
42
43
void
setCombinedIndex
(
unsigned
int
combinedIndex
);
44
void
setAttrIndex
(
unsigned
short
nameIndex
);
45
void
setTypeIndex
(
unsigned
short
typeIndex
);
46
void
setObjIndex
(
unsigned
short
index
);
47
48
private
:
49
unsigned
short
m_typeIndex
;
50
unsigned
short
m_objIndex
;
51
};
52
53
54
55
// inline definitions
56
57
inline
58
AttrListIndexes::AttrListIndexes
()
59
:
60
m_typeIndex
(0xFFFF),
61
m_objIndex
(0xFFFF)
62
{}
63
64
inline
65
AttrListIndexes::AttrListIndexes
(
unsigned
short
nameIndex
,
unsigned
short
typeIndex
,
unsigned
short
objIndex
)
66
:
67
// m_typeIndex: 10 bits nameIndex + 6 bits typeIndex:
68
m_typeIndex
( ((
nameIndex
& 0x03FF) << 6) | (
typeIndex
& 0x003F)),
69
m_objIndex
(
objIndex
)
70
{}
71
72
73
inline
74
AttrListIndexes::AttrListIndexes
(
unsigned
short
typeIndex
,
unsigned
short
objIndex
)
75
:
76
m_typeIndex
(
typeIndex
& 0x003F),
77
m_objIndex
(
objIndex
)
78
{}
79
80
inline
81
AttrListIndexes::AttrListIndexes
(
unsigned
int
combinedIndex
)
82
{
83
setCombinedIndex
(
combinedIndex
);
84
}
85
86
87
inline
88
unsigned
short
89
AttrListIndexes::nameIndex
()
const
90
{
91
return
((
m_typeIndex
>> 6) & 0x03FF);
92
}
93
94
inline
95
unsigned
short
96
AttrListIndexes::typeIndex
()
const
97
{
98
return
(
m_typeIndex
& 0x003F);
99
}
100
101
inline
102
unsigned
short
103
AttrListIndexes::objIndex
()
const
104
{
105
return
(
m_objIndex
);
106
}
107
108
inline
109
unsigned
int
110
AttrListIndexes::combinedIndex
()
const
111
{
112
// Concatenate type and obj indexes
113
unsigned
int
result = (
m_typeIndex
<< 16) +
m_objIndex
;
114
return
(result);
115
}
116
117
inline
118
bool
119
AttrListIndexes::isValid
()
const
120
{
121
// is valid if both type and obj indexes are not default values
122
return
(
m_typeIndex
!= 0xFFFF &&
m_objIndex
!= 0xFFFF);
123
}
124
125
126
inline
127
void
128
AttrListIndexes::setCombinedIndex
(
unsigned
int
combinedIndex
)
129
{
130
// Extract type and obj indexes
131
m_typeIndex
=
combinedIndex
>> 16;
132
m_objIndex
=
combinedIndex
& 0xFFFF;
133
}
134
135
inline
136
void
137
AttrListIndexes::setAttrIndex
(
unsigned
short
index
)
138
{
139
// add in only the attribute index, keeping the type index
140
m_typeIndex
= ((
index
& 0x03FF) << 6) | (
m_typeIndex
& 0x003F);
141
}
142
143
144
inline
145
void
146
AttrListIndexes::setTypeIndex
(
unsigned
short
index
)
147
{
148
// add in only the type index, keeping the attribute index
149
m_typeIndex
= (
m_typeIndex
& 0x03FF) | (
index
& 0x003F);
150
}
151
152
inline
153
void
154
AttrListIndexes::setObjIndex
(
unsigned
short
index
)
155
{
156
m_objIndex
=
index
;
157
}
158
159
#endif
AttrListIndexes::nameIndex
unsigned short nameIndex() const
Index into attribute name vector.
Definition
AttrListIndexes.h:89
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::setAttrIndex
void setAttrIndex(unsigned short nameIndex)
Definition
AttrListIndexes.h:137
AttrListIndexes::setTypeIndex
void setTypeIndex(unsigned short typeIndex)
Definition
AttrListIndexes.h:146
AttrListIndexes::combinedIndex
unsigned int combinedIndex() const
Access to the bit-packed value.
Definition
AttrListIndexes.h:110
AttrListIndexes::setObjIndex
void setObjIndex(unsigned short index)
Definition
AttrListIndexes.h:154
AttrListIndexes::typeIndex
unsigned short typeIndex() const
Index into the type name vector.
Definition
AttrListIndexes.h:96
AttrListIndexes::AttrListIndexes
AttrListIndexes()
Definition
AttrListIndexes.h:58
AttrListIndexes::m_typeIndex
unsigned short m_typeIndex
Definition
AttrListIndexes.h:49
AttrListIndexes::m_objIndex
unsigned short m_objIndex
Definition
AttrListIndexes.h:50
AttrListIndexes::isValid
bool isValid() const
Uninitialized index is NOT valid.
Definition
AttrListIndexes.h:119
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0