Base Framework
|
Reference counted allocator. More...
#include <base/mem/ReferenceCountedAllocator.h>
Inherits ReferenceCountedObject, and Allocator< TYPE >.
Public Member Functions | |
ReferenceCountedAllocator () noexcept | |
ReferenceCountedAllocator (MemorySize size) | |
ReferenceCountedAllocator (MemorySize size, MemorySize capacity) | |
ReferenceCountedAllocator (const ReferenceCountedAllocator ©) | |
![]() | |
ReferenceCountedObject () noexcept | |
ReferenceCountedObject (const ReferenceCountedObject ©) noexcept | |
ReferenceCountedObject (ReferenceCountedObject &&move) noexcept | |
ReferenceCountedObject & | operator= (const ReferenceCountedObject ©) noexcept |
ReferenceCountedObject & | operator= (ReferenceCountedObject &&move) noexcept |
MemorySize | getNumberOfReferences_INTERNAL () const noexcept |
virtual bool | useGarbageCollector () const noexcept |
![]() | |
DynamicObject () noexcept | |
bool | isValidObject () const noexcept |
virtual | ~DynamicObject () noexcept(false) |
_COM_AZURE_DEV__BASE__OVERRIDE_ALLOC () | |
![]() | |
Allocator () noexcept | |
Allocator (MemorySize _size) | |
Allocator (MemorySize _size, MemorySize _capacity) | |
Allocator (const Allocator ©) | |
Allocator (Allocator &&move) noexcept | |
Allocator & | operator= (const Allocator ©) |
Allocator & | operator= (Allocator &&move) noexcept |
TYPE * | getElements () noexcept |
const TYPE * | getElements () const noexcept |
Span< TYPE > | getSpan () noexcept |
ConstSpan< TYPE > | getSpan () const noexcept |
Iterator | getBeginIterator () noexcept |
Iterator | getEndIterator () noexcept |
ReadIterator | getBeginReadIterator () const noexcept |
ReadIterator | getEndReadIterator () const noexcept |
Iterator | begin () noexcept |
Iterator | end () noexcept |
ReadIterator | begin () const noexcept |
ReadIterator | end () const noexcept |
Enumerator | getEnumerator () noexcept |
ReadEnumerator | getReadEnumerator () const noexcept |
MemorySize | getSize () const noexcept |
MemorySize | getByteSize () const noexcept |
bool | isEmpty () const noexcept |
void | ensureCapacity (MemorySize _capacity) noexcept |
void | ensureCapacity () noexcept |
MemorySize | getCapacity () const noexcept |
void | setSizeImpl (MemorySize size, const TYPE *value) |
void | setSize (MemorySize size) |
void | setSize (MemorySize size, const TYPE &value) |
void | clear () |
MemoryDiff | garbageCollect () |
MemorySize | getGarbageByteSize () const noexcept |
Additional Inherited Members | |
![]() | |
typedef SequenceIterator< IteratorTraits< TYPE > > | Iterator |
typedef SequenceIterator< ReadIteratorTraits< TYPE > > | ReadIterator |
typedef AllocatorEnumerator< EnumeratorTraits< TYPE > > | Enumerator |
typedef AllocatorEnumerator< ReadEnumeratorTraits< TYPE > > | ReadEnumerator |
![]() | |
static void | initialize (TYPE *dest, const TYPE *end) |
static void | initialize (TYPE *dest, const TYPE *end, const TYPE &value) |
static void | initializeByCopy (TYPE *restrict dest, const TYPE *restrict src, MemorySize count) |
static void | destroy (TYPE *begin, const TYPE *_end, MemorySize &destroyedCount) |
static void | destroy2 (TYPE *begin, const TYPE *end) |
static void | initializeByMove (TYPE *dest, TYPE *src, const TYPE *end) |
static void | initializeByMove (TYPE *dest, TYPE *src, const TYPE *end, bool &moved) |
static MemorySize | align (MemorySize offset) noexcept |
![]() | |
static constexpr bool | useSafeDestroy = false |
![]() | |
enum | MemoryFill { INIT_MEMORY = 0xaa, DESTROY_OBJECT = 0xbb, RELEASE_MEMORY = 0xdd } |
![]() | |
Span< TYPE > | detach () |
void | attach (TYPE *_buffer, MemorySize _size) |
void | attach (const Span< TYPE > &span) |
MemorySize | getAdjustedSize (MemorySize size) const noexcept |
TYPE * | allocate (const MemorySize size) |
TYPE * | resize (TYPE *buffer, const MemorySize newSize, const MemorySize originalSize) |
bool | canResizeInplace () const noexcept |
TYPE * | tryResize (TYPE *buffer, const MemorySize newSize, const MemorySize originalSize) noexcept |
void | release (TYPE *buffer, const MemorySize size) |
![]() | |
static void | fill (TYPE *dest, MemorySize size, MemoryFill memoryFill) |
Reference counted allocator.
This class is a reference counted, low-level, and resizeable implementation of an array of elements. The implementation is not MT-safe and the class is mainly used by other container classes.
|
inlineexplicitnoexcept |
Initializes an empty allocator.
|
inlineexplicit |
Initializes an allocator of the specified size without initializing the elements. Raises MemoryException if unable to allocate enough memory to hold the requested number of elements.
size | Specifies the initial size of the allocator. |
|
inlineexplicit |
Initializes an allocator of the specified size without initializing the elements. Raises MemoryException if unable to allocate enough memory to hold the requested number of elements.
size | Specifies the initial size of the allocator. |
capacity | Specifies the initial capacity the allocator. |
|
inline |
Initializes the allocator by copying from the specified allocator. Raises MemoryException if unable to allocate the required memory.