/// <summary> /// Initializes a new instance of the <see cref="IdGenerator"/> class. The <see cref="DefaultTimeSource"/> is /// used to retrieve timestamp information. /// </summary> /// <param name="generatorId">The Id of the generator.</param> /// <param name="epoch">The Epoch of the generator.</param> /// <param name="maskConfig">The <see cref="MaskConfig"/> of the generator.</param> /// <exception cref="ArgumentNullException">Thrown when maskConfig is null.</exception> /// <exception cref="InvalidOperationException">Thrown when maskConfig defines a non-63 bit bitmask.</exception> /// <exception cref="ArgumentOutOfRangeException"> /// Thrown when GeneratorId or Sequence masks are >31 bit, GeneratorId exceeds maximum value or epoch in future. /// </exception> public IdGenerator(int generatorId, DateTimeOffset epoch, MaskConfig maskConfig) : this(generatorId, maskConfig, new DefaultTimeSource(epoch)) { }
/// <summary> /// Initializes a new instance of the <see cref="IdGenerator"/> class. The <see cref="DefaultTimeSource"/> is /// used to retrieve timestamp information. /// </summary> /// <param name="generatorId">The Id of the generator.</param> /// <param name="maskConfig">The <see cref="MaskConfig"/> of the generator.</param> /// <exception cref="ArgumentNullException">Thrown when maskConfig is null.</exception> /// <exception cref="InvalidOperationException">Thrown when maskConfig defines a non-63 bit bitmask.</exception> /// <exception cref="ArgumentOutOfRangeException"> /// Thrown when GeneratorId or Sequence masks are >31 bit, GeneratorId exceeds maximum value or epoch in future. /// </exception> public IdGenerator(int generatorId, MaskConfig maskConfig) : this(generatorId, maskConfig, new DefaultTimeSource(DefaultEpoch)) { }