Audacity 3.2.0
Public Member Functions | Private Types | Private Attributes | Friends | List of all members
WideChannelGroupInterval::ChannelIterator< IntervalType > Class Template Reference

#include <Channel.h>

Inheritance diagram for WideChannelGroupInterval::ChannelIterator< IntervalType >:
[legend]
Collaboration diagram for WideChannelGroupInterval::ChannelIterator< IntervalType >:
[legend]

Public Member Functions

 ChannelIterator ()=default
 
 ChannelIterator (GroupType *pGroup, size_t index)
 
std::shared_ptr< IntervalType > operator* () const
 
ChannelIteratoroperator++ ()
 
ChannelIterator operator++ (int)
 
ChannelIteratoroperator-- ()
 
ChannelIterator operator-- (int)
 

Private Types

using GroupType = std::conditional_t< std::is_const_v< IntervalType >, const WideChannelGroupInterval, WideChannelGroupInterval >
 

Private Attributes

GroupTypempGroup {}
 
size_t mIndex {}
 

Friends

bool operator== (ChannelIterator a, ChannelIterator b)
 
bool operator!= (ChannelIterator a, ChannelIterator b)
 

Additional Inherited Members

- Public Types inherited from ValueIterator< std::shared_ptr< IntervalType >, std::bidirectional_iterator_tag >
using iterator_category = std::bidirectional_iterator_tag
 
using value_type = std::shared_ptr< IntervalType >
 
using difference_type = ptrdiff_t
 
using pointer = void
 
using reference = const std::shared_ptr< IntervalType >
 

Detailed Description

template<typename IntervalType>
class WideChannelGroupInterval::ChannelIterator< IntervalType >

Iterator for channels; destroying the related ChannelGroup or WideChannelGroupInterval invalidates it

Definition at line 95 of file Channel.h.

Member Typedef Documentation

◆ GroupType

template<typename IntervalType >
using WideChannelGroupInterval::ChannelIterator< IntervalType >::GroupType = std::conditional_t<std::is_const_v<IntervalType>, const WideChannelGroupInterval, WideChannelGroupInterval>
private

Definition at line 100 of file Channel.h.

Constructor & Destructor Documentation

◆ ChannelIterator() [1/2]

template<typename IntervalType >
WideChannelGroupInterval::ChannelIterator< IntervalType >::ChannelIterator ( )
default

◆ ChannelIterator() [2/2]

template<typename IntervalType >
WideChannelGroupInterval::ChannelIterator< IntervalType >::ChannelIterator ( GroupType pGroup,
size_t  index 
)
inline

Definition at line 104 of file Channel.h.

105 : mpGroup{ pGroup }, mIndex{ index }
106 {}

Member Function Documentation

◆ operator*()

template<typename IntervalType >
std::shared_ptr< IntervalType > WideChannelGroupInterval::ChannelIterator< IntervalType >::operator* ( ) const
inline

Definition at line 108 of file Channel.h.

109 {
110 if (!mpGroup || mIndex >= mpGroup->NChannels())
111 return {};
112 return mpGroup->template GetChannel<IntervalType>(mIndex);
113 }

◆ operator++() [1/2]

template<typename IntervalType >
ChannelIterator & WideChannelGroupInterval::ChannelIterator< IntervalType >::operator++ ( )
inline

Definition at line 115 of file Channel.h.

115{ ++mIndex; return *this; }

◆ operator++() [2/2]

template<typename IntervalType >
ChannelIterator WideChannelGroupInterval::ChannelIterator< IntervalType >::operator++ ( int  )
inline

Definition at line 116 of file Channel.h.

117 { auto copy{ *this }; operator ++(); return copy; }
void copy(const T *src, T *dst, int32_t n)
Definition: VectorOps.h:40

References staffpad::vo::copy().

Here is the call graph for this function:

◆ operator--() [1/2]

template<typename IntervalType >
ChannelIterator & WideChannelGroupInterval::ChannelIterator< IntervalType >::operator-- ( )
inline

Definition at line 119 of file Channel.h.

119{ --mIndex; return *this; }

◆ operator--() [2/2]

template<typename IntervalType >
ChannelIterator WideChannelGroupInterval::ChannelIterator< IntervalType >::operator-- ( int  )
inline

Definition at line 120 of file Channel.h.

121 { auto copy{ *this }; operator --(); return copy; }

References staffpad::vo::copy().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

template<typename IntervalType >
bool operator!= ( ChannelIterator< IntervalType >  a,
ChannelIterator< IntervalType >  b 
)
friend

Definition at line 125 of file Channel.h.

126 { return !(a == b); }

◆ operator==

template<typename IntervalType >
bool operator== ( ChannelIterator< IntervalType >  a,
ChannelIterator< IntervalType >  b 
)
friend

Definition at line 123 of file Channel.h.

124 { return a.mpGroup == b.mpGroup && a.mIndex == b.mIndex; }

Member Data Documentation

◆ mIndex

template<typename IntervalType >
size_t WideChannelGroupInterval::ChannelIterator< IntervalType >::mIndex {}
private

Definition at line 130 of file Channel.h.

◆ mpGroup

template<typename IntervalType >
GroupType* WideChannelGroupInterval::ChannelIterator< IntervalType >::mpGroup {}
private

Definition at line 129 of file Channel.h.


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