Audacity 3.2.0
Classes | Namespaces | Functions | Variables
PackedArray.h File Reference

Smart pointer for a header contiguous with an array holding a dynamically determined number of elements. More...

#include <type_traits>
Include dependency graph for PackedArray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PackedArray::detail::ExtendedTraits< T, typename >
 Primary template of metafunction deducing other things from Traits<T> More...
 
struct  PackedArray::detail::ExtendedTraits< T, std::void_t< decltype(std::declval< T >().*(Traits< T >::array_member))> >
 Partial specialization used when Traits<T>::array_member is defined. More...
 
struct  PackedArray::Traits< T >
 Primary template used in Deleter that can be specialized. More...
 
struct  PackedArray::Traits< T >::header_type
 
struct  PackedArray::Deleter< Type, BaseDeleter >
 Deleter for an array of elements and optional contiguous header structure. More...
 
struct  PackedArray::Ptr< Type, BaseDeleter >
 Smart pointer type that deallocates with Deleter. More...
 
struct  PackedArray_t
 

Namespaces

namespace  PackedArray
 
namespace  PackedArray::detail
 

Functions

template<typename Type , template< typename > typename BaseDeleter>
size_t PackedArray::Count (const Ptr< Type, BaseDeleter > &p)
 Find out how many elements were allocated with a Ptr. More...
 
template<typename Type , template< typename > typename BaseDeleter>
auto PackedArray::begin (const Ptr< Type, BaseDeleter > &p)
 Enables range-for. More...
 
template<typename Type , template< typename > typename BaseDeleter>
auto PackedArray::end (const Ptr< Type, BaseDeleter > &p)
 Enables range-for. More...
 
void * operator new (size_t size, PackedArray_t, size_t enlarged)
 
void operator delete (void *p, PackedArray_t, size_t)
 Complementary operator delete in case of exceptions in a new-expression. More...
 
template<typename Type >
auto PackedArray::AllocateBytes (size_t enlarged)
 Allocate a Ptr<Type> holding at least enlarged bytes. More...
 
template<typename Type >
auto PackedArray::AllocateCount (size_t count)
 Allocate a Ptr<Type> holding count elements. More...
 

Variables

static constexpr PackedArray_t PackedArrayArg
 Tag argument to distinguish an overload of operator new. More...
 

Detailed Description

Smart pointer for a header contiguous with an array holding a dynamically determined number of elements.


Audacity: A Digital Audio Editor

Paul Licameli

Definition in file PackedArray.h.

Function Documentation

◆ operator delete()

void operator delete ( void *  p,
PackedArray_t  ,
size_t   
)
inline

Complementary operator delete in case of exceptions in a new-expression.

Definition at line 180 of file PackedArray.h.

180 {
181 ::operator delete(p);
182}

◆ operator new()

void * operator new ( size_t  size,
PackedArray_t  ,
size_t  enlarged 
)
inline

Allocator for objects managed by PackedArray::Ptr enlarges the size request that the compiler makes

Definition at line 175 of file PackedArray.h.

175 {
176 return ::operator new(std::max(size, enlarged));
177}

References size.

Variable Documentation

◆ PackedArrayArg

constexpr PackedArray_t PackedArrayArg
inlinestaticconstexpr

Tag argument to distinguish an overload of operator new.

Definition at line 171 of file PackedArray.h.

Referenced by PackedArray::AllocateBytes().