JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::AbstractFifo::ScopedReadWrite< mode > Class Template Referencefinal

Class for a scoped reader/writer. More...

#include <juce_AbstractFifo.h>

Collaboration diagram for juce::AbstractFifo::ScopedReadWrite< mode >:

Public Member Functions

 ScopedReadWrite ()=default
 Construct an unassigned reader/writer. More...
 
 ScopedReadWrite (AbstractFifo &, int num) noexcept
 Construct a reader/writer and immediately call prepareRead/prepareWrite on the abstractFifo which was passed in. More...
 
 ScopedReadWrite (const ScopedReadWrite &)=delete
 
 ScopedReadWrite (ScopedReadWrite &&) noexcept
 
 ~ScopedReadWrite () noexcept
 Calls finishedRead or finishedWrite if this is a non-null scoped reader/writer. More...
 
template<typename FunctionToApply >
void forEach (FunctionToApply &&func) const
 Calls the passed function with each index that was deemed valid for the current read/write operation. More...
 
ScopedReadWriteoperator= (const ScopedReadWrite &)=delete
 
ScopedReadWriteoperator= (ScopedReadWrite &&) noexcept
 

Public Attributes

int blockSize1
 
int blockSize2
 
int startIndex1
 
int startIndex2
 

Private Member Functions

void prepare (AbstractFifo &, int) noexcept
 
void swap (ScopedReadWrite &) noexcept
 

Static Private Member Functions

static void finish (AbstractFifo &, int) noexcept
 

Private Attributes

AbstractFifofifo = nullptr
 

Detailed Description

template<ReadOrWrite mode>
class juce::AbstractFifo::ScopedReadWrite< mode >

Class for a scoped reader/writer.

Constructor & Destructor Documentation

◆ ScopedReadWrite() [1/4]

template<ReadOrWrite mode>
juce::AbstractFifo::ScopedReadWrite< mode >::ScopedReadWrite ( )
default

Construct an unassigned reader/writer.

Doesn't do anything upon destruction.

◆ ScopedReadWrite() [2/4]

template<ReadOrWrite mode>
juce::AbstractFifo::ScopedReadWrite< mode >::ScopedReadWrite ( AbstractFifo ,
int  num 
)
noexcept

Construct a reader/writer and immediately call prepareRead/prepareWrite on the abstractFifo which was passed in.

This object will hold a pointer back to the fifo, so make sure that the fifo outlives this object.

◆ ScopedReadWrite() [3/4]

template<ReadOrWrite mode>
juce::AbstractFifo::ScopedReadWrite< mode >::ScopedReadWrite ( const ScopedReadWrite< mode > &  )
delete

◆ ScopedReadWrite() [4/4]

template<ReadOrWrite mode>
juce::AbstractFifo::ScopedReadWrite< mode >::ScopedReadWrite ( ScopedReadWrite< mode > &&  )
noexcept

◆ ~ScopedReadWrite()

template<ReadOrWrite mode>
juce::AbstractFifo::ScopedReadWrite< mode >::~ScopedReadWrite ( )
noexcept

Calls finishedRead or finishedWrite if this is a non-null scoped reader/writer.

Member Function Documentation

◆ finish()

template<ReadOrWrite mode>
static void juce::AbstractFifo::ScopedReadWrite< mode >::finish ( AbstractFifo ,
int   
)
staticprivatenoexcept

◆ forEach()

template<ReadOrWrite mode>
template<typename FunctionToApply >
void juce::AbstractFifo::ScopedReadWrite< mode >::forEach ( FunctionToApply &&  func) const
inline

Calls the passed function with each index that was deemed valid for the current read/write operation.

◆ operator=() [1/2]

template<ReadOrWrite mode>
ScopedReadWrite& juce::AbstractFifo::ScopedReadWrite< mode >::operator= ( const ScopedReadWrite< mode > &  )
delete

◆ operator=() [2/2]

template<ReadOrWrite mode>
ScopedReadWrite& juce::AbstractFifo::ScopedReadWrite< mode >::operator= ( ScopedReadWrite< mode > &&  )
noexcept

◆ prepare()

template<ReadOrWrite mode>
void juce::AbstractFifo::ScopedReadWrite< mode >::prepare ( AbstractFifo ,
int   
)
privatenoexcept

◆ swap()

template<ReadOrWrite mode>
void juce::AbstractFifo::ScopedReadWrite< mode >::swap ( ScopedReadWrite< mode > &  )
privatenoexcept

Member Data Documentation

◆ blockSize1

template<ReadOrWrite mode>
int juce::AbstractFifo::ScopedReadWrite< mode >::blockSize1

◆ blockSize2

template<ReadOrWrite mode>
int juce::AbstractFifo::ScopedReadWrite< mode >::blockSize2

◆ fifo

template<ReadOrWrite mode>
AbstractFifo* juce::AbstractFifo::ScopedReadWrite< mode >::fifo = nullptr
private

◆ startIndex1

template<ReadOrWrite mode>
int juce::AbstractFifo::ScopedReadWrite< mode >::startIndex1

◆ startIndex2

template<ReadOrWrite mode>
int juce::AbstractFifo::ScopedReadWrite< mode >::startIndex2

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