C# Class log4net.Util.CyclicBuffer

Show file Open project: nithinphilips/SMOz Class Usage Examples

Public Methods

Method Description
Append ( LoggingEvent loggingEvent ) : LoggingEvent

Appends a loggingEvent to the buffer.

Append an event to the buffer. If the buffer still contains free space then null is returned. If the buffer is full then an event will be dropped to make space for the new event, the event dropped is returned.

Clear ( ) : void

Clear the buffer

Clear the buffer of all events. The events in the buffer are lost.

CyclicBuffer ( int maxSize ) : System

Constructor

Initializes a new instance of the CyclicBuffer class with the specified maximum number of buffered logging events.

PopAll ( ) : LoggingEvent[]

Pops all the logging events from the buffer into an array.

Get all the events in the buffer and clear the buffer.

PopOldest ( ) : LoggingEvent

Get and remove the oldest event in the buffer.

Gets the oldest (first) logging event in the buffer and removes it from the buffer.

Resize ( int newSize ) : void

Resizes the cyclic buffer to newSize.

Resize the cyclic buffer. Events in the buffer are copied into the newly sized buffer. If the buffer is shrunk and there are more events currently in the buffer than the new size of the buffer then the newest events will be dropped from the buffer.

this ( int i ) : LoggingEvent

Gets the ith oldest event currently in the buffer.

If i is outside the range 0 to the number of events currently in the buffer, then null is returned.

Method Details

Append() public method

Appends a loggingEvent to the buffer.

Append an event to the buffer. If the buffer still contains free space then null is returned. If the buffer is full then an event will be dropped to make space for the new event, the event dropped is returned.

public Append ( LoggingEvent loggingEvent ) : LoggingEvent
loggingEvent LoggingEvent The event to append to the buffer.
return LoggingEvent

Clear() public method

Clear the buffer

Clear the buffer of all events. The events in the buffer are lost.

public Clear ( ) : void
return void

CyclicBuffer() public method

Constructor

Initializes a new instance of the CyclicBuffer class with the specified maximum number of buffered logging events.

The argument is not a positive integer.
public CyclicBuffer ( int maxSize ) : System
maxSize int The maximum number of logging events in the buffer.
return System

PopAll() public method

Pops all the logging events from the buffer into an array.

Get all the events in the buffer and clear the buffer.

public PopAll ( ) : LoggingEvent[]
return LoggingEvent[]

PopOldest() public method

Get and remove the oldest event in the buffer.

Gets the oldest (first) logging event in the buffer and removes it from the buffer.

public PopOldest ( ) : LoggingEvent
return LoggingEvent

Resize() public method

Resizes the cyclic buffer to newSize.

Resize the cyclic buffer. Events in the buffer are copied into the newly sized buffer. If the buffer is shrunk and there are more events currently in the buffer than the new size of the buffer then the newest events will be dropped from the buffer.

The argument is not a positive integer.
public Resize ( int newSize ) : void
newSize int The new size of the buffer.
return void

this() public method

Gets the ith oldest event currently in the buffer.

If i is outside the range 0 to the number of events currently in the buffer, then null is returned.

public this ( int i ) : LoggingEvent
i int
return LoggingEvent