C# Class GSF.IO.FileStructure.Media.PageReplacementAlgorithm

A page replacement algorithm that utilizes a quasi LRU algorithm. This class is thread safe.
This class is used by BufferedFile to decide which pages should be replaced.
Inheritance: IDisposable
显示文件 Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Releases all the resources used by the PageReplacementAlgorithm object.

DoCollection ( CollectionEventArgs e ) : int

Executes a collection cycle of the pages that are unused.

PageReplacementAlgorithm ( MemoryPool pool ) : System

Creates a new instance of PageReplacementAlgorithm.

TryAddPage ( long position, IntPtr locationOfPage, int memoryPoolIndex ) : bool

Attempts to add the page to this PageReplacementAlgorithm. Fails if the page already exists.

Method Details

Dispose() public method

Releases all the resources used by the PageReplacementAlgorithm object.
public Dispose ( ) : void
return void

DoCollection() public method

Executes a collection cycle of the pages that are unused.
public DoCollection ( CollectionEventArgs e ) : int
e GSF.IO.Unmanaged.CollectionEventArgs
return int

PageReplacementAlgorithm() public method

Creates a new instance of PageReplacementAlgorithm.
public PageReplacementAlgorithm ( MemoryPool pool ) : System
pool MemoryPool The memory pool that blocks will be allocated from.
return System

TryAddPage() public method

Attempts to add the page to this PageReplacementAlgorithm. Fails if the page already exists.
public TryAddPage ( long position, IntPtr locationOfPage, int memoryPoolIndex ) : bool
position long the absolute position that the page references
locationOfPage IntPtr the pointer to the page
memoryPoolIndex int the index value of the memory pool page so it can be released back to the memory pool
return bool