Table of Contents

Struct SequenceId

Namespace
Coherence.Brook
Assembly
Coherence.Brook.dll

Represents an auto incrementing sequence identifier. Usually a value between 0 and 127 (7 bits). After 127 it wraps around to 0.

public struct SequenceId

Constructors

SequenceId(byte)

Constructing a SequenceId

public SequenceId(byte id)

Parameters

id byte

Exceptions

Exception

Thrown when the provided id is not between 0 and 127.

Fields

Max

public static SequenceId Max

Field Value

SequenceId

MaxRange

public const byte MaxRange = 128

Field Value

byte

MaxValue

public const byte MaxValue = 127

Field Value

byte

Properties

Value

public readonly byte Value { get; }

Property Value

byte

Methods

Distance(SequenceId)

Returns the closest distance between the otherId and this SequenceId.

public int Distance(SequenceId otherId)

Parameters

otherId SequenceId

Returns

int

Equals(SequenceId)

public bool Equals(SequenceId other)

Parameters

other SequenceId

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

IsValidSuccessor(SequenceId)

Checks if the nextId comes after this SequenceId.

public bool IsValidSuccessor(SequenceId nextId)

Parameters

nextId SequenceId

Returns

bool

Next()

Returns the next SequenceId. Note that the value wraps around 127.

public SequenceId Next()

Returns

SequenceId

ToString()

public override string ToString()

Returns

string