Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | Protected Attributes | List of all members
ska::cheetah::data::SeriesSlice< SeriesType > Class Template Reference

A view into a series-like container. More...

#include <cheetah/data/SeriesSlice.h>

Inheritance diagram for ska::cheetah::data::SeriesSlice< SeriesType >:
Inheritance graph
Collaboration diagram for ska::cheetah::data::SeriesSlice< SeriesType >:
Collaboration graph

Public Types

typedef SeriesType::Iterator Iterator
 
typedef SeriesType::ConstIterator ConstIterator
 
typedef std::iterator_traits< Iterator >::pointer Pointer
 
typedef std::iterator_traits< ConstIterator >::pointer ConstPointer
 
typedef std::iterator_traits< Iterator >::reference Reference
 
typedef std::iterator_traits< ConstIterator >::reference ConstReference
 
typedef std::iterator_traits< Iterator >::value_type ValueType
 

Public Member Functions

 SeriesSlice (Iterator start_it, Iterator end_it)
 Construct a new instance. More...
 
Iterator begin ()
 Return an iterator pointing to the start of the slice.
 
ConstIterator begin () const
 
ConstIterator cbegin () const
 
Iterator end ()
 Return an iterator pointing to the end of the slice.
 
ConstIterator end () const
 
ConstIterator cend () const
 
Reference operator[] (std::size_t n)
 Return a reference to the nth element of the slice. More...
 
ConstReference operator[] (std::size_t n) const
 
std::size_t size () const
 Return the number of elements in the slice.
 
Pointer data ()
 Return a pointer to the first element of the slice.
 
ConstPointer data () const
 

Protected Attributes

Iterator _start_it
 
Iterator _end_it
 

Detailed Description

template<typename SeriesType>
class ska::cheetah::data::SeriesSlice< SeriesType >

A view into a series-like container.

Definition at line 17 of file SeriesSlice.h.

Constructor & Destructor Documentation

◆ SeriesSlice()

template<typename SeriesType >
ska::cheetah::data::SeriesSlice< SeriesType >::SeriesSlice ( Iterator  start_it,
Iterator  end_it 
)

Construct a new instance.

Parameters
[in]start_itThe start iterator
[in]end_itThe end iterator

Definition at line 9 of file SeriesSlice.cpp.

10  : _start_it(std::move(start_it))
11  , _end_it(std::move(end_it))
12 {
13 }

Member Function Documentation

◆ operator[]()

template<typename SeriesType >
SeriesSlice< SeriesType >::Reference ska::cheetah::data::SeriesSlice< SeriesType >::operator[] ( std::size_t  n)

Return a reference to the nth element of the slice.

Parameters
[in]nindex of the element

Definition at line 57 of file SeriesSlice.cpp.

58 {
59  return *(_start_it + n);
60 }

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