[#BloombergLP-ball-FixedSizeRecordBuffer] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::FixedSizeRecordBuffer :relfileprefix: ../../ :mrdocs: Concrete, thread‐safe fixed‐size buffer of record handles. == Synopsis Declared in `<ball_fixedsizerecordbuffer.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class FixedSizeRecordBuffer : public xref:BloombergLP/ball/RecordBuffer.adoc[RecordBuffer] ---- == Description 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. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/ball/RecordBuffer.adoc[RecordBuffer]` | Provide a protocol (or pure interface) for managing record handles (specifically instances of `bsl::shared_ptr<Record>`). |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/FixedSizeRecordBuffer/2constructor.adoc[`FixedSizeRecordBuffer`] [.small]#[constructor]# | Create a limited record buffer with the specified `maxTotalSize`. | xref:BloombergLP/ball/FixedSizeRecordBuffer/2destructor.adoc[`~FixedSizeRecordBuffer`] [.small]#[destructor]# [.small]#[virtual]# | Remove all record handles from this record buffer and destroy this record buffer. | xref:BloombergLP/ball/FixedSizeRecordBuffer/back.adoc[`back`] [.small]#[virtual]# | Return a reference to the shared pointer at the back of this buffer. | xref:BloombergLP/ball/FixedSizeRecordBuffer/beginSequence.adoc[`beginSequence`] [.small]#[virtual]# | _Lock_ this record buffer for an uninterrupted sequence of calls. | xref:BloombergLP/ball/FixedSizeRecordBuffer/endSequence.adoc[`endSequence`] [.small]#[virtual]# | _Unlock_ this record buffer, thus allowing other threads to access it. The behavior is undefined unless the buffer is already _locked_ by `beginSequence`. | xref:BloombergLP/ball/FixedSizeRecordBuffer/front.adoc[`front`] [.small]#[virtual]# | Return a reference to the shared pointer at the front of this buffer. | xref:BloombergLP/ball/FixedSizeRecordBuffer/length.adoc[`length`] [.small]#[virtual]# | Return the number of record handles in this record buffer. | xref:BloombergLP/ball/FixedSizeRecordBuffer/popBack.adoc[`popBack`] [.small]#[virtual]# | Remove from this record buffer the record handle positioned at the back end of the buffer. The behavior is undefined unless `0 < length()`. | xref:BloombergLP/ball/FixedSizeRecordBuffer/popFront.adoc[`popFront`] [.small]#[virtual]# | Remove from this record buffer the record handle positioned at the front end of the buffer. The behavior is undefined unless `0 < length()`. | xref:BloombergLP/ball/FixedSizeRecordBuffer/pushBack.adoc[`pushBack`] [.small]#[virtual]# | Push the specified `handle` at the back end of this record buffer. | xref:BloombergLP/ball/FixedSizeRecordBuffer/pushFront.adoc[`pushFront`] [.small]#[virtual]# | Push the specified `handle` at the front end of this record buffer. | xref:BloombergLP/ball/FixedSizeRecordBuffer/removeAll.adoc[`removeAll`] [.small]#[virtual]# | Remove all record handles stored in this record buffer. Note that `length()` is now 0. | xref:BloombergLP/ball/FixedSizeRecordBuffer/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<FixedSizeRecordBuffer, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#