2019-12-04 18:57:18 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
2019-12-08 19:54:52 +01:00
|
|
|
|
namespace Swan.Threading {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines an atomic DateTime.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class AtomicDateTime : AtomicTypeBase<DateTime> {
|
2019-12-04 18:57:18 +01:00
|
|
|
|
/// <summary>
|
2019-12-08 19:54:52 +01:00
|
|
|
|
/// Initializes a new instance of the <see cref="AtomicDateTime"/> class.
|
2019-12-04 18:57:18 +01:00
|
|
|
|
/// </summary>
|
2019-12-08 19:54:52 +01:00
|
|
|
|
/// <param name="initialValue">The initial value.</param>
|
|
|
|
|
public AtomicDateTime(DateTime initialValue) : base(initialValue.Ticks) {
|
|
|
|
|
// placeholder
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override DateTime FromLong(Int64 backingValue) => new DateTime(backingValue);
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override Int64 ToLong(DateTime value) => value.Ticks;
|
|
|
|
|
}
|
2019-12-04 18:57:18 +01:00
|
|
|
|
}
|