BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma::BufferImpUtil Struct Reference

#include <bdlma_bufferimputil.h>

Static Public Member Functions

static void * allocateFromBuffer (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type bufferSize, bsls::Types::size_type size, bsls::Alignment::Strategy strategy)
 
static void * allocateMaximallyAlignedFromBuffer (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type bufferSize, bsls::Types::size_type size)
 
static void * allocateNaturallyAlignedFromBuffer (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type bufferSize, bsls::Types::size_type size)
 
static void * allocateOneByteAlignedFromBuffer (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type bufferSize, bsls::Types::size_type size)
 
static void * allocateFromBufferRaw (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type size, bsls::Alignment::Strategy strategy)
 
static void * allocateMaximallyAlignedFromBufferRaw (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type size)
 
static void * allocateNaturallyAlignedFromBufferRaw (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type size)
 
static void * allocateOneByteAlignedFromBufferRaw (bsls::Types::IntPtr *cursor, char *buffer, bsls::Types::size_type size)
 

Detailed Description

This struct provides a namespace for a suite of pure procedures for allocating memory from a buffer.

Member Function Documentation

◆ allocateFromBuffer()

static void * bdlma::BufferImpUtil::allocateFromBuffer ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  bufferSize,
bsls::Types::size_type  size,
bsls::Alignment::Strategy  strategy 
)
static

Allocate a memory block of the specified size (in bytes) from the specified buffer having the specified bufferSize (in bytes) at the specified cursor position, using the specified alignment strategy. Return the address of the allocated memory block if buffer contains sufficient available memory, and 0 otherwise. The cursor is set to the first byte position immediately after the allocated memory if there is sufficient memory, and not modified otherwise. The behavior is undefined unless 0 < size, 0 <= *cursor, and *cursor <= bufferSize.

◆ allocateFromBufferRaw()

static void * bdlma::BufferImpUtil::allocateFromBufferRaw ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  size,
bsls::Alignment::Strategy  strategy 
)
static

Allocate a memory block of the specified size (in bytes) from the specified buffer at the specified cursor position, using the specified alignment strategy. Return the address of the allocated memory block. The cursor is set to the first byte position immediately after the allocated memory. The behavior is undefined unless 0 < size, buffer contains sufficient available memory, and cursor refers to a valid position in buffer.

◆ allocateMaximallyAlignedFromBuffer()

static void * bdlma::BufferImpUtil::allocateMaximallyAlignedFromBuffer ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  bufferSize,
bsls::Types::size_type  size 
)
static

Allocate a maximally-aligned memory block of the specified size (in bytes) from the specified buffer having the specified bufferSize (in bytes) at the specified cursor position. Return the address of the allocated memory block if buffer contains sufficient available memory, and 0 otherwise. The cursor is set to the first byte position immediately after the allocated memory if there is sufficient memory, and not modified otherwise. The behavior is undefined unless 0 < size, 0 <= *cursor, and *cursor <= bufferSize.

◆ allocateMaximallyAlignedFromBufferRaw()

static void * bdlma::BufferImpUtil::allocateMaximallyAlignedFromBufferRaw ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  size 
)
static

Allocate a maximally-aligned memory block of the specified size (in bytes) from the specified buffer at the specified cursor position. Return the address of the allocated memory block. The cursor is set to the first byte position immediately after the allocated memory. The behavior is undefined unless 0 < size, buffer contains sufficient available memory, and cursor refers to a valid position in buffer.

◆ allocateNaturallyAlignedFromBuffer()

static void * bdlma::BufferImpUtil::allocateNaturallyAlignedFromBuffer ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  bufferSize,
bsls::Types::size_type  size 
)
static

Allocate a naturally-aligned memory block of the specified size (in bytes) from the specified buffer having the specified bufferSize (in bytes) at the specified cursor position. Return the address of the allocated memory block if buffer contains sufficient available memory, and 0 otherwise. The cursor is set to the first byte position immediately after the allocated memory if there is sufficient memory, and not modified otherwise. The behavior is undefined unless 0 < size, 0 <= *cursor, and *cursor <= bufferSize.

◆ allocateNaturallyAlignedFromBufferRaw()

static void * bdlma::BufferImpUtil::allocateNaturallyAlignedFromBufferRaw ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  size 
)
static

Allocate a naturally-aligned memory block of the specified size (in bytes) from the specified buffer at the specified cursor position. Return the address of the allocated memory block. The cursor is set to the first byte position immediately after the allocated memory. The behavior is undefined unless 0 < size, buffer contains sufficient available memory, and cursor refers to a valid position in buffer.

◆ allocateOneByteAlignedFromBuffer()

static void * bdlma::BufferImpUtil::allocateOneByteAlignedFromBuffer ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  bufferSize,
bsls::Types::size_type  size 
)
static

Allocate a 1-byte-aligned memory block of the specified size (in bytes) from the specified buffer having the specified bufferSize (in bytes) at the specified cursor position. Return the address of the allocated memory block if buffer contains sufficient available memory, and 0 otherwise. The cursor is set to the first byte position immediately after the allocated memory if there is sufficient memory, and not modified otherwise. The behavior is undefined unless 0 < size, 0 <= *cursor, and *cursor <= bufferSize.

◆ allocateOneByteAlignedFromBufferRaw()

static void * bdlma::BufferImpUtil::allocateOneByteAlignedFromBufferRaw ( bsls::Types::IntPtr cursor,
char *  buffer,
bsls::Types::size_type  size 
)
static

Allocate a 1-byte-aligned memory block of the specified size (in bytes) from the specified buffer at the specified cursor position. Return the address of the allocated memory block. The cursor is set to the first byte position immediately after the allocated memory. The behavior is undefined unless 0 < size, buffer contains sufficient available memory, and cursor refers to a valid position in buffer.


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