17#ifndef ROOFIT_BATCHCOMPUTE_ROOSPAN_H
18#define ROOFIT_BATCHCOMPUTE_ROOSPAN_H
36 using iterator =
typename std::span<T>::iterator;
54 template<
typename NON_CONST_T,
55 typename =
typename std::enable_if<std::is_same<const NON_CONST_T, T>::value>
::type >
62 template <
class InputIterator>
63 constexpr RooSpan(InputIterator beginIn, InputIterator endIn) :
69 constexpr RooSpan(
typename std::span<T>::pointer beginIn,
70 typename std::span<T>::pointer endIn) :
76 constexpr RooSpan(
typename std::span<T>::pointer beginIn, std::size_t sizeIn) :
_span{beginIn, sizeIn} {}
78 constexpr RooSpan(
const std::vector<
typename std::remove_cv<T>::type>&
vec) noexcept :
82 constexpr RooSpan(std::vector<
typename std::remove_cv<T>::type>&
vec) noexcept :
88 constexpr RooSpan(std::vector<value_type>&& payload) =
delete;
94 constexpr typename std::span<T>::iterator
begin()
const {
98 constexpr typename std::span<T>::iterator
end()
const {
102 constexpr typename std::span<T>::pointer
data()
const {
107 constexpr typename std::span<T>::reference
operator[](std::size_t i)
const noexcept
112 typename std::span<T>::reference
operator[](std::size_t i)
const noexcept
114 assert(i <
_span.size());
119 constexpr std::size_t
size() const noexcept
124 constexpr bool empty() const noexcept {
125 return _span.empty();
134 template <
class Span_t>
135 constexpr bool overlaps(
const Span_t& other)
const {
137 || other.insideSpan(
begin()) || other.insideSpan(
end()-1);
141 template <
typename ptr_t>
143 return begin() <= ptr && ptr <
end();
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
A simple container to hold a batch of data values.
constexpr RooSpan(std::vector< typename std::remove_cv< T >::type > &vec) noexcept
constexpr std::size_t size() const noexcept
constexpr bool insideSpan(ptr_t ptr) const
Test if the given pointer/iterator is inside the span.
constexpr std::span< T >::iterator end() const
typename std::remove_cv< T >::type value_type
constexpr RooSpan(InputIterator beginIn, InputIterator endIn)
Construct from a range. Data held by foreign object.
constexpr RooSpan(const RooSpan< NON_CONST_T > &other)
Conversion constructor from RooSpan<NON_CONST_T> to RooSpan<T>, where T is a const type.
constexpr std::span< T >::pointer data() const
constexpr RooSpan(const RooSpan &other)
constexpr RooSpan(typename std::span< T >::pointer beginIn, typename std::span< T >::pointer endIn)
Construct from start and end pointers.
constexpr RooSpan(RooSpan &&other)
typename std::span< T >::iterator iterator
constexpr RooSpan(std::vector< value_type > &&payload)=delete
We cannot point to temporary data.
std::span< T >::reference operator[](std::size_t i) const noexcept
constexpr RooSpan(typename std::span< T >::pointer beginIn, std::size_t sizeIn)
Construct from start pointer and size.
constexpr bool overlaps(const Span_t &other) const
Test if the span overlaps with other.
constexpr bool isBatch() const noexcept
constexpr RooSpan(const std::vector< typename std::remove_cv< T >::type > &vec) noexcept
constexpr std::span< T >::iterator begin() const
constexpr bool empty() const noexcept
RooSpan & operator=(const RooSpan &other)=default