7#ifndef DETDESCR_PACKEDINDEX_H_
8#define DETDESCR_PACKEDINDEX_H_
31template <
unsigned int m0,
unsigned int m1 = 0,
unsigned int m2 = 0>
48 PackedIndex(
unsigned int v0,
unsigned int v1,
unsigned int v2 = 0,
49 unsigned int v3 = 0) {
50 index_ = v0 + v1 * m0 + v2 * m0 * m1 + v3 * m0 * m1 * m2;
A maximally-packed index of up to four different fields.
PackedIndex(unsigned int v0, unsigned int v1, unsigned int v2=0, unsigned int v3=0)
Constructor from field values Put our values into a single 32-bit integer.
unsigned int field3() const
Get the value of field 3.
unsigned int field2() const
Get the value of field 2.
unsigned int field0() const
Get the value of field 0.
unsigned int field1() const
Get the value of field 1.
uint32_t index_
The 32-bit integer that is storing our fields.
uint32_t value() const
Get the fully packed index.
PackedIndex(uint32_t value)
Constructor from index value.