ATLAS Offline Software
Loading...
Searching...
No Matches
JaggedVecImpl.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 * Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
4 */
15
16
17#ifndef ATHCONTAINERS_JAGGEDVECIMPL_H
18#define ATHCONTAINERS_JAGGEDVECIMPL_H
19
20
21#include <cstddef>
22#include <cstdint>
23
24
25namespace SG {
26
27
52{
53public:
56 using index_type = uint32_t;
57
58
62 JaggedVecEltBase () = default;
63
64
71
72
77 index_type begin (size_t elt_ndx) const;
78
79
83 index_type end() const;
84
85
90 size_t size (size_t elt_ndx) const;
91
92
97 bool operator== (const JaggedVecEltBase& other) const;
98
99
103 struct Shift
104 {
106 Shift (int offs);
107
110
111
112 private:
115 };
116
117
118private:
119 friend struct Shift;
120
123};
124
125
129template <class T>
131 : public JaggedVecEltBase
132{
133public:
135};
136
137
138} // namespace SG
139
140
142
143
144#endif // not ATHCONTAINERS_JAGGEDVECIMPL_H
uint32_t index_type
Type for the indices.
index_type begin(size_t elt_ndx) const
Return the index of the beginning of the range.
size_t size(size_t elt_ndx) const
Return the number of items in this range.
bool operator==(const JaggedVecEltBase &other) const
Equality test.
index_type m_end
End index.
JaggedVecEltBase()=default
Default constructor.
index_type end() const
Return the index of the end of the range.
JaggedVecEltBase(index_type end)
Constructor.
Describe one element of a jagged vector.
JaggedVecEltBase()=default
Default constructor.
Forward declaration.
Helper to shift indices.
void operator()(JaggedVecEltBase &e) const
Shift indices in e by the offset given to the constructor.
int m_offs
Offset by which to shift.
Shift(int offs)
Constructor.