C# Class log4net.Util.CyclicBuffer

Afficher le fichier Open project: nithinphilips/SMOz Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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.
Résultat LoggingEvent

Clear() public méthode

Clear the buffer

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

public Clear ( ) : void
Résultat void

CyclicBuffer() public méthode

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.
Résultat System

PopAll() public méthode

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[]
Résultat LoggingEvent[]

PopOldest() public méthode

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
Résultat LoggingEvent

Resize() public méthode

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.
Résultat void

this() public méthode

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
Résultat LoggingEvent