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

Provides a data IO session with the disk subsystem to perform basic read and write operations.
Inheritance: IDisposable
显示文件 Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Properties

Property Type Description
CachedLookups long
Lookups long

Public Methods

Method Description
Clear ( ) : void
DiskIoSession ( DiskIo diskIo, BinaryStreamIoSessionBase ioSession, FileHeaderBlock header, SubFileHeader file ) : System

Creates a new DiskIoSession that can be used to read from the disk subsystem.

Dispose ( ) : void

Releases all the resources used by the DiskIoSession object.

Read ( uint blockIndex, BlockType blockType, uint indexValue ) : void

Navigates to a block that will be only read and not modified.

ReadOld ( uint blockIndex, BlockType blockType, uint indexValue ) : void

Navigates to a block that will be only read and not modified.

WriteToExistingBlock ( uint blockIndex, BlockType blockType, uint indexValue ) : void

Navigates to a block that will be written to. This block must currently exist and have the correct parameters passed to this function In order to allow this block to be modified.

WriteToNewBlock ( uint blockIndex, BlockType blockType, uint indexValue ) : void

Navigates to a block that will be written to. This class does not check if overwriting an existing block. So be careful not to corrupt the file.

This function will increase the size of the file if the block excedes the current size of the file.

Private Methods

Method Description
ClearFooterData ( ) : void
IsFooterCurrentSnapshotAndValid ( ) : IoReadState
IsFooterValid ( ) : IoReadState
IsFooterValidFromOldBlock ( ) : IoReadState
ReadBlock ( bool requestWriteAccess ) : void

Tries to read data from the following file

WriteFooterData ( ) : void

Method Details

Clear() public method

public Clear ( ) : void
return void

DiskIoSession() public method

Creates a new DiskIoSession that can be used to read from the disk subsystem.
public DiskIoSession ( DiskIo diskIo, BinaryStreamIoSessionBase ioSession, FileHeaderBlock header, SubFileHeader file ) : System
diskIo DiskIo owner of the disk
ioSession GSF.IO.Unmanaged.BinaryStreamIoSessionBase the base ioSession to use for this io session
header FileHeaderBlock
file SubFileHeader The file that will be read from this diskIoSession
return System

Dispose() public method

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

Read() public method

Navigates to a block that will be only read and not modified.
public Read ( uint blockIndex, BlockType blockType, uint indexValue ) : void
blockIndex uint
blockType BlockType the type of this block.
indexValue uint a value put in the footer of the block designating the index of this block
return void

ReadOld() public method

Navigates to a block that will be only read and not modified.
public ReadOld ( uint blockIndex, BlockType blockType, uint indexValue ) : void
blockIndex uint
blockType BlockType the type of this block.
indexValue uint a value put in the footer of the block designating the index of this block
return void

WriteToExistingBlock() public method

Navigates to a block that will be written to. This block must currently exist and have the correct parameters passed to this function In order to allow this block to be modified.
public WriteToExistingBlock ( uint blockIndex, BlockType blockType, uint indexValue ) : void
blockIndex uint the index value of this block
blockType BlockType the type of this block.
indexValue uint a value put in the footer of the block designating the index of this block
return void

WriteToNewBlock() public method

Navigates to a block that will be written to. This class does not check if overwriting an existing block. So be careful not to corrupt the file.
This function will increase the size of the file if the block excedes the current size of the file.
public WriteToNewBlock ( uint blockIndex, BlockType blockType, uint indexValue ) : void
blockIndex uint the index value of this block
blockType BlockType the type of this block.
indexValue uint a value put in the footer of the block designating the index of this block
return void

Property Details

CachedLookups public_oe static_oe property

public static long CachedLookups
return long

Lookups public_oe static_oe property

public static long Lookups
return long