Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | Public Member Functions | List of all members
TypeTagAttribute Class Reference

Assigns a "type tag" to a synchronizer, which identifies the type of object it reads/writes within a data stream, enabling dynamic typing (polymorphic serialization and deserialization). More...


Source file:
Inheritance diagram for TypeTagAttribute:

Remarks

Assigns a "type tag" to a synchronizer, which identifies the type of object it reads/writes within a data stream, enabling dynamic typing (polymorphic serialization and deserialization).

Place this attribute on a synchronizer method (preferred), or on a synchronizer struct/class that implements ISyncObject{SM, T}. Do not put it on the data types being synchronized, as SyncLib does not expect business objects to be concerned with serialization.

This attribute is merely data; it is read and interpreted by TypeTagRegistry, whose virtual AttributeTagOf methods define the convention (and can be overridden to change it). In brief:

Synchronizers without a tag behave as before: no tag is read or written unless the synchronizer calls ISyncManager.SyncTypeTag manually (a low-level technique that is incompatible with dynamic typing, because a reader must know the tag before it can choose which synchronizer to invoke).

Properties

string Tag [get]
 

Public Member Functions

 TypeTagAttribute (string tag)