using System; namespace HeuristicLab.Persistence.Interfaces { /// /// Marker interface primitive serializers. Transform data of type SourceType /// into the serialization format SerialDataType. Derive from PrimitiveSerializerBase instead /// of implementing this interface. /// public interface IPrimitiveSerializer { /// /// Gets the type of the serial data. /// /// The type of the serial data. Type SerialDataType { get; } /// /// Gets the source type. /// /// The type of the source. Type SourceType { get; } /// /// Creates a serialized representation of the provided object. /// /// The object. /// A serialized version of the object. ISerialData Format(object o); /// /// Creates a fresh object instance using the serializes data.. /// /// The data. /// A fresh object instance. object Parse(ISerialData data); } /// /// Marker interface primitive serializers. Transform data of type SourceType /// into the serialization format SerialDataType. Derive from PrimitiveSerializerBase instead /// of implementing this interface. /// /// The source type. /// The serialized data type. public interface IPrimitiveSerializer : IPrimitiveSerializer where SerialData : ISerialData { /// /// Creates a serialized version of the provided object. /// /// The object. /// A serialized version of the object. SerialData Format(Source o); /// /// Creates a fresh object instance from the serialized data /// /// The data. /// A fresh object instance. Source Parse(SerialData data); } }