ATLAS Offline Software
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
SG::PackedLinkBase Struct Reference

A packed version of ElementLink. More...

#include <PackedLinkImpl.h>

Collaboration diagram for SG::PackedLinkBase:

Public Member Functions

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

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. More...
 

Detailed Description

A packed version of ElementLink.

This is a packed form of ElementLink, which can be used as an auxiliary variable. It occupies 32 bits. The high 8 bits specify the collection, as an index into a linked vector of DataLink. The remainder gives the element index. A PackedLinkBase that's 0 represents a null link.

This non-templated base class holds the actual packed value. However, users should use the PackedLink<STORABLE> derived types, to allow specifying the target of the links.

Definition at line 46 of file PackedLinkImpl.h.

Constructor & Destructor Documentation

◆ PackedLinkBase() [1/2]

SG::PackedLinkBase::PackedLinkBase ( )

Default constructor.

Initialize a null link.

◆ PackedLinkBase() [2/2]

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.

Member Function Documentation

◆ collection()

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

Unpack the collection index from the link.

◆ index()

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

Unpack the element index from the link.

◆ operator==()

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

Comparison.

Parameters
otherThe link with which to compare.

◆ setCollection()

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

Set the collection index;.

Parameters
collectionThe index of the collection in the DataLink vector,

◆ setIndex()

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

Set the element index;.

Parameters
indexThe index of the element within the collection.

Member Data Documentation

◆ COLLECTION_MAX

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

Definition at line 51 of file PackedLinkImpl.h.

◆ COLLECTION_NBITS

constexpr unsigned SG::PackedLinkBase::COLLECTION_NBITS = 8
staticconstexpr

Definition at line 49 of file PackedLinkImpl.h.

◆ INDEX_MAX

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

Definition at line 52 of file PackedLinkImpl.h.

◆ INDEX_NBITS

constexpr unsigned SG::PackedLinkBase::INDEX_NBITS = NBITS - COLLECTION_NBITS
staticconstexpr

Definition at line 50 of file PackedLinkImpl.h.

◆ m_packed

uint32_t SG::PackedLinkBase::m_packed
private

The packed form of the link.

Definition at line 105 of file PackedLinkImpl.h.

◆ NBITS

constexpr unsigned SG::PackedLinkBase::NBITS = 32
staticconstexpr

Definition at line 48 of file PackedLinkImpl.h.


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