C# Class Disruptor.Util

Set of common functions used by the Disruptor
Afficher le fichier Open project: disruptor-net/Disruptor-net

Méthodes publiques

Méthode Description
CeilingNextPowerOfTwo ( this x ) : int

Calculate the next power of 2, greater than or equal to x.

GetMinimumSequence ( ISequence sequences, long minimum = long.MaxValue ) : long

Get the minimum sequence from an array of Sequences.

GetSequencesFor ( ) : ISequence[]

Get an array of Sequences for the passed IEventProcessors

IsPowerOf2 ( this x ) : bool

Test whether a given integer is a power of 2

Log2 ( int i ) : int

Calculate the log base 2 of the supplied integer, essentially reports the location of the highest bit.

Method Details

CeilingNextPowerOfTwo() public static méthode

Calculate the next power of 2, greater than or equal to x.
public static CeilingNextPowerOfTwo ( this x ) : int
x this Value to round up
Résultat int

GetMinimumSequence() public static méthode

Get the minimum sequence from an array of Sequences.
public static GetMinimumSequence ( ISequence sequences, long minimum = long.MaxValue ) : long
sequences ISequence sequences to compare.
minimum long an initial default minimum. If the array is empty this value will returned.
Résultat long

GetSequencesFor() public static méthode

Get an array of Sequences for the passed IEventProcessors
public static GetSequencesFor ( ) : ISequence[]
Résultat ISequence[]

IsPowerOf2() public static méthode

Test whether a given integer is a power of 2
public static IsPowerOf2 ( this x ) : bool
x this
Résultat bool

Log2() public static méthode

Calculate the log base 2 of the supplied integer, essentially reports the location of the highest bit.
public static Log2 ( int i ) : int
i int Value to calculate log2 for.
Résultat int