Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DmTimeSlice.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_DMTIMEBUFFERSLICE_H
25 #define SKA_CHEETAH_DATA_DMTIMEBUFFERSLICE_H
26 
27 #include "cheetah/data/DmTime.h"
28 #include "cheetah/utils/Architectures.h"
29 
30 #include "panda/DataChunk.h"
31 
32 #include <memory>
33 #include <list>
34 
35 
36 namespace ska {
37 namespace cheetah {
38 namespace data {
39 namespace detail {
40 
41 template <typename DmTimeType>
43 
53 template <typename DmTimeType>
54 class DmTimeSlice: public panda::DataChunk<DmTimeSlice<DmTimeType>>
55 {
56  private:
58 
59  public:
60  typedef std::shared_ptr<DmTimeType> ParentType;
61  typedef typename DmTimeType::ContainerType ContainerType;
64 
65  public:
66  ~DmTimeSlice();
67 
73  Iterator begin();
74  ConstIterator cbegin() const;
75 
81  Iterator end();
82  ConstIterator cend() const;
83 
89  ContainerType const& blocks() const;
90 
91  private:
92  friend panda::DataChunk<SelfType>;
93 
103  DmTimeSlice(std::size_t start_dm_idx, std::size_t number_dms_per_slice,
104  ParentType parent);
105 
106  private:
107  ParentType _parent;
108  std::size_t _start_dm_idx;
109  std::size_t _number_dms_per_slice;
110 
111 };
112 
113 } // namespace detail
114 } // namespace data
115 } // namespace cheetah
116 } // namespace ska
117 
118 #include "cheetah/data/detail/DmTimeSlice.cpp"
119 
120 #endif // SKA_CHEETAH_DATA_DMTIMESLICE_H
Class that wraps a subset of DMs from a DmTime object.
Definition: DmTimeSlice.h:54
Some limits and constants for FLDO.
Definition: Brdz.h:35
ContainerType const & blocks() const
Get a constant reference to the underlying list of DmTime shared pointers.
Definition: DmTimeSlice.cpp:52
An iterator over a DmTimeSlice object.
Definition: DmTimeSlice.h:42
Iterator begin()
Get an iterator poiting to the start of the slice.
Definition: DmTimeSlice.cpp:24
Iterator end()
Get an iterator poiting to the end of the slice.
Definition: DmTimeSlice.cpp:36