Audacity 3.2.0
Classes | Functions
IteratorX.h File Reference
#include <algorithm>
#include <functional>
#include <iterator>
#include <limits>
Include dependency graph for IteratorX.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ValueIterator< Value, Category >
 A convenience for defining iterators that return rvalue types, so that they cooperate correctly with stl algorithms and std::reverse_iterator. More...
 
struct  IteratorRange< Iterator >
 A convenience for use with range-for. More...
 
struct  IteratorRange< Iterator >::identity< T >
 
class  NumberIterator< Integral >
 
struct  IotaRange< Integral >
 

Functions

template<typename Iterator >
IteratorRange< Iterator > make_iterator_range (const Iterator &i1, const Iterator &i2)
 
template<typename Container >
IteratorRange< typename Container::iterator > make_iterator_range (Container &container)
 
template<typename Container >
IteratorRange< typename Container::const_iterator > make_iterator_range (const Container &container)
 
template<typename Container , typename Iterator , typename Function >
Container transform_range (Iterator first, Iterator last, Function &&fn)
 
template<typename OutContainer , typename InContainer , typename Function >
OutContainer transform_container (InContainer &inContainer, Function &&fn)
 
template<typename Range , typename Function >
void for_each_in_range (Range &&range, Function &&fn)
 

Function Documentation

◆ for_each_in_range()

template<typename Range , typename Function >
void for_each_in_range ( Range &&  range,
Function &&  fn 
)

Definition at line 246 of file IteratorX.h.

247{
248 std::for_each(range.begin(), range.end(), std::forward<Function>(fn));
249}
static const auto fn

References fn.

Referenced by MIR::anonymous_namespace{GetMeterUsingTatumQuantizationFit.cpp}::GetMostLikelyMeterFromQuantizationExperiment(), MIR::anonymous_namespace{GetMeterUsingTatumQuantizationFit.cpp}::GetOnsetLag(), and MIR::anonymous_namespace{GetMeterUsingTatumQuantizationFit.cpp}::GetPossibleDivHierarchies().

Here is the caller graph for this function:

◆ make_iterator_range() [1/3]

template<typename Container >
IteratorRange< typename Container::const_iterator > make_iterator_range ( const Container &  container)

Definition at line 224 of file IteratorX.h.

225{
226 return { container.begin(), container.end() };
227}

◆ make_iterator_range() [2/3]

template<typename Iterator >
IteratorRange< Iterator > make_iterator_range ( const Iterator &  i1,
const Iterator &  i2 
)

Definition at line 210 of file IteratorX.h.

211{
212 return { i1, i2 };
213}

Referenced by ShuttleGuiBase::AddChoice(), AudioIO::AllocateBuffers(), ChoiceEditor::BeginEdit(), PluginManager::CheckPluginUpdates(), ExportFFmpegOptions::FetchCompatibleCodecList(), AudioSetupToolBar::FillHosts(), DeviceToolBar::FillHosts(), AudioSetupToolBar::Choices::Find(), ExportFFmpegOptions::FindSelectedCodec(), ExportFFmpegOptions::FindSelectedFormat(), AudioIO::GetBestRate(), CommandManager::GetCategories(), DevicePrefs::GetNamesAndLabels(), MidiIOPrefs::GetNamesAndLabels(), AudioIOBase::GetOptimalSupportedSampleRate(), PluginManager::GetPlugin(), AudioIOBase::GetSupportedCaptureRates(), AudioIOBase::GetSupportedPlaybackRates(), AudioIOBase::GetSupportedSampleRates(), MP3ExportProcessor::Initialize(), MacroCommands::IsFixed(), LangChoiceDialog::LangChoiceDialog(), Effect::LoadSettingsFromString(), MacroCommands::MacroCommands(), LabelDialog::OnChangeTrack(), LabelDialog::OnInsert(), LangChoiceDialog::OnOk(), EffectUIHost::OnSaveAs(), KeyConfigPrefs::OnSet(), LabelTrackMenuTable::OnSetFont(), NyquistEffect::Parse(), ModuleManager::Providers(), ChoiceEditor::Reset(), AudioSetupToolBar::Choices::Set(), KeyConfigPrefs::SetKeyForSelected(), ShuttleGuiBase::TieChoice(), ShuttleGuiBase::TieNumberAsChoice(), NyquistEffect::Tokenizer::Tokenize(), ShuttleGuiBase::TranslateToIndex(), and OptionValidator::Validate().

Here is the caller graph for this function:

◆ make_iterator_range() [3/3]

template<typename Container >
IteratorRange< typename Container::iterator > make_iterator_range ( Container &  container)

Definition at line 217 of file IteratorX.h.

218{
219 return { container.begin(), container.end() };
220}

◆ transform_container()

template<typename OutContainer , typename InContainer , typename Function >
OutContainer transform_container ( InContainer &  inContainer,
Function &&  fn 
)

Definition at line 239 of file IteratorX.h.

240{
241 return transform_range<OutContainer>(
242 inContainer.begin(), inContainer.end(), fn );
243}

References fn.

◆ transform_range()

template<typename Container , typename Iterator , typename Function >
Container transform_range ( Iterator  first,
Iterator  last,
Function &&  fn 
)

Definition at line 231 of file IteratorX.h.

232{
233 Container result;
234 std::transform( first, last, std::back_inserter( result ), fn );
235 return result;
236}

References fn.