FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
FARGOS Buffer Classes

These classes manage a region of memory, represented by a BufferRegion, into a collection of blocks. The CircularBufferManager turns the region into strict a FIFO circular buffer of blocks. The FixedBufferManager allocates blocks without imposing a strict order. More...

Classes

struct  SharedBufferRegionHeader_32
 Region header for a 32-bit shared memory segment. More...
 
struct  SharedBufferRegionHeader_64
 Region header for a 64-bit shared memory segment. More...
 
struct  SharedBufferAllocRecord_32
 Allocation record for chains in a 32-bit shared memory buffer. More...
 
struct  SharedBufferAllocRecord_64
 Allocation record for chains in a 64-bit shared memory buffer. More...
 
class  BufferRegion
 Interface to a buffer region. This is an abstract class. More...
 
class  CircularBufferManager
 Impose a circular buffer on a BufferRegion. More...
 
class  FixedBufferManager
 Impose a fixed-size buffer on a BufferRegion. More...
 

Macros

#define DEFAULT_CIRCULAR_BFR_MAGIC_NUMBER   "CIRCBFR"
 Magic number to identify a shared memory circular buffer. More...
 
#define DEFAULT_FIXED_BFR_MAGIC_NUMBER   "FIXDBFR"
 Magic number to identify a fixed-size memory buffer. More...
 
#define SHARED_BUFFER_OFFSET_SIZE   4
 

Typedefs

typedef uint32_t SharedBuffer_Offset_t
 
typedef SharedBufferRegionHeader_32 SharedBufferRegionHeader
 Default SharedBufferRegionHeader. More...
 
typedef SharedBufferAllocRecord_32 SharedBufferAllocRecord
 Default SharedBufferAllocRecord. More...
 

Functions

bool sharedBufferSegmentIsInNativeByteOrder (const void *segment)
 Indicates if segment uses native byte order. More...
 
bool sharedBufferSegmentSizeIs64bit (const void *segment)
 Indicates if segment uses 64-bit offsets. More...
 
void waitForBufferAllocRecordToBeReady (SharedBufferAllocRecord *rec)
 Verify record is prepared and, if needed, wait until it is prepared. More...
 

Detailed Description

These classes manage a region of memory, represented by a BufferRegion, into a collection of blocks. The CircularBufferManager turns the region into strict a FIFO circular buffer of blocks. The FixedBufferManager allocates blocks without imposing a strict order.

Macro Definition Documentation

◆ DEFAULT_CIRCULAR_BFR_MAGIC_NUMBER

#define DEFAULT_CIRCULAR_BFR_MAGIC_NUMBER   "CIRCBFR"

Magic number to identify a shared memory circular buffer.

◆ DEFAULT_FIXED_BFR_MAGIC_NUMBER

#define DEFAULT_FIXED_BFR_MAGIC_NUMBER   "FIXDBFR"

Magic number to identify a fixed-size memory buffer.

◆ SHARED_BUFFER_OFFSET_SIZE

#define SHARED_BUFFER_OFFSET_SIZE   4

Typedef Documentation

◆ SharedBuffer_Offset_t

typedef uint32_t SharedBuffer_Offset_t

◆ SharedBufferAllocRecord

Default SharedBufferAllocRecord.

◆ SharedBufferRegionHeader

Default SharedBufferRegionHeader.

Function Documentation

◆ sharedBufferSegmentIsInNativeByteOrder()

bool sharedBufferSegmentIsInNativeByteOrder ( const void *  segment)
inline

◆ sharedBufferSegmentSizeIs64bit()

bool sharedBufferSegmentSizeIs64bit ( const void *  segment)
inline

Indicates if segment uses 64-bit offsets.

Referenced by BufferRegion::getActiveListHead(), BufferRegion::getFreeListHead(), and BufferRegion::traverseNextBlock().

◆ waitForBufferAllocRecordToBeReady()

void waitForBufferAllocRecordToBeReady ( SharedBufferAllocRecord rec)

Verify record is prepared and, if needed, wait until it is prepared.

Parameters
recpoints to the SharedBufferAllocRecord to be examined.

Since many usage scenarios involve separate consumer and processing threads, it is possible to a processing thread to become aware of the existence of a buffer record before it is completed prepared. The last step of record preparation is to set the usedLen field to the proper length.

References OME_EXPECT_FALSE, OME_YIELD_THREAD, and SharedBufferAllocRecord_32::usedLen.

Referenced by LogManager::commitLogRecord(), and IO_Processor::doProcessLoop().

Generated: Tue Jul 28 2020 16:03:26
Support Information