Quick Links: |
#include <bdlma_memoryblockdescriptor.h>
Public Types | |
typedef bsls::Types::size_type | size_type |
Public Member Functions | |
MemoryBlockDescriptor () | |
MemoryBlockDescriptor (void *address, size_type size) | |
MemoryBlockDescriptor (const MemoryBlockDescriptor &original) | |
MemoryBlockDescriptor & | operator= (const MemoryBlockDescriptor &rhs) |
void | setAddressAndSize (void *address, size_type size) |
bool | isNull () const |
void * | address () const |
size_type | size () const |
void | print () const |
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 Component bdlma_memoryblockdescriptor
type for block size
bdlma::MemoryBlockDescriptor::MemoryBlockDescriptor | ( | ) |
Create a memory block descriptor having an address and size of 0.
bdlma::MemoryBlockDescriptor::MemoryBlockDescriptor | ( | void * | address, | |
size_type | size | |||
) |
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.
bdlma::MemoryBlockDescriptor::MemoryBlockDescriptor | ( | const MemoryBlockDescriptor & | original | ) |
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::operator= | ( | const MemoryBlockDescriptor & | rhs | ) |
Assign to this memory block descriptor the value of the specified rhs
descriptor and return a reference to this modifiable descriptor.
void bdlma::MemoryBlockDescriptor::setAddressAndSize | ( | void * | address, | |
size_type | size | |||
) |
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.
bool bdlma::MemoryBlockDescriptor::isNull | ( | ) | const |
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.
void* bdlma::MemoryBlockDescriptor::address | ( | ) | const |
Return the address of the modifiable memory block described by this object, or 0 if this is a null descriptor.
size_type bdlma::MemoryBlockDescriptor::size | ( | ) | const |
Return the size of the memory block described by this object.
void bdlma::MemoryBlockDescriptor::print | ( | ) | const |
Format the attributes of this memory block descriptor to stdout
in some reasonable (single-line) format.