BoundedFIFO Class Reference

Inheritance diagram for BoundedFIFO:

Inheritance graph
[legend]
Collaboration diagram for BoundedFIFO:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BoundedFIFO (int maxSize)
spi::LoggingEventPtr get ()
void put (const spi::LoggingEventPtr &o)
int getMaxSize () const
bool isFull () const
int length () const
void resize (int newSize)
bool wasEmpty () const
bool wasFull () const

Detailed Description

BoundedFIFO serves as the bounded first-in-first-out buffer heavily used by the AsyncAppender.


Constructor & Destructor Documentation

BoundedFIFO int  maxSize  ) 
 

Instantiate a new BoundedFIFO with a maximum size passed as argument.


Member Function Documentation

LoggingEventPtr get  ) 
 

Get the first element in the buffer. Returns null if there are no elements in the buffer.

int getMaxSize  )  const [inline]
 

Get the maximum size of the buffer.

bool isFull  )  const [inline]
 

Return true if the buffer is full, i.e. of the number of elements in the buffer equals the buffer size.

int length  )  const [inline]
 

Get the number of elements in the buffer. This number is guaranteed to be in the range 0 to maxSize (inclusive).

void put const spi::LoggingEventPtr o  ) 
 

Place a LoggingEvent in the buffer. If the buffer is full then the event is silently dropped. It is the caller's responsability to make sure that the buffer has free space.

void resize int  newSize  ) 
 

Resize the buffer to a new size. If the new size is smaller than the old size events might be lost.

bool wasEmpty  )  const [inline]
 

Returns true if there is just one element in the buffer. In other words, if there were no elements before the last put operation completed.

bool wasFull  )  const [inline]
 

Returns true if the number of elements in the buffer plus 1 equals the maximum buffer size, returns false otherwise.


The documentation for this class was generated from the following files:
  • boundedfifo.h
  • boundedfifo.cpp

Copyright © 1999-2004, Apache Software Foundation