Struct TimestampedValue<T>
- Namespace
- DotCompute.Abstractions.Telemetry.Profiles
- Assembly
- DotCompute.Abstractions.dll
Represents a timestamped value for time-series data.
public readonly struct TimestampedValue<T> : IEquatable<TimestampedValue<T>>
Type Parameters
TThe type of the value.
- Implements
- Inherited Members
Remarks
Initializes a new instance of the TimestampedValue struct.
Constructors
TimestampedValue(DateTimeOffset, T)
Represents a timestamped value for time-series data.
public TimestampedValue(DateTimeOffset timestamp, T value)
Parameters
timestampDateTimeOffsetThe timestamp.
valueTThe value.
Remarks
Initializes a new instance of the TimestampedValue struct.
Properties
Timestamp
Gets the timestamp.
public DateTimeOffset Timestamp { get; }
Property Value
Value
Gets the value.
public T Value { get; }
Property Value
- T
Methods
Equals(TimestampedValue<T>)
Determines whether the current instance is equal to another TimestampedValue instance.
public bool Equals(TimestampedValue<T> other)
Parameters
otherTimestampedValue<T>The TimestampedValue instance to compare with this instance.
Returns
- bool
true if the instances are equal; otherwise, false.
Equals(object?)
Determines whether the current instance is equal to a specified object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with this instance.
Returns
- bool
true if obj is a TimestampedValue and is equal to this instance; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for the current instance.
Operators
operator ==(TimestampedValue<T>, TimestampedValue<T>)
Determines whether two TimestampedValue instances are equal.
public static bool operator ==(TimestampedValue<T> left, TimestampedValue<T> right)
Parameters
leftTimestampedValue<T>The first instance to compare.
rightTimestampedValue<T>The second instance to compare.
Returns
- bool
true if the instances are equal; otherwise, false.
operator !=(TimestampedValue<T>, TimestampedValue<T>)
Determines whether two TimestampedValue instances are not equal.
public static bool operator !=(TimestampedValue<T> left, TimestampedValue<T> right)
Parameters
leftTimestampedValue<T>The first instance to compare.
rightTimestampedValue<T>The second instance to compare.
Returns
- bool
true if the instances are not equal; otherwise, false.