The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CSequencedBufferCollection Class Reference
[I/O BuffersAsynchronous I/O]

Collaboration diagram for CSequencedBufferCollection:

List of all members.

Detailed Description

A class that manages a collection of IBuffer instances which have a unique and ascending sequence number in them. You are allowed to push buffers into the collection in any order and to retrieve them only in the correct sequence. If you try and retrieve a buffer when the required buffer is not present then the collection will return null. Typical usage is to ensure the correct ordering of multiple overlapped read completions. All buffers are pushed into the collection using GetNext() and a buffer is only returned to the caller for processing if it is the next in sequence. This class takes a reference on a buffer when it is added to the collection and requires that the user of a buffer that has been removed from the collection releases that reference when done.

Public Member Functions

 CSequencedBufferCollection (bool allowPutBack=false, IBuffer::SequenceNumber sequenceNumber=0)
 Create a buffer collection that uses the specified sequenceNumber as the next expected sequence number.
 CSequencedBufferCollection (const CSequencedBufferCollection &rhs)
 ~CSequencedBufferCollection ()
CSequencedBufferCollectionoperator= (const CSequencedBufferCollection &rhs)
bool IsEmpty () const
size_t Size () const
bool CanGetNext () const
bool IsNext (const CSmartBuffer &buffer)
IBuffer::SequenceNumber GetNextSequenceNumber () const
size_t Purge ()
void Add (CSmartBuffer &buffer)
CSmartBuffer GetNext (CSmartBuffer &buffer)
CSmartBuffer GetNext ()

Constructor & Destructor Documentation

CSequencedBufferCollection ( bool  allowPutBack = false,
IBuffer::SequenceNumber  sequenceNumber = 0 
) [explicit]

Create a buffer collection that uses the specified sequenceNumber as the next expected sequence number.

Member Function Documentation

CSequencedBufferCollection& operator= ( const CSequencedBufferCollection rhs  ) 

bool IsEmpty (  )  const

size_t Size (  )  const

bool CanGetNext (  )  const

bool IsNext ( const CSmartBuffer buffer  ) 

IBuffer::SequenceNumber GetNextSequenceNumber (  )  const

size_t Purge (  ) 

void Add ( CSmartBuffer buffer  ) 

CSmartBuffer GetNext ( CSmartBuffer buffer  ) 

CSmartBuffer GetNext (  ) 

Generated on Sun Sep 12 19:09:38 2021 for The Server Framework - v7.4 by doxygen 1.5.3