This class provides a concrete, thread‐safe implementation of the RecordBuffer protocol. This class is a mechanism. At any time, the sum of sizes of all records contained in a FixedSizeRecordBuffer object plus the amount of memory allocated by the FixedSizeRecordBuffer object itself is guaranteed to be less than or equal to an upper bound specified at creation. The class is thread‐safe, except that the methods front and back must be called after locking the buffer by invoking beginSequence. In order to accommodate a pushBack request, the records from the front end of the buffer may be removed. Similarly, in order to accommodate a pushFront request, the records from the back end of the buffer may be removed. If a record can not accommodate in the buffer, it is silently (but otherwise safely) discarded.
Synopsis
Declared in <ball_fixedsizerecordbuffer.h>
class FixedSizeRecordBuffer
: public RecordBuffer
Base Classes
Name |
Description |
Provide a protocol (or pure interface) for managing record handles (specifically instances of |
Member Functions
Name |
Description |
|
Create a limited record buffer such that at any time the sum of sizes of all records contained plus the amount of memory allocated by this object is guaranteed to be less than or equal to the specified |
|
Remove all record handles from this record buffer and destroy this record buffer. |
|
Return a reference of the shared pointer referring to the record positioned at the back end of this record buffer. The behavior is undefined unless this record buffer has been locked by the |
|
Lock this record buffer so that a sequence of method invocations on this record buffer can occur uninterrupted by other threads. The buffer will remain locked until |
|
Unlock this record buffer, thus allowing other threads to access it. The behavior is undefined unless the buffer is already locked by |
|
Return a reference of the shared pointer referring to the record positioned at the front end of this record buffer. The behavior is undefined unless this record buffer has been locked by the |
|
Return the number of record handles in this record buffer. |
|
Remove from this record buffer the record handle positioned at the back end of the buffer. The behavior is undefined unless |
|
Remove from this record buffer the record handle positioned at the front end of the buffer. The behavior is undefined unless |
|
Push the specified |
|
Push the specified |
|
Remove all record handles stored in this record buffer. Note that |
|
Declare that this type uses a |
Created with MrDocs