Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DmTime.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_DMTIME_H
25 #define SKA_CHEETAH_DATA_DMTIME_H
26 
27 #include "cheetah/data/detail/DmTimeSlice.h"
28 #include "cheetah/utils/Architectures.h"
29 #include "panda/DataChunk.h"
30 
31 #include <memory>
32 #include <list>
33 
34 namespace ska {
35 namespace cheetah {
36 namespace data {
37 namespace detail {
38  template <typename DmTimeType>
39  class DmTimeIterator;
40 } // namespace detail
41 
90 template <typename DmTrialsType>
91 class DmTime
92  : public panda::DataChunk<DmTime<DmTrialsType>>
93 {
94  private:
95  typedef DmTime<DmTrialsType> SelfType;
96 
97  public:
98  typedef std::list<std::shared_ptr<DmTrialsType>> ContainerType;
99  typedef std::shared_ptr<DmTrialsType> ValueType;
100  typedef detail::DmTimeSlice<SelfType> SliceType;
101  typedef detail::DmTimeIterator<SelfType> Iterator;
102  typedef detail::DmTimeIterator<SelfType const> ConstIterator;
103 
104  public:
105  ~DmTime();
115  void add(ValueType data);
116 
120  void clear();
121 
129  Iterator begin(std::size_t number_dms_per_slice);
130  ConstIterator cbegin(std::size_t number_dms_per_slice) const;
131 
137  Iterator end();
138  ConstIterator cend() const;
139 
145  ContainerType const& blocks() const;
146  ContainerType& blocks();
147 
148  private:
152  friend panda::DataChunk<SelfType>;
153  DmTime();
154 
155  private:
156  ContainerType _data;
157 };
158 
159 } // namespace data
160 } // namespace cheetah
161 } // namespace ska
162 
163 #include "cheetah/data/detail/DmTimeIterator.h"
164 #include "cheetah/data/detail/DmTime.cpp"
165 
166 #endif // SKA_CHEETAH_DATA_DMTIME_H
Some limits and constants for FLDO.
Definition: Brdz.h:35