|
Enhanced C#
Loyc library documentation
|
A synchronizer for dynamically-typed (polymorphic) fields: when writing, the runtime type of the value selects a synchronizer from a TypeSyncRegistry and its type tag (from a TypeTagRegistry) is recorded; when reading, the type tag read from the data stream selects the synchronizer. Being an ordinary ISyncField{SM, T}, it composes with the list/collection helpers (e.g. as the item synchronizer of a list). More...
A synchronizer for dynamically-typed (polymorphic) fields: when writing, the runtime type of the value selects a synchronizer from a TypeSyncRegistry and its type tag (from a TypeTagRegistry) is recorded; when reading, the type tag read from the data stream selects the synchronizer. Being an ordinary ISyncField{SM, T}, it composes with the list/collection helpers (e.g. as the item synchronizer of a list).
By default the ambient services (TypeSyncRegistry.Default and TypeTagRegistry.Default) are consulted on every call; the two-argument constructor binds specific instances instead. See also: SyncDynamicExt.SyncDyn{SM, T}(SM, FieldId, T, ObjectMode).
| SM | : | ISyncManager |
Public fields | |
| ObjectMode | _mode |
| TypeSyncRegistry | _synchronizers |
| TypeTagRegistry | _tags |
Public Member Functions | |
| DynamicSync (ObjectMode mode) | |
| DynamicSync (TypeSyncRegistry synchronizers, TypeTagRegistry?tags=null, ObjectMode mode=ObjectMode.Deduplicate) | |
| Binds this synchronizer to specific registry instances instead of the ambient (async-local) defaults. This is useful when different data streams need different registrations at the same time, and avoids any dependence on thread identity (e.g. across await points). More... | |
| T | Sync (ref SM sync, FieldId name, T?value) |
|
inline |
Binds this synchronizer to specific registry instances instead of the ambient (async-local) defaults. This is useful when different data streams need different registrations at the same time, and avoids any dependence on thread identity (e.g. across await points).
1.8.7