Struct Watchdog
A configurable property of a Task that specified how long a task can rung before triggering a major fault.
public readonly struct Watchdog : IEquatable<Watchdog>
- Implements
- Inherited Members
Remarks
Watchdog is a simple float value that must be between 0.1 and 2,000,000.0 ms. Attempting to set the Watchdog to a value outside that range will result in an ArgumentOutOfRangeException. This parameter will control how long a task can rung before triggering a major fault.
Constructors
Watchdog(float)
Creates a new instance of Watchdog with the specified value.
public Watchdog(float watchdog)
Parameters
watchdogfloatThe value of the watchdog in milliseconds. Must be a value between 0.1 and 2M.
Exceptions
- ArgumentOutOfRangeException
Throw when the provided value is not within the specified range.
Methods
Default()
public static Watchdog Default()
Returns
- Watchdog
A new
Watchdogvalue.
Equals(Watchdog)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Watchdog other)
Parameters
otherWatchdogAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Parse(string)
Parses a string value into a Watchdog.
public static Watchdog Parse(string str)
Parameters
strstringThe string to parse.
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(Watchdog, Watchdog)
Determines if the provided objects are equal.
public static bool operator ==(Watchdog left, Watchdog right)
Parameters
Returns
- bool
true if the provided objects are equal; otherwise, false.
implicit operator float(Watchdog)
public static implicit operator float(Watchdog watchdog)
Parameters
watchdogWatchdogThe value to convert.
Returns
implicit operator Watchdog(float)
public static implicit operator Watchdog(float watchdog)
Parameters
watchdogfloatThe value to convert.
Returns
operator !=(Watchdog, Watchdog)
Determines if the provided objects are not equal.
public static bool operator !=(Watchdog left, Watchdog right)
Parameters
Returns
- bool
true if the provided objects are not equal; otherwise, false.