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 455 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 460 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 464 of file Channel.h.

465 : mpGroup{ pGroup }, mIndex{ index }
466 {}

Member Function Documentation

◆ operator*()

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

Definition at line 468 of file Channel.h.

469 {
470 if (!mpGroup || mIndex >= mpGroup->NIntervals())
471 return {};
472 return mpGroup->template GetInterval<IntervalType>(mIndex);
473 }

◆ operator++() [1/2]

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

Definition at line 475 of file Channel.h.

475{ ++mIndex; return *this; }

◆ operator++() [2/2]

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

Definition at line 476 of file Channel.h.

477 { auto copy{ *this }; operator ++(); return copy; }
IntervalIterator & operator++()
Definition: Channel.h:475
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 479 of file Channel.h.

479{ --mIndex; return *this; }

◆ operator--() [2/2]

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

Definition at line 480 of file Channel.h.

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

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 485 of file Channel.h.

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

◆ operator==

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

Definition at line 483 of file Channel.h.

484 { 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 490 of file Channel.h.

◆ mpGroup

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

Definition at line 489 of file Channel.h.


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