-
Notifications
You must be signed in to change notification settings - Fork 1
/
IMonotonicStampContext.cs
74 lines (70 loc) · 2.78 KB
/
IMonotonicStampContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
namespace HpTimeStamps
{
/// <summary>
/// The monotonic time stamp context should be implemented
/// as a readonly struct
/// </summary>
public interface IMonotonicStampContext
{
/// <summary>
/// True if both <see cref="EasyConversionToAndFromTimespanTicks"/> AND <see cref="EasyConversionToAndFromNanoseconds"/> are true.
/// </summary>
bool EasyConversionAllWays { get; }
/// <summary>
/// True if the conversion factor between timespan ticks and Monotonic stamp ticks is a power of 10
/// </summary>
bool EasyConversionToAndFromTimespanTicks { get; }
/// <summary>
/// True if the conversion factor between monotonic stamp ticks and nanoseconds is a power of 10
/// </summary>
bool EasyConversionToAndFromNanoseconds { get; }
/// <summary>
/// True if the struct implementing this interface
/// was not properly initialized. Usually
/// testing <see cref="ContextId"/> against
/// the <see langword = "default"/> value of <see cref="Guid"/>
/// is sufficient
/// </summary>
bool IsInvalid { get; }
/// <summary>
/// Unique id
/// </summary>
Guid ContextId { get; }
/// <summary>
/// True if <see cref="UtcDateTimeBeginReference"/> equals
/// <see cref="LocalTimeBeginReference"/>, false otherwise
/// </summary>
bool AllTimestampsUtc { get; }
/// <summary>
/// The UTC neutral date time represented by
/// <see cref="ReferenceTicks"/>.
/// </summary>
DateTime UtcDateTimeBeginReference { get; }
/// <summary>
/// The local time version of <see cref="UtcDateTimeBeginReference"/>.
/// If <see cref="AllTimestampsUtc"/>, this value is equal to <see cref="UtcDateTimeBeginReference"/>.
/// </summary>
DateTime LocalTimeBeginReference { get; }
/// <summary>
/// The number of clock ticks that equals <see cref="UtcDateTimeBeginReference"/>
/// </summary>
long ReferenceTicks { get; }
/// <summary>
/// The number of clock ticks in one second
/// </summary>
long TicksPerSecond { get; }
/// <summary>
/// Difference between <see cref="UtcDateTimeBeginReference"/> and <see cref="LocalTimeBeginReference"/>.
/// </summary>
TimeSpan UtcLocalTimeOffset { get; }
/// <summary>
/// Number of nanoseconds per seconds
/// </summary>
long NanosecondsFrequency { get; }
/// <summary>
/// Retrieve <see cref="UtcLocalTimeOffset"/> as a duration.
/// </summary>
ref readonly Duration UtcLocalTimeOffsetAsDuration { get; }
}
}