Audacity  2.2.2
Classes | Macros | Typedefs | Functions
MemoryX.h File Reference
#include <memory>
#include <cstdlib>
#include <functional>
#include <wx/utils.h>
#include <algorithm>

Go to the source code of this file.

Classes

struct  std::__make_unique_result< X >
 
struct  std::__make_unique_result< X[]>
 
class  ArrayOf< X >
 Memory.h template class for making an array of float, bool, etc. More...
 
class  ArraysOf< X >
 memory.h template class for making an array of arrays. More...
 
class  Maybe< X >
 
class  movable_ptr_with_deleter< T, Deleter >
 
struct  freer
 
struct  Destroyer< T >
 
struct  Final_action< F >
 
struct  RestoreValue< T >
 
class  ValueRestorer< T >
 
struct  IteratorRange< Iterator >
 
struct  IteratorRange< Iterator >::identity< T >
 
class  transform_iterator< Result, Iterator >
 
struct  value_transformer< Function, Iterator >
 
struct  std::hash< T >
 
struct  std::hash< wxString >
 

Macros

#define safenew   new
 

Typedefs

template<typename T >
using movable_ptr = std::unique_ptr< T >
 
template<typename T , typename Deleter >
using movable_ptr_with_deleter_base = std::unique_ptr< T, Deleter >
 
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 >>
 
template<typename Function , typename Iterator >
using value_transform_iterator = transform_iterator< decltype(std::declval< Function >()(*std::declval< Iterator >())), Iterator >
 

Functions

template<typename X , typename... Args>
__make_unique_result< X >
::scalar_case 
std::make_unique (Args &&...args)
 
template<typename X >
__make_unique_result< X >
::array_case 
std::make_unique (size_t count)
 
template<typename T , typename... Args>
movable_ptr< T > make_movable (Args &&...args)
 
template<typename T , typename Deleter , typename... Args>
movable_ptr_with_deleter< T,
Deleter > 
make_movable_with_deleter (const Deleter &d, Args &&...args)
 
template<typename F >
Final_action< F > finally (F f)
 
template<typename T >
ValueRestorer< T > valueRestorer (T &var)
 
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 Iterator , typename Function >
transform_iterator< decltype(std::declval
< Function >)(std::declval
< Iterator >))), Iterator > 
make_transform_iterator (const Iterator &iterator, Function function)
 
template<typename Function , typename Iterator >
value_transform_iterator
< Function, Iterator > 
make_value_transform_iterator (const Iterator &iterator, Function function)
 

Macro Definition Documentation

#define safenew   new

Typedef Documentation

template<typename T >
using Destroy_ptr = std::unique_ptr<T, Destroyer<T>>

Definition at line 433 of file MemoryX.h.

template<typename T >
using MallocPtr = std::unique_ptr< T, freer >

Definition at line 411 of file MemoryX.h.

template<typename Character = char>
using MallocString = std::unique_ptr< Character[], freer >

Definition at line 417 of file MemoryX.h.

template<typename T >
using movable_ptr = std::unique_ptr<T>

Definition at line 332 of file MemoryX.h.

template<typename T , typename Deleter >
using movable_ptr_with_deleter_base = std::unique_ptr<T, Deleter>

Definition at line 333 of file MemoryX.h.

template<typename Function , typename Iterator >
using value_transform_iterator = transform_iterator< decltype( std::declval<Function>()( *std::declval<Iterator>() ) ), Iterator >

Definition at line 773 of file MemoryX.h.

Function Documentation

template<typename F >
Final_action<F> finally ( f)

Definition at line 453 of file MemoryX.h.

454 {
455  return Final_action<F>(f);
456 }
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)

Definition at line 684 of file MemoryX.h.

685 {
686  return { container.begin(), container.end() };
687 }
template<typename Container >
IteratorRange< typename Container::const_iterator > make_iterator_range ( const Container &  container)

Definition at line 691 of file MemoryX.h.

692 {
693  return { container.begin(), container.end() };
694 }
template<typename T , typename... Args>
movable_ptr<T> make_movable ( Args &&...  args)
inline

Definition at line 337 of file MemoryX.h.

338 {
339  return std::
340 #ifdef __AUDACITY_OLD_STD__
341  make_shared
342 #else
343  make_unique
344 #endif
345  <T>(std::forward<Args>(args)...);
346 }
template<typename T , typename Deleter , typename... Args>
movable_ptr_with_deleter<T, Deleter> make_movable_with_deleter ( const Deleter &  d,
Args &&...  args 
)
inline

Definition at line 397 of file MemoryX.h.

References safenew.

398 {
399  return movable_ptr_with_deleter<T, Deleter>(safenew T(std::forward<Args>(args)...), d);
400 }
#define safenew
Definition: MemoryX.h:8
template<typename Iterator , typename Function >
transform_iterator< decltype( std::declval<Function>) ( std::declval<Iterator>) ) ), Iterator> make_transform_iterator ( const Iterator &  iterator,
Function  function 
)

Definition at line 751 of file MemoryX.h.

752 {
753  return { iterator, function };
754 }
template<typename Function , typename Iterator >
value_transform_iterator< Function, Iterator > make_value_transform_iterator ( const Iterator &  iterator,
Function  function 
)

Definition at line 780 of file MemoryX.h.

781 {
782  using NewFunction = value_transformer<Function, Iterator>;
783  return { iterator, NewFunction{ function } };
784 }
template<typename T >
ValueRestorer< T > valueRestorer ( T &  var)
template<typename T >
ValueRestorer< T > valueRestorer ( T &  var,
const T &  newValue 
)

Definition at line 498 of file MemoryX.h.

499 { return ValueRestorer< T >{ var, newValue }; }