ATLAS Offline Software
Loading...
Searching...
No Matches
columnar::TestUtils::LinkColumnKeyIndex Class Referencefinal

the link columns for key+index links More...

#include <ColumnReaderBranch.h>

Collaboration diagram for columnar::TestUtils::LinkColumnKeyIndex:

Public Types

using CM = ColumnarModeArray

Public Member Functions

std::vector< std::string > connect (const ColumnInfo &columnInfo, const std::unordered_map< std::string, const std::vector< ColumnarOffsetType > * > &, const std::unordered_map< std::string, ColumnInfo > &requestedColumns)
void clear ()
template<typename T>
void addLink (const ElementLink< T > &element)
void addEmptyLink ()
void addSplitLink (std::size_t linkIndex, SG::sgkey_t linkKey)
std::size_t size () const noexcept
const CM::LinkIndexColumnType * data () const noexcept
unsigned countNullLinks () const noexcept
const std::vector< typename CM::LinkKeyColumnType > & keysColumn () const noexcept

Static Public Member Functions

static std::string dataColumnName (const std::string &baseName)

Private Attributes

std::vector< typename CM::LinkIndexColumnType > m_indices
std::vector< typename CM::LinkKeyColumnType > m_keys

Detailed Description

the link columns for key+index links

This just passes on the key and index columns as they are found in the file, with the link accessors handling everything else.

Definition at line 39 of file ColumnReaderBranch.h.

Member Typedef Documentation

◆ CM

Public Members

Definition at line 45 of file ColumnReaderBranch.h.

Member Function Documentation

◆ addEmptyLink()

void columnar::TestUtils::LinkColumnKeyIndex::addEmptyLink ( )
inline

Definition at line 74 of file ColumnReaderBranch.h.

75 {
76 m_keys.push_back (CM::nullLinkKey);
77 m_indices.push_back (CM::nullLinkIndex);
78 }
std::vector< typename CM::LinkIndexColumnType > m_indices
std::vector< typename CM::LinkKeyColumnType > m_keys
static constexpr LinkIndexColumnType nullLinkIndex
The index used for writing null links.
static constexpr LinkKeyColumnType nullLinkKey
The key used for writing null links.

◆ addLink()

template<typename T>
void columnar::TestUtils::LinkColumnKeyIndex::addLink ( const ElementLink< T > & element)
inline

Definition at line 68 of file ColumnReaderBranch.h.

69 {
70 m_keys.push_back (element.key());
71 m_indices.push_back (element.persIndex());
72 }
stored_index_type persIndex() const
Return the index of the link.

◆ addSplitLink()

void columnar::TestUtils::LinkColumnKeyIndex::addSplitLink ( std::size_t linkIndex,
SG::sgkey_t linkKey )
inline

Definition at line 80 of file ColumnReaderBranch.h.

81 {
82 m_keys.push_back (linkKey);
83 m_indices.push_back (linkIndex);
84 }

◆ clear()

void columnar::TestUtils::LinkColumnKeyIndex::clear ( )
inline

Definition at line 61 of file ColumnReaderBranch.h.

62 {
63 m_indices.clear();
64 m_keys.clear();
65 }

◆ connect()

std::vector< std::string > columnar::TestUtils::LinkColumnKeyIndex::connect ( const ColumnInfo & columnInfo,
const std::unordered_map< std::string, const std::vector< ColumnarOffsetType > * > & ,
const std::unordered_map< std::string, ColumnInfo > & requestedColumns )
inlinenodiscard

Definition at line 52 of file ColumnReaderBranch.h.

53 {
54 auto baseName = columnInfo.name.substr (0, columnInfo.name.size() - CM::linkIndexColumnName.size() - 1);
55 auto keyName = baseName + "." + std::string (CM::linkKeyColumnName);
56 if (!requestedColumns.contains (keyName))
57 throw std::runtime_error ("link index column requested without key column: " + columnInfo.name);
58 return {keyName};
59 }
static constexpr std::string_view linkKeyColumnName
The name/suffix of the column used for the link-key column.
static constexpr std::string_view linkIndexColumnName
The name/suffix of the column used for the link-index column.

◆ countNullLinks()

unsigned columnar::TestUtils::LinkColumnKeyIndex::countNullLinks ( ) const
inlinenodiscardnoexcept

Definition at line 96 of file ColumnReaderBranch.h.

97 {
98 unsigned result = 0u;
99 for (std::size_t i = 0; i < m_indices.size(); ++ i)
100 {
102 result += 1u;
103 }
104 return result;
105 }
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ data()

const CM::LinkIndexColumnType * columnar::TestUtils::LinkColumnKeyIndex::data ( ) const
inlinenodiscardnoexcept

Definition at line 91 of file ColumnReaderBranch.h.

92 {
93 return m_indices.data();
94 }

◆ dataColumnName()

std::string columnar::TestUtils::LinkColumnKeyIndex::dataColumnName ( const std::string & baseName)
inlinestaticnodiscard

Definition at line 47 of file ColumnReaderBranch.h.

48 {
49 return baseName + "." + std::string (CM::linkIndexColumnName);
50 }

◆ keysColumn()

const std::vector< typename CM::LinkKeyColumnType > & columnar::TestUtils::LinkColumnKeyIndex::keysColumn ( ) const
inlinenodiscardnoexcept

Definition at line 107 of file ColumnReaderBranch.h.

108 {
109 return m_keys;
110 }

◆ size()

std::size_t columnar::TestUtils::LinkColumnKeyIndex::size ( ) const
inlinenodiscardnoexcept

Definition at line 86 of file ColumnReaderBranch.h.

87 {
88 return m_indices.size();
89 }

Member Data Documentation

◆ m_indices

std::vector<typename CM::LinkIndexColumnType> columnar::TestUtils::LinkColumnKeyIndex::m_indices
private

Private Members

Definition at line 116 of file ColumnReaderBranch.h.

◆ m_keys

std::vector<typename CM::LinkKeyColumnType> columnar::TestUtils::LinkColumnKeyIndex::m_keys
private

Definition at line 117 of file ColumnReaderBranch.h.


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