C# Class GSF.IO.FileStructure.IndexParser

This class provides passthrough properties for the IndexMapper class as well follows the directions of the Index Mapper to find the data cluster that contains the point in question.
Inheritance: IndexMapper
Show file Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Protected Properties

Property Type Description
DataClusterAddress uint
FirstIndirectBlockAddress uint
FourthIndirectBlockAddress uint
SecondIndirectBlockAddress uint
ThirdIndirectBlockAddress uint

Public Methods

Method Description
ClearIndexCache ( IndexParser mostRecentParser ) : void

Resets the index cache with the information from the supplied mostRecentParser

IndexParser ( SubFileDiskIoSessionPool ioSessions ) : GSF.IO.FileStructure.Media

Creates a new instance of this class.

SetPositionAndLookup ( uint positionIndex ) : void

Determines if the current sector contains the position passed. If not, it updates the current sector to the one that contains the passed position.

VirtualToPhysical ( uint positionIndex ) : uint

This function will also call IndexMapper.MapPosition so after it returns, the current block data will be updated.

Private Methods

Method Description
GetBlockIndexValue ( uint blockIndex, int offset, BlockType blockType, uint blockBaseIndex ) : uint

This uses the (blockIndex,offset) values to determine what the next block index is. This also has consistency checks to determine if the file is inconsistent (potentially corruption)

UpdateBlockInformation ( ) : void

Looks up the physical/virtual block positions for the address given.

Method Details

ClearIndexCache() public method

Resets the index cache with the information from the supplied mostRecentParser
public ClearIndexCache ( IndexParser mostRecentParser ) : void
mostRecentParser IndexParser
return void

IndexParser() public method

Creates a new instance of this class.
public IndexParser ( SubFileDiskIoSessionPool ioSessions ) : GSF.IO.FileStructure.Media
ioSessions SubFileDiskIoSessionPool IoSessions to use to read from this disk
return GSF.IO.FileStructure.Media

SetPositionAndLookup() public method

Determines if the current sector contains the position passed. If not, it updates the current sector to the one that contains the passed position.
public SetPositionAndLookup ( uint positionIndex ) : void
positionIndex uint The position to navigate to indexed to the block data block size.
return void

VirtualToPhysical() public method

This function will also call IndexMapper.MapPosition so after it returns, the current block data will be updated.
public VirtualToPhysical ( uint positionIndex ) : uint
positionIndex uint The virtual index address.
return uint

Property Details

DataClusterAddress protected property

The address of the first block of the data cluster.
protected uint DataClusterAddress
return uint

FirstIndirectBlockAddress protected property

The address of the first indirect block
protected uint FirstIndirectBlockAddress
return uint

FourthIndirectBlockAddress protected property

The address of the third indirect block
protected uint FourthIndirectBlockAddress
return uint

SecondIndirectBlockAddress protected property

The address of the second indirect block
protected uint SecondIndirectBlockAddress
return uint

ThirdIndirectBlockAddress protected property

The address of the third indirect block
protected uint ThirdIndirectBlockAddress
return uint