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

The IO system that the entire file structure uses to acomplish it's IO operations. This class hands data one block at a time to requesting classes and is responsible for checking the footer data of the file for corruption.
Inheritance: IDisposable
Show file Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Methods

Method Description
ChangeExtension ( string extension, bool isReadOnly, bool isSharingEnabled ) : void

Changes the extension of the current file.

ChangeShareMode ( bool isReadOnly, bool isSharingEnabled ) : void

Reopens the file with different permissions.

CommitChanges ( FileHeaderBlock header ) : void

Occurs when committing the following data to the disk. This will copy any pending data to the disk in a manner that will protect against corruption.

CreateDiskIoSession ( FileHeaderBlock header, SubFileHeader file ) : DiskIoSession

Creates a DiskIoSession that can be used to perform basic read/write functions.

CreateFile ( string fileName, MemoryPool pool, int fileStructureBlockSize ) : DiskIo
CreateMemoryFile ( MemoryPool pool, int fileStructureBlockSize ) : DiskIo
Dispose ( ) : void

Releases the unmanaged resources used by the DiskIo object and optionally releases the managed resources.

OpenFile ( string fileName, MemoryPool pool, bool isReadOnly ) : DiskIo
RollbackChanges ( ) : void

Occurs when rolling back a transaction. This will free up any temporary space allocated for the change.

Private Methods

Method Description
DiskIo ( DiskMedium stream, bool isReadOnly ) : System

Method Details

ChangeExtension() public method

Changes the extension of the current file.
public ChangeExtension ( string extension, bool isReadOnly, bool isSharingEnabled ) : void
extension string the new extension
isReadOnly bool If the file should be reopened as readonly
isSharingEnabled bool If the file should share read privileges.
return void

ChangeShareMode() public method

Reopens the file with different permissions.
public ChangeShareMode ( bool isReadOnly, bool isSharingEnabled ) : void
isReadOnly bool If the file should be reopened as readonly
isSharingEnabled bool If the file should share read privileges.
return void

CommitChanges() public method

Occurs when committing the following data to the disk. This will copy any pending data to the disk in a manner that will protect against corruption.
public CommitChanges ( FileHeaderBlock header ) : void
header FileHeaderBlock
return void

CreateDiskIoSession() public method

Creates a DiskIoSession that can be used to perform basic read/write functions.
public CreateDiskIoSession ( FileHeaderBlock header, SubFileHeader file ) : DiskIoSession
header FileHeaderBlock
file SubFileHeader
return DiskIoSession

CreateFile() public static method

public static CreateFile ( string fileName, MemoryPool pool, int fileStructureBlockSize ) : DiskIo
fileName string
pool GSF.IO.Unmanaged.MemoryPool
fileStructureBlockSize int
return DiskIo

CreateMemoryFile() public static method

public static CreateMemoryFile ( MemoryPool pool, int fileStructureBlockSize ) : DiskIo
pool GSF.IO.Unmanaged.MemoryPool
fileStructureBlockSize int
return DiskIo

Dispose() public method

Releases the unmanaged resources used by the DiskIo object and optionally releases the managed resources.
public Dispose ( ) : void
return void

OpenFile() public static method

public static OpenFile ( string fileName, MemoryPool pool, bool isReadOnly ) : DiskIo
fileName string
pool GSF.IO.Unmanaged.MemoryPool
isReadOnly bool
return DiskIo

RollbackChanges() public method

Occurs when rolling back a transaction. This will free up any temporary space allocated for the change.
public RollbackChanges ( ) : void
return void