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

#include <Channel.h>

Inheritance diagram for ChannelGroup::IntervalIterator< IntervalType >:
[legend]
Collaboration diagram for ChannelGroup::IntervalIterator< IntervalType >:
[legend]

Public Member Functions

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

Private Types

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

Private Attributes

GroupTypempGroup {}
 
size_t mIndex {}
 

Friends

bool operator== (IntervalIterator a, IntervalIterator b)
 
bool operator!= (IntervalIterator a, IntervalIterator 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 ChannelGroup::IntervalIterator< IntervalType >

Iterator for intervals; destroying the related ChannelGroup invalidates it

Some intervals may have zero duration, and no ordering of the intervals is assumed.

Definition at line 470 of file Channel.h.

Member Typedef Documentation

◆ GroupType

template<typename IntervalType >
using ChannelGroup::IntervalIterator< IntervalType >::GroupType = std::conditional_t<std::is_const_v<IntervalType>, const ChannelGroup, ChannelGroup>
private

Definition at line 475 of file Channel.h.

Constructor & Destructor Documentation

◆ IntervalIterator() [1/2]

template<typename IntervalType >
ChannelGroup::IntervalIterator< IntervalType >::IntervalIterator ( )
default

◆ IntervalIterator() [2/2]

template<typename IntervalType >
ChannelGroup::IntervalIterator< IntervalType >::IntervalIterator ( GroupType pGroup,
size_t  index 
)
inline

Definition at line 479 of file Channel.h.

480 : mpGroup{ pGroup }, mIndex{ index }
481 {}

Member Function Documentation

◆ operator*()

template<typename IntervalType >
std::shared_ptr< IntervalType > ChannelGroup::IntervalIterator< IntervalType >::operator* ( ) const
inline

Definition at line 483 of file Channel.h.

484 {
485 if (!mpGroup || mIndex >= mpGroup->NIntervals())
486 return {};
487 return mpGroup->template GetInterval<IntervalType>(mIndex);
488 }

◆ operator++() [1/2]

template<typename IntervalType >
IntervalIterator & ChannelGroup::IntervalIterator< IntervalType >::operator++ ( )
inline

Definition at line 490 of file Channel.h.

490{ ++mIndex; return *this; }

◆ operator++() [2/2]

template<typename IntervalType >
IntervalIterator ChannelGroup::IntervalIterator< IntervalType >::operator++ ( int  )
inline

Definition at line 491 of file Channel.h.

492 { auto copy{ *this }; operator ++(); return copy; }
IntervalIterator & operator++()
Definition: Channel.h:490
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 >
IntervalIterator & ChannelGroup::IntervalIterator< IntervalType >::operator-- ( )
inline

Definition at line 494 of file Channel.h.

494{ --mIndex; return *this; }

◆ operator--() [2/2]

template<typename IntervalType >
IntervalIterator ChannelGroup::IntervalIterator< IntervalType >::operator-- ( int  )
inline

Definition at line 495 of file Channel.h.

496 { auto copy{ *this }; operator --(); return copy; }
IntervalIterator & operator--()
Definition: Channel.h:494

References staffpad::vo::copy().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 500 of file Channel.h.

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

◆ operator==

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

Definition at line 498 of file Channel.h.

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

Member Data Documentation

◆ mIndex

template<typename IntervalType >
size_t ChannelGroup::IntervalIterator< IntervalType >::mIndex {}
private

Definition at line 505 of file Channel.h.

◆ mpGroup

template<typename IntervalType >
GroupType* ChannelGroup::IntervalIterator< IntervalType >::mpGroup {}
private

Definition at line 504 of file Channel.h.


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