Audacity 3.2.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GraphicsDataCacheIterator< CacheElementType > Class Template Referencefinal

A class that implements an iterator for the cache lookup result. More...

#include <GraphicsDataCache.h>

Collaboration diagram for GraphicsDataCacheIterator< CacheElementType >:
[legend]

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using value_type = CacheElementType
 
using pointer = value_type *
 
using reference = value_type &
 

Public Member Functions

 GraphicsDataCacheIterator ()=default
 
 GraphicsDataCacheIterator (const GraphicsDataCacheIterator &)=default
 
 GraphicsDataCacheIterator (GraphicsDataCacheIterator &&)=default
 
GraphicsDataCacheIteratoroperator= (const GraphicsDataCacheIterator &)=default
 
GraphicsDataCacheIteratoroperator= (GraphicsDataCacheIterator &&)=default
 
reference operator* () const
 
pointer operator-> ()
 
GraphicsDataCacheIteratoroperator++ ()
 
GraphicsDataCacheIterator operator++ (int)
 
size_t GetLeftOffset () const
 
size_t GetRightOffset () const
 

Private Member Functions

 GraphicsDataCacheIterator (const GraphicsDataCacheBase::BaseLookupResult &base, bool begin)
 

Private Attributes

GraphicsDataCacheBase::BaseLookupResult mBaseLookup
 
GraphicsDataCacheBase::Lookup::const_iterator mIterator
 

Friends

template<typename T >
class GraphicsDataCache
 
bool operator== (const GraphicsDataCacheIterator &lhs, const GraphicsDataCacheIterator &rhs)
 
bool operator!= (const GraphicsDataCacheIterator &lhs, const GraphicsDataCacheIterator &rhs)
 

Detailed Description

template<typename CacheElementType>
class GraphicsDataCacheIterator< CacheElementType >

A class that implements an iterator for the cache lookup result.

Definition at line 148 of file GraphicsDataCache.h.

Member Typedef Documentation

◆ difference_type

template<typename CacheElementType >
using GraphicsDataCacheIterator< CacheElementType >::difference_type = std::ptrdiff_t

Definition at line 152 of file GraphicsDataCache.h.

◆ iterator_category

template<typename CacheElementType >
using GraphicsDataCacheIterator< CacheElementType >::iterator_category = std::forward_iterator_tag

Definition at line 151 of file GraphicsDataCache.h.

◆ pointer

template<typename CacheElementType >
using GraphicsDataCacheIterator< CacheElementType >::pointer = value_type*

Definition at line 154 of file GraphicsDataCache.h.

◆ reference

template<typename CacheElementType >
using GraphicsDataCacheIterator< CacheElementType >::reference = value_type&

Definition at line 155 of file GraphicsDataCache.h.

◆ value_type

template<typename CacheElementType >
using GraphicsDataCacheIterator< CacheElementType >::value_type = CacheElementType

Definition at line 153 of file GraphicsDataCache.h.

Constructor & Destructor Documentation

◆ GraphicsDataCacheIterator() [1/4]

template<typename CacheElementType >
GraphicsDataCacheIterator< CacheElementType >::GraphicsDataCacheIterator ( )
default

◆ GraphicsDataCacheIterator() [2/4]

template<typename CacheElementType >
GraphicsDataCacheIterator< CacheElementType >::GraphicsDataCacheIterator ( const GraphicsDataCacheIterator< CacheElementType > &  )
default

◆ GraphicsDataCacheIterator() [3/4]

template<typename CacheElementType >
GraphicsDataCacheIterator< CacheElementType >::GraphicsDataCacheIterator ( GraphicsDataCacheIterator< CacheElementType > &&  )
default

◆ GraphicsDataCacheIterator() [4/4]

template<typename CacheElementType >
GraphicsDataCacheIterator< CacheElementType >::GraphicsDataCacheIterator ( const GraphicsDataCacheBase::BaseLookupResult base,
bool  begin 
)
inlineprivate

Definition at line 215 of file GraphicsDataCache.h.

217 : mBaseLookup(base)
218 , mIterator(begin ? base.Begin : base.End)
219 {
220 }
GraphicsDataCacheBase::BaseLookupResult mBaseLookup
GraphicsDataCacheBase::Lookup::const_iterator mIterator
const char * begin(const char *str) noexcept
Definition: StringUtils.h:101
Lookup::iterator Begin
Iterator to the first cache element that fulfills the request.
Lookup::iterator End
Iterator past the last cache element that fulfills the request.

Member Function Documentation

◆ GetLeftOffset()

template<typename CacheElementType >
size_t GraphicsDataCacheIterator< CacheElementType >::GetLeftOffset ( ) const
inline

◆ GetRightOffset()

template<typename CacheElementType >
size_t GraphicsDataCacheIterator< CacheElementType >::GetRightOffset ( ) const
inline

◆ operator*()

template<typename CacheElementType >
reference GraphicsDataCacheIterator< CacheElementType >::operator* ( ) const
inline

Definition at line 163 of file GraphicsDataCache.h.

164 {
165 return static_cast<reference>(*mIterator->Data);
166 }

References GraphicsDataCacheIterator< CacheElementType >::mIterator.

◆ operator++() [1/2]

template<typename CacheElementType >
GraphicsDataCacheIterator & GraphicsDataCacheIterator< CacheElementType >::operator++ ( )
inline

Definition at line 173 of file GraphicsDataCache.h.

174 {
175 mIterator++;
176 return *this;
177 }

References GraphicsDataCacheIterator< CacheElementType >::mIterator.

◆ operator++() [2/2]

template<typename CacheElementType >
GraphicsDataCacheIterator GraphicsDataCacheIterator< CacheElementType >::operator++ ( int  )
inline

Definition at line 180 of file GraphicsDataCache.h.

181 {
182 GraphicsDataCacheIterator tmp = *this;
183 ++(*this);
184 return tmp;
185 }
A class that implements an iterator for the cache lookup result.

◆ operator->()

template<typename CacheElementType >
pointer GraphicsDataCacheIterator< CacheElementType >::operator-> ( )
inline

Definition at line 167 of file GraphicsDataCache.h.

168 {
169 return static_cast<pointer>(mIterator->Data);
170 }

References GraphicsDataCacheIterator< CacheElementType >::mIterator.

◆ operator=() [1/2]

template<typename CacheElementType >
GraphicsDataCacheIterator & GraphicsDataCacheIterator< CacheElementType >::operator= ( const GraphicsDataCacheIterator< CacheElementType > &  )
default

◆ operator=() [2/2]

template<typename CacheElementType >
GraphicsDataCacheIterator & GraphicsDataCacheIterator< CacheElementType >::operator= ( GraphicsDataCacheIterator< CacheElementType > &&  )
default

Friends And Related Function Documentation

◆ GraphicsDataCache

template<typename CacheElementType >
template<typename T >
friend class GraphicsDataCache
friend

Definition at line 226 of file GraphicsDataCache.h.

◆ operator!=

template<typename CacheElementType >
bool operator!= ( const GraphicsDataCacheIterator< CacheElementType > &  lhs,
const GraphicsDataCacheIterator< CacheElementType > &  rhs 
)
friend

Definition at line 207 of file GraphicsDataCache.h.

210 {
211 return lhs.mIterator != rhs.mIterator;
212 };

◆ operator==

template<typename CacheElementType >
bool operator== ( const GraphicsDataCacheIterator< CacheElementType > &  lhs,
const GraphicsDataCacheIterator< CacheElementType > &  rhs 
)
friend

Definition at line 200 of file GraphicsDataCache.h.

203 {
204 return lhs.mIterator == rhs.mIterator;
205 };

Member Data Documentation

◆ mBaseLookup

template<typename CacheElementType >
GraphicsDataCacheBase::BaseLookupResult GraphicsDataCacheIterator< CacheElementType >::mBaseLookup
private

◆ mIterator

template<typename CacheElementType >
GraphicsDataCacheBase::Lookup::const_iterator GraphicsDataCacheIterator< CacheElementType >::mIterator
private

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