C# Class GSF.IO.FileStructure.TransactionalFileStructure

This class is responsible for managing the transactions that occur on the file system. Therefore, it keeps up with the latest snapshot of the file allocation table, permits only a single concurrent edit of the archive system, and determines when a file can be deleted when there are no read or write transactions. It also containst the IO system.
Inheritance: IDisposable
Mostrar archivo Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Methods

Method Description
BeginEdit ( ) : TransactionalEdit

This will start a transactional edit on the file.

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.

CreateFile ( string fileName, int blockSize ) : TransactionalFileStructure

Creates a new archive file using the provided file. File is editable.

CreateInMemory ( int blockSize ) : TransactionalFileStructure

Creates a new archive file that is completely in memory

Dispose ( ) : void

Releases all the resources used by the TransactionalFileStructure object.

OpenFile ( string fileName, bool isReadOnly ) : TransactionalFileStructure

Opens an existing file.

Private Methods

Method Description
OnTransactionCommitted ( ) : void
OnTransactionRolledBack ( ) : void
TransactionalFileStructure ( DiskIo diskIo ) : System

Method Details

BeginEdit() public method

This will start a transactional edit on the file.
public BeginEdit ( ) : TransactionalEdit
return TransactionalEdit

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

CreateFile() public static method

Creates a new archive file using the provided file. File is editable.
public static CreateFile ( string fileName, int blockSize ) : TransactionalFileStructure
fileName string
blockSize int
return TransactionalFileStructure

CreateInMemory() public static method

Creates a new archive file that is completely in memory
public static CreateInMemory ( int blockSize ) : TransactionalFileStructure
blockSize int
return TransactionalFileStructure

Dispose() public method

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

OpenFile() public static method

Opens an existing file.
public static OpenFile ( string fileName, bool isReadOnly ) : TransactionalFileStructure
fileName string
isReadOnly bool
return TransactionalFileStructure