Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MemoryStream::Iterator Struct Reference

#include <MemoryStream.h>

Inheritance diagram for MemoryStream::Iterator:
[legend]
Collaboration diagram for MemoryStream::Iterator:
[legend]

Public Member Functions

 Iterator (const Iterator &)=default
 
Iteratoroperator++ ()
 
Iterator operator++ (int)
 
StreamChunk operator* () const
 
StreamChunk operator-> () const
 
bool operator== (const Iterator &rhs) const noexcept
 
bool operator!= (const Iterator &rhs) const noexcept
 

Private Member Functions

 Iterator (const MemoryStream *stream, bool isBegin)
 

Private Attributes

const MemoryStreammStream { nullptr }
 
ChunksList::const_iterator mListIterator
 
bool mShowLinearPart { false }
 

Friends

class MemoryStream
 

Additional Inherited Members

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

Detailed Description

Definition at line 70 of file libraries/lib-utility/memorystream.h.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

MemoryStream::Iterator::Iterator ( const Iterator )
default

◆ Iterator() [2/2]

MemoryStream::Iterator::Iterator ( const MemoryStream stream,
bool  isBegin 
)
private

Definition at line 115 of file libraries/lib-utility/memorystream.cpp.

116 : mStream(stream)
117 , mListIterator(isBegin ? mStream->mChunks.cbegin() : mStream->mChunks.cend())
118 , mShowLinearPart(isBegin && mStream->mLinearData.size() > 0)
119{
120}
ChunksList::const_iterator mListIterator

Member Function Documentation

◆ operator!=()

bool MemoryStream::Iterator::operator!= ( const Iterator rhs) const
noexcept

Definition at line 152 of file libraries/lib-utility/memorystream.cpp.

153{
154 return !(*this == rhs);
155}

◆ operator*()

MemoryStream::StreamChunk MemoryStream::Iterator::operator* ( ) const

Definition at line 139 of file libraries/lib-utility/memorystream.cpp.

140{
141 if (mShowLinearPart)
142 return { mStream->mLinearData.data(), mStream->mLinearData.size() };
143
144 return { mListIterator->Data.data(), mListIterator->BytesUsed };
145}

◆ operator++() [1/2]

MemoryStream::Iterator & MemoryStream::Iterator::operator++ ( )

Definition at line 122 of file libraries/lib-utility/memorystream.cpp.

123{
124 if (mShowLinearPart)
125 mShowLinearPart = false;
126 else
128
129 return *this;
130}

◆ operator++() [2/2]

MemoryStream::Iterator MemoryStream::Iterator::operator++ ( int  )

Definition at line 132 of file libraries/lib-utility/memorystream.cpp.

133{
134 Iterator result { *this };
135 this->operator++();
136 return result;
137}
Iterator(const Iterator &)=default

◆ operator->()

MemoryStream::StreamChunk MemoryStream::Iterator::operator-> ( ) const

Definition at line 147 of file libraries/lib-utility/memorystream.cpp.

148{
149 return this->operator*();
150}

References operator*().

Here is the call graph for this function:

◆ operator==()

bool MemoryStream::Iterator::operator== ( const Iterator rhs) const
noexcept

Definition at line 157 of file libraries/lib-utility/memorystream.cpp.

158{
159 return mStream == rhs.mStream && mListIterator == rhs.mListIterator &&
160 mShowLinearPart == rhs.mShowLinearPart;
161}

Friends And Related Function Documentation

◆ MemoryStream

friend class MemoryStream
friend

Definition at line 91 of file libraries/lib-utility/memorystream.h.

Member Data Documentation

◆ mListIterator

ChunksList::const_iterator MemoryStream::Iterator::mListIterator
private

Definition at line 88 of file libraries/lib-utility/memorystream.h.

◆ mShowLinearPart

bool MemoryStream::Iterator::mShowLinearPart { false }
private

Definition at line 89 of file libraries/lib-utility/memorystream.h.

◆ mStream

const MemoryStream* MemoryStream::Iterator::mStream { nullptr }
private

Definition at line 87 of file libraries/lib-utility/memorystream.h.


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