FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
FixedBufferManager Class Reference

Impose a fixed-size buffer on a BufferRegion. More...

#include <circular_bfr.hpp>

+ Inheritance diagram for FixedBufferManager:

Public Member Functions

 FixedBufferManager (unsigned char *ptr, size_t len, size_t blk_size, const char *component="", const char *magicNumber=DEFAULT_FIXED_BFR_MAGIC_NUMBER)
 
 FixedBufferManager (unsigned char *ptr, size_t len)
 
 ~FixedBufferManager ()
 
virtual SharedBufferAllocRecordallocateBlock (size_t len) VIRTUAL_OVERRIDE
 
virtual void returnBlock (SharedBufferAllocRecord *record) VIRTUAL_OVERRIDE
 
virtual BufferRegion_Overhead_t getBlockOverhead () const VIRTUAL_OVERRIDE
 Interface to return the per-block overhead associated with an allocator. More...
 
- Public Member Functions inherited from BufferRegion
 BufferRegion (unsigned char *ptr, size_t len, size_t blk_size, OwnershipState ownedBy=NOT_OWNER)
 
virtual ~BufferRegion ()
 Destructor for a BufferRegion. More...
 
void replaceRegion (unsigned char *ptr, size_t len, size_t blk_size, OwnershipState ownedBy=NOT_OWNER)
 Reconstruct the buffer using a new region. More...
 
void setOwnership (OwnershipState newOwnership)
 Change administrative ownership of region. More...
 
OwnershipState getOwnership () const
 Return the administrative ownership state of the region. More...
 
size_t getRegionLength () const OME_ALWAYS_INLINE
 Return the number of bytes in the region. More...
 
size_t getBlockSize () const OME_ALWAYS_INLINE
 Return the block size set for the region. More...
 
unsigned char * getBufferBase () const OME_ALWAYS_INLINE
 Return the address of the buffer region. More...
 
virtual SharedBufferAllocRecordgetActiveListHead ()
 Return first active allocation record. More...
 
virtual SharedBufferAllocRecordgetFreeListHead ()
 Return first free allocation record. More...
 
virtual SharedBufferAllocRecordtraverseNextBlock (SharedBufferAllocRecord *record)
 Traverse to next allocation record on current chain. More...
 
virtual unsigned char * blockAddress (const SharedBufferAllocRecord *record)
 
int checkLists (int displayFlag)
 Debug routine used to verify integrity of block lists. More...
 

Static Public Attributes

static int32_t TOTAL_allocation_wait_spins
 

Additional Inherited Members

- Public Types inherited from BufferRegion
enum  OwnershipState { NOT_OWNER = 0, OWN_BLOCK = 1, OWN_MAP = 2, OWN_RECORD = 3 }
 
typedef uint_fast8_t BufferRegion_Overhead_t
 
- Protected Attributes inherited from BufferRegion
unsigned char * region
 
size_t regionLength
 
size_t blockSize
 
size_t availableBlocks
 
OwnershipState ownership
 

Detailed Description

Impose a fixed-size buffer on a BufferRegion.

Constructor & Destructor Documentation

◆ FixedBufferManager() [1/2]

◆ FixedBufferManager() [2/2]

◆ ~FixedBufferManager()

FixedBufferManager::~FixedBufferManager ( )

Member Function Documentation

◆ allocateBlock()

◆ getBlockOverhead()

virtual BufferRegion_Overhead_t FixedBufferManager::getBlockOverhead ( ) const
inlinevirtual

Interface to return the per-block overhead associated with an allocator.

Implements BufferRegion.

◆ returnBlock()

void FixedBufferManager::returnBlock ( SharedBufferAllocRecord record)
virtual

Interface to return a block of storage previously obtained by an allocateBlock() call.

Parameters
recordpoints to the SharedBufferAllocRecord representing the block to be returned.

NOTE: not all subclasses can do something useful with a returned block.

Implements BufferRegion.

References BufferRegion::blockAddress(), and BufferRegion::region.

Member Data Documentation

◆ TOTAL_allocation_wait_spins

int32_t FixedBufferManager::TOTAL_allocation_wait_spins
static

Referenced by allocateBlock().


The documentation for this class was generated from the following files:
Generated: Tue Jul 28 2020 16:03:27
Support Information