Class SizeEstimate
Estimate the size of something - usually for cache-size estimates.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public record SizeEstimate : IEquatable<SizeEstimate>
- Inheritance
-
objectSizeEstimate
- Implements
Constructors
SizeEstimate(int, int, int, bool, bool)
Estimate the size of something - usually for cache-size estimates.
public SizeEstimate(int Known = 0, int Estimated = 0, int Expanded = 0, bool IsUnknown = false, bool IsError = false)
Parameters
KnownintThe known amount of data.
EstimatedintAny estimate, which will either replace the known amount or be added to it.
ExpandedintIsUnknownboolIndicates if the size is unknown.
IsErrorboolIndicates if there was an error estimating the size.
Properties
Estimated
Any estimate, which will either replace the known amount or be added to it.
public int Estimated { get; init; }
Property Value
Expanded
public int Expanded { get; init; }
Property Value
Icon
Size indication icon, which can be a warning, unknown, or check mark depending on the precision.
public string Icon { get; }
Property Value
IsError
Indicates if there was an error estimating the size.
public bool IsError { get; init; }
Property Value
IsUnknown
Indicates if the size is unknown.
public bool IsUnknown { get; init; }
Property Value
Known
The known amount of data.
public int Known { get; init; }
Property Value
Total
Total size, combining known and estimated sizes.
public int Total { get; }
Property Value
Operators
operator +(SizeEstimate, SizeEstimate)
Add two size estimates together. The known and estimated sizes are added, and the unknown and error flags are combined with a logical OR.
public static SizeEstimate operator +(SizeEstimate a, SizeEstimate b)
Parameters
aSizeEstimateThe first size estimate.
bSizeEstimateThe second size estimate.
Returns
- SizeEstimate
The combined size estimate.
operator -(SizeEstimate, SizeEstimate)
Subtract one size estimate from another. The known and estimated sizes are subtracted, and the unknown and error flags are combined with a logical OR.
public static SizeEstimate operator -(SizeEstimate a, SizeEstimate b)
Parameters
aSizeEstimateThe first size estimate.
bSizeEstimateThe second size estimate.
Returns
- SizeEstimate
The resulting size estimate after subtraction.