using System; namespace Edge.Core.Parser { /// /// The message parsing is defined as 2 direction convert, /// we say the 'forward' direction convert is from an unreadable format data to a readable static type object, like the bytes to object, this is called Deserialize. /// vice versa, the 'backward' direction convert is covert a readable staic type object to an unreadable format data, like covert the object to bytes, this is called Serialize. /// /// Type for unreadable format data /// Type for readable object public interface IMessageParser //where TTemplate : MessageTemplateBase { event EventHandler> Deserializing; event EventHandler> Deserialized; event EventHandler> Serializing; event EventHandler> Serialized; event EventHandler> FieldSerializing; event EventHandler> FieldSerialized; TMessage Deserialize(TRaw data); TRaw Serialize(TMessage message); } }