Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::data::detail::DmTimeIterator< DmTimeType > Class Template Reference

Provides an iterator over a DmTime in slices of DMs. More...

#include <cheetah/data/detail/DmTimeIterator.h>

Collaboration diagram for ska::cheetah::data::detail::DmTimeIterator< DmTimeType >:
Collaboration graph

Public Types

typedef DmTimeType::SliceType SliceType
 

Public Member Functions

 DmTimeIterator (std::size_t current_dm_idx, std::size_t number_dms_per_slice, std::shared_ptr< DmTimeType > parent)
 Create a new instances. More...
 
DmTimeIteratoroperator++ ()
 Increment the iterator. More...
 
std::shared_ptr< SliceType > operator* () const
 Dereference the iterator. More...
 
bool operator!= (DmTimeIterator const &other) const
 Test if another DmTimeIterator is different to this one. More...
 
bool operator== (DmTimeIterator const &other) const
 Test if another DmTimeIterator is the same as this one. More...
 
bool operator< (DmTimeIterator const &other) const
 Test if another DmTimeIterator is the before this one. More...
 
bool operator> (DmTimeIterator const &other) const
 Test if another DmTimeIterator is the after this one. More...
 

Detailed Description

template<typename DmTimeType>
class ska::cheetah::data::detail::DmTimeIterator< DmTimeType >

Provides an iterator over a DmTime in slices of DMs.

The DmTimeIterator is used to slice a DmTime into multiple SliceType instances, each of which provides access to a subset of DM trials stored in the DmTime.

Definition at line 28 of file DmTimeIterator.h.

Constructor & Destructor Documentation

◆ DmTimeIterator()

template<typename DmTimeType >
ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::DmTimeIterator ( std::size_t  current_dm_idx,
std::size_t  number_dms_per_slice,
std::shared_ptr< DmTimeType >  parent 
)

Create a new instances.

Parameters
[in]current_dm_idxThe current dm index
[in]number_dms_per_sliceThe number dms per slice
[in]parentThe parent DmTime object

Definition at line 9 of file DmTimeIterator.cpp.

11  : _current_dm_idx(current_dm_idx)
12  , _number_dms_per_slice(number_dms_per_slice)
13  , _parent(parent)
14 {
15 }

Member Function Documentation

◆ operator!=()

template<typename DmTimeType >
bool ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::operator!= ( DmTimeIterator< DmTimeType > const &  other) const

Test if another DmTimeIterator is different to this one.

Parameters
otherAnother DmTimeIterator instance
Returns
true or false

Definition at line 36 of file DmTimeIterator.cpp.

37 {
38  return _current_dm_idx != other._current_dm_idx;
39 }

◆ operator*()

template<typename DmTimeType >
std::shared_ptr< typename DmTimeIterator< DmTimeType >::SliceType > ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::operator* ( ) const

Dereference the iterator.

Returns
Returns a SliceType object containing a subset of DM trials.

Definition at line 30 of file DmTimeIterator.cpp.

31 {
32  return SliceType::make_shared(_current_dm_idx, _number_dms_per_slice, _parent);
33 }

◆ operator++()

template<typename DmTimeType >
DmTimeIterator< DmTimeType > & ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::operator++ ( )

Increment the iterator.

Returns
A reference to an iterator pointing to the next SliceType object.

Definition at line 23 of file DmTimeIterator.cpp.

24 {
25  _current_dm_idx+=_number_dms_per_slice;
26  return *this;
27 }

◆ operator<()

template<typename DmTimeType >
bool ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::operator< ( DmTimeIterator< DmTimeType > const &  other) const

Test if another DmTimeIterator is the before this one.

Parameters
otherThe other
Returns
true or false

Definition at line 48 of file DmTimeIterator.cpp.

49 {
50  return _current_dm_idx < other._current_dm_idx;
51 }

◆ operator==()

template<typename DmTimeType >
bool ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::operator== ( DmTimeIterator< DmTimeType > const &  other) const

Test if another DmTimeIterator is the same as this one.

Parameters
otherAnother DmTimeIterator instance
Returns
true or false

Definition at line 42 of file DmTimeIterator.cpp.

43 {
44  return _current_dm_idx == other._current_dm_idx;
45 }

◆ operator>()

template<typename DmTimeType >
bool ska::cheetah::data::detail::DmTimeIterator< DmTimeType >::operator> ( DmTimeIterator< DmTimeType > const &  other) const

Test if another DmTimeIterator is the after this one.

Parameters
otherThe other
Returns
true or false

Definition at line 54 of file DmTimeIterator.cpp.

55 {
56  return _current_dm_idx > other._current_dm_idx;
57 }

The documentation for this class was generated from the following files: