Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::MemoryBuffer Class Reference

Management of a memory buffer. More...

#include <arcane/utils/internal/MemoryBuffer.h>

Collaboration diagram for Arcane::MemoryBuffer:

Public Member Functions

void resize (Int64 new_size)
 Resizes the memory area.
Span< const std::byte > bytes () const
Span< std::byte > bytes ()
IMemoryAllocatorallocator () const

Static Public Member Functions

static Ref< MemoryBuffer > create (IMemoryAllocator *allocator)
 Creates an instance of MemoryBuffer.

Private Member Functions

 MemoryBuffer (IMemoryAllocator *allocator)

Private Attributes

UniqueArray< std::byte > m_buffer
 Buffer containing the data.

Detailed Description

Management of a memory buffer.

Definition at line 34 of file MemoryBuffer.h.

Constructor & Destructor Documentation

◆ MemoryBuffer()

Arcane::MemoryBuffer::MemoryBuffer ( IMemoryAllocator * allocator)
inlineexplicitprivate

Definition at line 38 of file MemoryBuffer.h.

Member Function Documentation

◆ allocator()

IMemoryAllocator * Arcane::MemoryBuffer::allocator ( ) const
inline

Definition at line 68 of file MemoryBuffer.h.

◆ bytes() [1/2]

Span< std::byte > Arcane::MemoryBuffer::bytes ( )
inline

Definition at line 67 of file MemoryBuffer.h.

◆ bytes() [2/2]

Span< const std::byte > Arcane::MemoryBuffer::bytes ( ) const
inline

Definition at line 66 of file MemoryBuffer.h.

◆ create()

Ref< MemoryBuffer > Arcane::MemoryBuffer::create ( IMemoryAllocator * allocator)
inlinestatic

Creates an instance of MemoryBuffer.

The allocator must remain valid throughout the lifetime of the created instance.

Definition at line 50 of file MemoryBuffer.h.

References Arcane::makeRef().

Here is the call graph for this function:

◆ resize()

void Arcane::MemoryBuffer::resize ( Int64 new_size)
inline

Resizes the memory area.

No initialization is performed. If the size decreases resize() has no effect.

Definition at line 65 of file MemoryBuffer.h.

References m_buffer.

Member Data Documentation

◆ m_buffer

UniqueArray<std::byte> Arcane::MemoryBuffer::m_buffer
private

Buffer containing the data.

Definition at line 73 of file MemoryBuffer.h.

Referenced by resize().


The documentation for this class was generated from the following file: