LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Span.h
Go to the documentation of this file.
1
#ifndef NuSonic_Triton_Span_h
2
#define NuSonic_Triton_Span_h
3
4
#include <cstddef>
5
6
namespace
triton_span
{
7
/*
8
*An edm::Span wraps begin() and end() iterators to a contiguous sequence
9
of objects with the first element of the sequence at position zero,
10
In other words the iterators should refer to random-access containers.
11
12
To be replaced with std::Span in C++20.
13
*/
14
15
template
<
class
T>
16
class
Span
{
17
public
:
18
Span
(T
begin
, T
end
) :
begin_
(begin),
end_
(end) {}
19
20
T
begin
()
const
{
return
begin_
; }
21
T
end
()
const
{
return
end_
; }
22
23
bool
empty
()
const
{
return
begin_
==
end_
; }
24
auto
size
()
const
{
return
end_
-
begin_
; }
25
26
auto
const
&
operator[]
(std::size_t idx)
const
{
return
*(
begin_
+ idx); }
27
28
auto
const
&
front
()
const
{
return
*
begin_
; }
29
auto
const
&
back
()
const
{
return
*(
end_
- 1); }
30
31
private
:
32
const
T
begin_
;
33
const
T
end_
;
34
};
35
}
// namespace triton_span
36
37
#endif
triton_span::Span::back
auto const & back() const
Definition:
Span.h:29
triton_span
Definition:
Span.h:6
triton_span::Span::begin
T begin() const
Definition:
Span.h:20
triton_span::Span
Definition:
Span.h:16
triton_span::Span::Span
Span(T begin, T end)
Definition:
Span.h:18
triton_span::Span::end
T end() const
Definition:
Span.h:21
triton_span::Span::operator[]
auto const & operator[](std::size_t idx) const
Definition:
Span.h:26
triton_span::Span::end_
const T end_
Definition:
Span.h:33
triton_span::Span::size
auto size() const
Definition:
Span.h:24
triton_span::Span::begin_
const T begin_
Definition:
Span.h:32
triton_span::Span::empty
bool empty() const
Definition:
Span.h:23
triton_span::Span::front
auto const & front() const
Definition:
Span.h:28
larrecodnn
v09_23_00
source
larrecodnn
ImagePatternAlgs
NuSonic
Triton
Span.h
Generated on Thu May 2 2024 20:59:50 for LArSoft by
1.8.11