![]() |
SystemEX
Lacking
Additional generic collection types missing in .net
|
Simple example showing how a struct can participate in the SystemEx hashing system using IHashable<SensorData>. More...
Public Member Functions | |
| SensorData () | |
| Initializes the struct with example values. | |
| FixedVector< byte > | ToBytes () |
| Converts this struct into a deterministic byte sequence. | |
| override int | GetHashCode () |
| Computes a 32‑bit hash for this struct. | |
| ulong | GetHashCodeLong () |
| Computes a 64‑bit hash for this struct. | |
Public Attributes | |
| int | Id |
| Example fields that will be included in the hash. | |
| float | Value |
Simple example showing how a struct can participate in the SystemEx hashing system using IHashable<SensorData>.
This demonstrates:
| Examples.SensorData.SensorData | ( | ) |
Initializes the struct with example values.
| override int Examples.SensorData.GetHashCode | ( | ) |
Computes a 32‑bit hash for this struct.
How it works:
If the hash result is non‑zero, it is returned. Otherwise, the fallback is the default .NET hash code.
| ulong Examples.SensorData.GetHashCodeLong | ( | ) |
Computes a 64‑bit hash for this struct.
This works exactly like GetHashCode(), but produces a 64‑bit value. If the computed hash is zero, the method returns 0 as a fallback.
| FixedVector< byte > Examples.SensorData.ToBytes | ( | ) |
Converts this struct into a deterministic byte sequence.
Important notes for beginners:
HashFactory will use these bytes as input for the selected hash algorithm.
Implements SystemEx.Hash.IHashable< T >.
| int Examples.SensorData.Id |
Example fields that will be included in the hash.