C# Class DistributedFileSystem.ChunkFlags

Afficher le fichier Open project: MarcFletcher/NetworkComms.Net Class Usage Examples

Méthodes publiques

Méthode Description
AllFlagsSet ( byte uptoChunkIndexInclusive ) : bool

Returns true if all bit flags up to the provided uptoChunkIndexInclusive are set to true

ChunkFlags ( byte intialState ) : System

Initialises the ChunkFlags. The initial state is typically 0 or totalNumChunks

ClearAllFlags ( ) : void

Sets all chunk flags to unset.

FlagSet ( byte chunkIndex ) : bool

Returns true if the provided chunk is available. Zero indexed from least significant bit.

NumCompletedChunks ( ) : byte

Returns the number of completed chunk

SetFlag ( byte chunkIndex, bool state = true ) : void

Sets the bit flag to 1 which corresponds with the provided chunk index. Zero indexed from least significant bit.

UpdateFlags ( ChunkFlags latestChunkFlags ) : void

Updates local chunk flags with those provided.

Private Methods

Méthode Description
ChunkFlags ( ) : System

Method Details

AllFlagsSet() public méthode

Returns true if all bit flags up to the provided uptoChunkIndexInclusive are set to true
public AllFlagsSet ( byte uptoChunkIndexInclusive ) : bool
uptoChunkIndexInclusive byte The chunk index up to which the flags should be checked
Résultat bool

ChunkFlags() public méthode

Initialises the ChunkFlags. The initial state is typically 0 or totalNumChunks
public ChunkFlags ( byte intialState ) : System
intialState byte The initial state of the ChunkFlags
Résultat System

ClearAllFlags() public méthode

Sets all chunk flags to unset.
public ClearAllFlags ( ) : void
Résultat void

FlagSet() public méthode

Returns true if the provided chunk is available. Zero indexed from least significant bit.
public FlagSet ( byte chunkIndex ) : bool
chunkIndex byte The chunk index flag to check
Résultat bool

NumCompletedChunks() public méthode

Returns the number of completed chunk
public NumCompletedChunks ( ) : byte
Résultat byte

SetFlag() public méthode

Sets the bit flag to 1 which corresponds with the provided chunk index. Zero indexed from least significant bit.
public SetFlag ( byte chunkIndex, bool state = true ) : void
chunkIndex byte The chunk index to set
state bool The state of the flag
Résultat void

UpdateFlags() public méthode

Updates local chunk flags with those provided.
public UpdateFlags ( ChunkFlags latestChunkFlags ) : void
latestChunkFlags ChunkFlags The new chunk flags
Résultat void