ATLAS Offline Software
Loading...
Searching...
No Matches
SG::PackedLink< STORABLE > Struct Template Reference

A packed version of ElementLink. More...

#include <PackedLinkImpl.h>

Inheritance diagram for SG::PackedLink< STORABLE >:
Collaboration diagram for SG::PackedLink< STORABLE >:

Public Member Functions

 PackedLinkBase ()
 Default constructor.
 PackedLinkBase (unsigned int collection, unsigned int index)
 Constructor.
bool operator== (const PackedLinkBase &other) const
 Comparison.
unsigned int collection () const
 Unpack the collection index from the link.
unsigned int index () const
 Unpack the element index from the link.
void setCollection (unsigned int collection)
 Set the collection index;.
void setIndex (unsigned int index)
 Set the element index;.

Static Public Attributes

static constexpr unsigned NBITS = 32
static constexpr unsigned COLLECTION_NBITS = 8
static constexpr unsigned INDEX_NBITS = NBITS - COLLECTION_NBITS
static constexpr uint32_t COLLECTION_MAX = CxxUtils::ones<uint32_t> (COLLECTION_NBITS)
static constexpr uint32_t INDEX_MAX = CxxUtils::ones<uint32_t> (INDEX_NBITS)

Private Attributes

uint32_t m_packed
 The packed form of the link.

Detailed Description

template<class STORABLE>
requires (std::integral<typename SG::ElementLinkTraits<STORABLE>::IndexingPolicy::index_type>)
struct SG::PackedLink< STORABLE >

A packed version of ElementLink.

This represents a link to an element of STORABLE, packed into 32 bits.

Definition at line 119 of file PackedLinkImpl.h.

Member Function Documentation

◆ collection()

unsigned int SG::PackedLinkBase::collection ( ) const
inherited

Unpack the collection index from the link.

◆ index()

unsigned int SG::PackedLinkBase::index ( ) const
inherited

Unpack the element index from the link.

◆ operator==()

bool SG::PackedLinkBase::operator== ( const PackedLinkBase & other) const
inherited

Comparison.

Parameters
otherThe link with which to compare.

◆ PackedLinkBase() [1/2]

template<class STORABLE>
SG::PackedLinkBase::PackedLinkBase ( )

Default constructor.

Initialize a null link.

◆ PackedLinkBase() [2/2]

template<class STORABLE>
SG::PackedLinkBase::PackedLinkBase ( unsigned int collection,
unsigned int index )

Constructor.

Parameters
collectionThe index of the collection in the DataLink vector,
indexThe index of the element within the collection.

◆ setCollection()

void SG::PackedLinkBase::setCollection ( unsigned int collection)
inherited

Set the collection index;.

Parameters
collectionThe index of the collection in the DataLink vector,

◆ setIndex()

void SG::PackedLinkBase::setIndex ( unsigned int index)
inherited

Set the element index;.

Parameters
indexThe index of the element within the collection.

Member Data Documentation

◆ COLLECTION_MAX

uint32_t SG::PackedLinkBase::COLLECTION_MAX = CxxUtils::ones<uint32_t> (COLLECTION_NBITS)
staticconstexprinherited

Definition at line 51 of file PackedLinkImpl.h.

◆ COLLECTION_NBITS

unsigned SG::PackedLinkBase::COLLECTION_NBITS = 8
staticconstexprinherited

Definition at line 49 of file PackedLinkImpl.h.

◆ INDEX_MAX

uint32_t SG::PackedLinkBase::INDEX_MAX = CxxUtils::ones<uint32_t> (INDEX_NBITS)
staticconstexprinherited

Definition at line 52 of file PackedLinkImpl.h.

◆ INDEX_NBITS

unsigned SG::PackedLinkBase::INDEX_NBITS = NBITS - COLLECTION_NBITS
staticconstexprinherited

Definition at line 50 of file PackedLinkImpl.h.

◆ m_packed

uint32_t SG::PackedLinkBase::m_packed
privateinherited

The packed form of the link.

Definition at line 105 of file PackedLinkImpl.h.

◆ NBITS

unsigned SG::PackedLinkBase::NBITS = 32
staticconstexprinherited

Definition at line 48 of file PackedLinkImpl.h.


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