Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
SeriesSlice.h
1 #ifndef SKA_CHEETAH_DATA_SERIESSLICE_H
2 #define SKA_CHEETAH_DATA_SERIESSLICE_H
3 #include <iterator>
4 
5 
6 namespace ska {
7 namespace cheetah {
8 namespace data {
9 
16 template <typename SeriesType>
18 {
19  public:
20  typedef typename SeriesType::Iterator Iterator;
21  typedef typename SeriesType::ConstIterator ConstIterator;
22  typedef typename std::iterator_traits<Iterator>::pointer Pointer;
23  typedef typename std::iterator_traits<ConstIterator>::pointer ConstPointer;
24  typedef typename std::iterator_traits<Iterator>::reference Reference;
25  typedef typename std::iterator_traits<ConstIterator>::reference ConstReference;
26  typedef typename std::iterator_traits<Iterator>::value_type ValueType;
27 
28  public:
35  SeriesSlice(Iterator start_it, Iterator end_it);
36  virtual ~SeriesSlice();
37 
41  Iterator begin();
42  ConstIterator begin() const;
43  ConstIterator cbegin() const;
44 
48  Iterator end();
49  ConstIterator end() const;
50  ConstIterator cend() const;
51 
57  Reference operator[](std::size_t n);
58  ConstReference operator[](std::size_t n) const;
59 
63  std::size_t size() const;
64 
68  Pointer data();
69  ConstPointer data() const;
70 
71  protected:
72  Iterator _start_it;
73  Iterator _end_it;
74 };
75 
76 
77 } // namespace data
78 } // namespace cheetah
79 } // namespace ska
80 
81 #include "cheetah/data/detail/SeriesSlice.cpp"
82 
83 #endif // SKA_CHEETAH_DATA_SERIESSLICE_H
SeriesSlice(Iterator start_it, Iterator end_it)
Construct a new instance.
Definition: SeriesSlice.cpp:9
Reference operator[](std::size_t n)
Return a reference to the nth element of the slice.
Definition: SeriesSlice.cpp:57
Iterator end()
Return an iterator pointing to the end of the slice.
Definition: SeriesSlice.cpp:39
std::size_t size() const
Return the number of elements in the slice.
Definition: SeriesSlice.cpp:69
Iterator begin()
Return an iterator pointing to the start of the slice.
Definition: SeriesSlice.cpp:21
Some limits and constants for FLDO.
Definition: Brdz.h:35
A view into a series-like container.
Definition: SeriesSlice.h:17
Pointer data()
Return a pointer to the first element of the slice.
Definition: SeriesSlice.cpp:75