BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma::MemoryBlockDescriptor Class Reference

#include <bdlma_memoryblockdescriptor.h>

Public Types

typedef bsls::Types::size_type size_type
 

Public Member Functions

 MemoryBlockDescriptor ()
 Create a memory block descriptor having an address and size of 0.
 
 MemoryBlockDescriptor (void *address, size_type size)
 
 MemoryBlockDescriptor (const MemoryBlockDescriptor &original)
 
 ~MemoryBlockDescriptor ()=default
 
MemoryBlockDescriptoroperator= (const MemoryBlockDescriptor &rhs)
 
void setAddressAndSize (void *address, size_type size)
 
bool isNull () const
 
void * address () const
 
size_type size () const
 Return the size of the memory block described by this object.
 
void print () const
 

Detailed Description

This is an in-core value-semantic class describing the size and address of a block of memory. A null block descriptor is defined as a descriptor having an address and size of 0. The behavior is undefined for a descriptor whose address is 0, but whose size if not also 0.

See bdlma_memoryblockdescriptor

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ MemoryBlockDescriptor() [1/3]

bdlma::MemoryBlockDescriptor::MemoryBlockDescriptor ( )
inline

◆ MemoryBlockDescriptor() [2/3]

bdlma::MemoryBlockDescriptor::MemoryBlockDescriptor ( void *  address,
size_type  size 
)
inline

Create a memory block descriptor having the specified address and size. The behavior is undefined if address is 0 but size is not also 0.

◆ MemoryBlockDescriptor() [3/3]

bdlma::MemoryBlockDescriptor::MemoryBlockDescriptor ( const MemoryBlockDescriptor original)
inline

Create a memory block descriptor having the same value as the specified original descriptor. Two descriptors have the same value if and only if they have the same address and size.

◆ ~MemoryBlockDescriptor()

bdlma::MemoryBlockDescriptor::~MemoryBlockDescriptor ( )
default

Member Function Documentation

◆ address()

void * bdlma::MemoryBlockDescriptor::address ( ) const
inline

Return the address of the modifiable memory block described by this object, or 0 if this is a null descriptor.

◆ isNull()

bool bdlma::MemoryBlockDescriptor::isNull ( ) const
inline

Return true if this memory block descriptor describes a null memory block and false otherwise. A null memory block has an address and size of 0.

◆ operator=()

MemoryBlockDescriptor & bdlma::MemoryBlockDescriptor::operator= ( const MemoryBlockDescriptor rhs)
inline

Assign to this memory block descriptor the value of the specified rhs descriptor and return a reference to this modifiable descriptor.

◆ print()

void bdlma::MemoryBlockDescriptor::print ( ) const

Format the attributes of this memory block descriptor to stdout in some reasonable (single-line) format.

◆ setAddressAndSize()

void bdlma::MemoryBlockDescriptor::setAddressAndSize ( void *  address,
size_type  size 
)
inline

Set the address and size of the memory block described by this object to the specified address and size. The behavior is undefined if ‘address’ is 0 but size is not also 0.

◆ size()

MemoryBlockDescriptor::size_type bdlma::MemoryBlockDescriptor::size ( ) const
inline

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