![]() |
Audacity 3.2.0
|
#include <iterator>
#include <memory>
#include <new>
#include <cstdlib>
#include <functional>
#include <limits>
#include <algorithm>
Go to the source code of this file.
Classes | |
class | ArrayOf< X > |
This simplifies arrays of arrays, each array separately allocated with NEW[] But it might be better to use std::Array<ArrayOf<X>, N> for some small constant N Or use just one array when sub-arrays have a common size and are not large. More... | |
class | ArraysOf< X > |
struct | freer |
struct | Destroyer< T > |
A deleter class to supply the second template parameter of unique_ptr for classes like wxWindow that should be sent a message called Destroy rather than be deleted directly. More... | |
struct | Finally< F > |
"finally" as in The C++ Programming Language, 4th ed., p. 358 Useful for defining ad-hoc RAII actions. typical usage: auto cleanup = finally([&]{ ... code; ... }); More... | |
struct | RestoreValue< T > |
Structure used by ValueRestorer. More... | |
class | ValueRestorer< T > |
Set a variable temporarily in a scope. More... | |
struct | CopyableValueRestorer< T > |
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 > |
struct | SharedNonInterfering< T > |
Workaround for std::make_shared not working on macOs with over-alignment. More... | |
struct | NonInterfering< T > |
struct | AtomicUniquePointer< T > |
Macros | |
#define | safenew new |
#define | QUANTIZED_TIME(time, rate) (floor(((double)(time) * (rate)) + 0.5) / (rate)) |
#define | DB_TO_LINEAR(x) (pow(10.0, (x) / 20.0)) |
#define | LINEAR_TO_DB(x) (20.0 * log10(x)) |
#define | MAX_AUDIO (1. - 1./(1<<15)) |
Typedefs | |
template<typename T > | |
using | MallocPtr = std::unique_ptr< T, freer > |
template<typename Character = char> | |
using | MallocString = std::unique_ptr< Character[], freer > |
template<typename T > | |
using | Destroy_ptr = std::unique_ptr< T, Destroyer< T > > |
a convenience for using Destroyer More... | |
Functions | |
template<typename F > | |
Finally< F > | finally (F f) |
Function template with type deduction lets you construct Finally without typing any angle brackets. More... | |
template<typename F > | |
Finally (F) -> Finally< F > | |
template<typename T > | |
ValueRestorer< T > | valueRestorer (T &var) |
inline functions provide convenient parameter type deduction More... | |
template<typename T > | |
ValueRestorer< T > | valueRestorer (T &var, const T &newValue) |
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) |
struct UTILITY_API | alignas (64) NonInterferingBase |
Non-template helper for class template NonInterfering. More... | |
#define QUANTIZED_TIME | ( | time, | |
rate | |||
) | (floor(((double)(time) * (rate)) + 0.5) / (rate)) |
using Destroy_ptr = std::unique_ptr<T, Destroyer<T> > |
using MallocString = std::unique_ptr< Character[], freer > |
struct UTILITY_API alignas | ( | 64 | ) |
Non-template helper for class template NonInterfering.
If a structure contains any members with large alignment, this base class may also allow it to work in macOS builds under current limitations of the C++17 standard implementation.
Definition at line 488 of file MemoryX.h.
Finally< F > finally | ( | F | f | ) |
Function template with type deduction lets you construct Finally without typing any angle brackets.
Definition at line 182 of file MemoryX.h.
C++17 deduction guide allows even simpler syntax: Finally Do{[&]{ Stuff(); }};
Don't omit Do
or some other variable name! Otherwise, the execution of the body is immediate, not delayed to the end of the enclosing scope.
IteratorRange< typename Container::const_iterator > make_iterator_range | ( | const Container & | container | ) |
IteratorRange< Iterator > make_iterator_range | ( | const Iterator & | i1, |
const Iterator & | i2 | ||
) |
Definition at line 448 of file MemoryX.h.
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(), 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().
IteratorRange< typename Container::iterator > make_iterator_range | ( | Container & | container | ) |
OutContainer transform_container | ( | InContainer & | inContainer, |
Function && | fn | ||
) |
Container transform_range | ( | Iterator | first, |
Iterator | last, | ||
Function && | fn | ||
) |
ValueRestorer< T > valueRestorer | ( | T & | var | ) |
inline functions provide convenient parameter type deduction
Definition at line 251 of file MemoryX.h.
Referenced by MacroCommands::ApplyMacro(), AudacityCommand::DoAudacityCommand(), EffectBase::DoEffect(), EffectPreview(), MenuCreator::FilterKeyEvent(), Importer::Import(), EffectNoiseReduction::Dialog::OnPreview(), NyquistEffect::Process(), VSTInstance::RealtimeInitialize(), and AudacityCommand::ShowInterface().
ValueRestorer< T > valueRestorer | ( | T & | var, |
const T & | newValue | ||
) |