Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DataSequence2DPartialIterator.h
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef SKA_CHEETAH_DATA_DATASEQUENCE2DPARTIALITERATOR_H
25 #define SKA_CHEETAH_DATA_DATASEQUENCE2DPARTIALITERATOR_H
26 
27 #include <iterator>
28 #include <memory>
29 
30 #include "cheetah/data/DataSequence2D.h"
31 #include "cheetah/data/DataSequence2DFastIterator.h"
32 #include "cheetah/data/DataSequence2DIterator.h"
33 
34 namespace ska {
35 namespace cheetah {
36 namespace data {
37 
42 template <typename Arch, typename Type>
44 {
45 };
46 
47 
64 template <typename Type>
65 class DataSequence2DPartialIterator<Cpu,Type> : public DataSequence2DFastIteratorBase<Type, DataSequence2DPartialIterator<Cpu,Type> >
66 {
68 
69  public:
70  typedef typename std::iterator_traits<DataSequence2DPartialIterator<Cpu,Type>>::pointer PtrType;
71  typedef typename std::iterator_traits<DataSequence2DPartialIterator<Cpu,Type>>::reference RefType;
72  typedef typename std::iterator_traits<DataSequence2DPartialIterator<Cpu,Type>>::difference_type DiffType;
74  typedef SelfType Iterator;
75 
76  public:
89  DataSequence2DPartialIterator(const DataSequence2D<Cpu,typename std::remove_cv<Type>::type> &data_ptr,
90  std::size_t fbegin, std::size_t fend, std::size_t sbegin, std::size_t send);
91 
92  DataSequence2DPartialIterator(DataSequence2D<Cpu,typename std::remove_cv<Type>::type> &data_ptr,
93  std::size_t fbegin, std::size_t fend, std::size_t sbegin, std::size_t send);
94 
99 
104 
109 
114  PtrType operator->() const override;
115 
119  RefType operator*() const override;
120 
124  SelfType begin() const;
125 
129  SelfType end() const;
130 
131  protected:
132  std::size_t mangle_offset(std::size_t off) const;
133 
134  private:
135  std::size_t _fbegin;
136  std::size_t _fend;
137  std::size_t _sbegin;
138  std::size_t _send;
139  std::size_t _flength;
140 
141 };
142 
143 } // namespace data
144 } // namespace cheetah
145 } // namespace ska
146 
147 #include "cheetah/data/detail/DataSequence2DPartialIterator.cpp"
148 #include "cheetah/data/detail/DataSequence2DPartialIterator_bool.cpp"
149 
150 #endif // SKA_CHEETAH_DATA_DATASEQUENCE2DPARTIALITERATOR_H
Iterator over partial ranges of DataSequence2D types, "fast" axis. CPU specialisation.
Iterator over DataSequence2D types, over "fast" axis. CPU specific type.
Some limits and constants for FLDO.
Definition: Brdz.h:35
A 2-dimensional sequencial data of type T.
A generic iterator for DataSequence2D.
Iterator over partial ranges of DataSequence2D types, "fast" axis. Generic type.