Quick Links: |
#include <ball_recordbuffer.h>
Public Member Functions | |
virtual | ~RecordBuffer () |
virtual void | popBack ()=0 |
virtual void | popFront ()=0 |
virtual int | pushBack (const bsl::shared_ptr< Record > &handle)=0 |
virtual int | pushFront (const bsl::shared_ptr< Record > &handle)=0 |
virtual void | removeAll ()=0 |
virtual void | beginSequence ()=0 |
virtual void | endSequence ()=0 |
virtual const bsl::shared_ptr < Record > & | back () const =0 |
virtual const bsl::shared_ptr < Record > & | front () const =0 |
virtual int | length () const =0 |
Provide a protocol (or pure interface) for managing record handles (specifically instances of bsl::shared_ptr<Record>
).
See Component ball_recordbuffer
virtual ball::RecordBuffer::~RecordBuffer | ( | ) | [virtual] |
Remove all record handles stored in this record buffer and destroy this record buffer.
virtual void ball::RecordBuffer::popBack | ( | ) | [pure virtual] |
Remove from this record buffer the record handle positioned at the back of the buffer. The behavior is undefined unless 0 < length()
.
Implemented in ball::FixedSizeRecordBuffer.
virtual void ball::RecordBuffer::popFront | ( | ) | [pure virtual] |
Remove from this record buffer the record handle positioned at the front of the buffer. The behavior is undefined unless 0 < length()
.
Implemented in ball::FixedSizeRecordBuffer.
virtual int ball::RecordBuffer::pushBack | ( | const bsl::shared_ptr< Record > & | handle | ) | [pure virtual] |
Append the specified handle
to the back of this record buffer. Return 0 on success, and a non-zero value otherwise. Note that concrete implementations are permitted to remove records from the buffer in order to attempt to accommodate a pushBack
request (which implies that, after a successful call to pushBack
, length
is not guaranteed to be more than one, and an unsuccessful call to pushBack
is permitted to leave the buffer empty).
Implemented in ball::FixedSizeRecordBuffer.
virtual int ball::RecordBuffer::pushFront | ( | const bsl::shared_ptr< Record > & | handle | ) | [pure virtual] |
Insert the specified handle
at the front of this record buffer. Return 0 on success, and a non-zero value otherwise. Note that concrete implementations are permitted to remove records from the buffer in order to attempt to accommodate a pushFront
request (which implies that, after a successful call to pushFront
, length
is not guaranteed to be more than one, and an unsuccessful call to pushFront
is permitted to leave the buffer empty).
Implemented in ball::FixedSizeRecordBuffer.
virtual void ball::RecordBuffer::removeAll | ( | ) | [pure virtual] |
Remove all record handles stored in this record buffer. Note that length()
is now 0.
Implemented in ball::FixedSizeRecordBuffer.
virtual void ball::RecordBuffer::beginSequence | ( | ) | [pure virtual] |
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 endSequence
is called.
Implemented in ball::FixedSizeRecordBuffer.
virtual void ball::RecordBuffer::endSequence | ( | ) | [pure virtual] |
Unlock this record buffer, thus allowing other threads to access it. The behavior is undefined unless the buffer is already locked by beginSequence
method.
Implemented in ball::FixedSizeRecordBuffer.
virtual const bsl::shared_ptr<Record>& ball::RecordBuffer::back | ( | ) | const [pure virtual] |
Return a reference of the shared pointer referring to the record positioned at the back of this record buffer. The behavior is undefined unless this record buffer has been locked by the beginSequence
method and 0 < length()
.
Implemented in ball::FixedSizeRecordBuffer.
virtual const bsl::shared_ptr<Record>& ball::RecordBuffer::front | ( | ) | const [pure virtual] |
Return a reference of the shared pointer referring to the record positioned at the front of this record buffer. The behavior is undefined unless this record buffer has been locked by the beginSequence
method and 0 < length()
.
Implemented in ball::FixedSizeRecordBuffer.
virtual int ball::RecordBuffer::length | ( | ) | const [pure virtual] |
Return the number of record handles in this record buffer.
Implemented in ball::FixedSizeRecordBuffer.