Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DmTimeIterator.cpp
1 #include "cheetah/data/detail/DmTimeIterator.h"
2 
3 namespace ska {
4 namespace cheetah {
5 namespace data {
6 namespace detail {
7 
8 template <typename DmTimeType>
9 DmTimeIterator<DmTimeType>::DmTimeIterator(std::size_t current_dm_idx,
10  std::size_t number_dms_per_slice, std::shared_ptr<DmTimeType> parent)
11  : _current_dm_idx(current_dm_idx)
12  , _number_dms_per_slice(number_dms_per_slice)
13  , _parent(parent)
14 {
15 }
16 
17 template <typename DmTimeType>
19 {
20 }
21 
22 template <typename DmTimeType>
24 {
25  _current_dm_idx+=_number_dms_per_slice;
26  return *this;
27 }
28 
29 template <typename DmTimeType>
30 std::shared_ptr<typename DmTimeIterator<DmTimeType>::SliceType> DmTimeIterator<DmTimeType>::operator*() const
31 {
32  return SliceType::make_shared(_current_dm_idx, _number_dms_per_slice, _parent);
33 }
34 
35 template <typename DmTimeType>
37 {
38  return _current_dm_idx != other._current_dm_idx;
39 }
40 
41 template <typename DmTimeType>
43 {
44  return _current_dm_idx == other._current_dm_idx;
45 }
46 
47 template <typename DmTimeType>
49 {
50  return _current_dm_idx < other._current_dm_idx;
51 }
52 
53 template <typename DmTimeType>
55 {
56  return _current_dm_idx > other._current_dm_idx;
57 }
58 
59 } // namespace detail
60 } // namespace data
61 } // namespace cheetah
62 } // namespace ska
DmTimeIterator & operator++()
Increment the iterator.
Provides an iterator over a DmTime in slices of DMs.
bool operator!=(DmTimeIterator const &other) const
Test if another DmTimeIterator is different to this one.
bool operator<(DmTimeIterator const &other) const
Test if another DmTimeIterator is the before this one.
Some limits and constants for FLDO.
Definition: Brdz.h:35
bool operator==(DmTimeIterator const &other) const
Test if another DmTimeIterator is the same as this one.
bool operator>(DmTimeIterator const &other) const
Test if another DmTimeIterator is the after this one.
DmTimeIterator(std::size_t current_dm_idx, std::size_t number_dms_per_slice, std::shared_ptr< DmTimeType > parent)
Create a new instances.
std::shared_ptr< SliceType > operator*() const
Dereference the iterator.