Delta |
public readonly struct DeltaValue
The DeltaValue type exposes the following members.
| Name | Description | |
|---|---|---|
| AffectedArea | Returns the affected area from a DeltaValue created using Create(BufferSegment, MemoryAddress, AddressArea). | |
| CreateContextProvider | Creates a new IDataContextProvider for demarshalling DeltaValues. | |
| Equals |
Determines whether the specified value equals the current value.
(Overrides ValueTypeEquals(Object)) | |
| GetDataType | Returns the type of the value (or null if the value is null). | |
| GetHashCode |
Returns a hash code for the current value.
(Overrides ValueTypeGetHashCode) | |
| GetTime | Returns the time of the event that produced the value. | |
| GetValue | Returns the actual .Net value. | |
| GetValueStruct | Returns the actual .Net value. | |
| PeekValue | Returns the actual .Net value if it's immediately available, otherwise the base .Net value for a delta. | |
| PropagateUpdate | Determines whether an update from this value to the specified value should be allowed to propagate. | |
| SetTime | Returns a new DeltaValue with the specified time set. |
This class wraps up a data value that we pass upstream/downstream. In the simplest case it's just a wrapper around an int or a bool.
The real use of this class is to wrap up deltas, where the information passed is not just the value of the tag but also a description of which parts of the data have changed. A simple example is Memory which passes the memory buffer for a byte[] tag, but also includes information about which part of the tag memory area actually changed.
Data deltas for structures (which property or properties within the structure) or for arrays (which elements in the array) are handled with special classes that derive from DeltaValue. These classes need to be aware of the threading model and to ensure that events (such as PropertyChanged or CollectionChanged don't get raised in the server thread, but get delayed and raised at the appropriate time in the user/model thread.