Changeset 3016 for trunk/sources/HeuristicLab.Persistence/3.3/Interfaces
- Timestamp:
- 03/14/10 00:42:28 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Interfaces
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/ICompositeSerializer.cs
r2993 r3016 5 5 namespace HeuristicLab.Persistence.Interfaces { 6 6 7 /// <summary> 8 /// A composite serializer does not directly transform an object into its 9 /// serialized form. It merely decomposes into other objects, that can 10 /// later be used to recompose the same object. 11 /// </summary> 7 12 public interface ICompositeSerializer { 8 13 9 14 /// <summary> 10 15 /// Defines the Priorty of this composite serializer. Higher number means 11 /// higher prioriy. Negative numbers are fallback serializers. 16 /// higher prioriy. Negative numbers are fallback serializers that are 17 /// disabled by default. 18 /// 12 19 /// All default generic composite serializers have priority 100. Specializations 13 20 /// have priority 200 so they will be tried first. Priorities are … … 18 25 /// <summary> 19 26 /// Determines for every type whether the composite serializer is applicable. 20 /// </summary> 27 /// </summary> 28 /// <param name="type">The type.</param> 29 /// <returns> 30 /// <c>true</c> if this instance can serialize the specified type; otherwise, <c>false</c>. 31 /// </returns> 21 32 bool CanSerialize(Type type); 22 33 … … 25 36 /// ICompositeSerializer. 26 37 /// </summary> 38 /// <param name="type">The type.</param> 39 /// <returns>A string justifying why type cannot be serialized.</returns> 27 40 string JustifyRejection(Type type); 28 41 29 42 /// <summary> 30 /// Generate MetaInfo necessary for instance creation. (i.e. 31 /// array dimensions). 32 /// </summary> 43 /// Generate MetaInfo necessary for instance creation. (e.g. dimensions 44 /// necessary for array creation (see <see cref="ArraySerializer"/>). 45 /// </summary> 46 /// <param name="obj">An object.</param> 47 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 33 48 IEnumerable<Tag> CreateMetaInfo(object obj); 34 49 35 50 /// <summary> 36 /// Decompose an object into KeyValuePairs, the Keycan be null,51 /// Decompose an object into <see cref="Tag"/>s, the tag name can be null, 37 52 /// the order in which elements are generated is guaranteed to be 38 53 /// the same as they will be supplied to the Populate method. 39 /// </summary> 54 /// </summary> 55 /// <param name="obj">An object.</param> 56 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 40 57 IEnumerable<Tag> Decompose(object obj); 41 58 … … 43 60 /// Create an instance of the object using the provided meta information. 44 61 /// </summary> 45 /// <param name="type"></param> 46 /// <returns></returns> 62 /// <param name="type">A type.</param> 63 /// <param name="metaInfo">The meta information.</param> 64 /// <returns>A fresh instance of the provided type.</returns> 47 65 object CreateInstance(Type type, IEnumerable<Tag> metaInfo); 48 66 49 67 /// <summary> 50 /// Compose an object from the KeyValuePairs previously generated 51 /// in DeCompose. The order in which the values are supplied is 52 /// the same as they where generated. Keys might be null. 53 /// </summary> 68 /// Fills an object with values from the previously generated <see cref="Tag"/>s 69 /// in Decompose. The order in which the values are supplied is 70 /// the same as they where generated. <see cref="Tag"/> names might be null. 71 /// </summary> 72 /// <param name="instance">An empty object instance.</param> 73 /// <param name="tags">The tags.</param> 74 /// <param name="type">The type.</param> 54 75 void Populate(object instance, IEnumerable<Tag> tags, Type type); 55 76 } -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IFormat.cs
r1564 r3016 8 8 /// </summary> 9 9 public interface IFormat { 10 11 /// <summary> 12 /// Gets the name. 13 /// </summary> 14 /// <value>The name.</value> 10 15 string Name { get; } 16 17 /// <summary> 18 /// Gets the type of the serial data. 19 /// </summary> 20 /// <value>The type of the serial data.</value> 11 21 Type SerialDataType { get; } 12 22 } -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IPrimitiveSerializer.cs
r1823 r3016 9 9 /// </summary> 10 10 public interface IPrimitiveSerializer { 11 12 /// <summary> 13 /// Gets the type of the serial data. 14 /// </summary> 15 /// <value>The type of the serial data.</value> 11 16 Type SerialDataType { get; } 17 18 /// <summary> 19 /// Gets the source type. 20 /// </summary> 21 /// <value>The type of the source.</value> 12 22 Type SourceType { get; } 23 24 /// <summary> 25 /// Creates a serialized representation of the provided object. 26 /// </summary> 27 /// <param name="o">The object.</param> 28 /// <returns>A serialized version of the object.</returns> 13 29 ISerialData Format(object o); 14 object Parse(ISerialData o); 30 31 32 /// <summary> 33 /// Creates a fresh object instance using the serializes data.. 34 /// </summary> 35 /// <param name="data">The data.</param> 36 /// <returns>A fresh object instance.</returns> 37 object Parse(ISerialData data); 15 38 } 16 39 … … 20 43 /// of implementing this interface. 21 44 /// </summary> 45 /// <typeparam name="Source">The source type.</typeparam> 46 /// <typeparam name="SerialData">The serialized data type.</typeparam> 22 47 public interface IPrimitiveSerializer<Source, SerialData> : IPrimitiveSerializer where SerialData : ISerialData { 48 49 /// <summary> 50 /// Creates a serialized version of the provided object. 51 /// </summary> 52 /// <param name="o">The object.</param> 53 /// <returns>A serialized version of the object.</returns> 23 54 SerialData Format(Source o); 24 Source Parse(SerialData t); 55 56 57 /// <summary> 58 /// Creates a fresh object instance from the serialized data 59 /// </summary> 60 /// <param name="data">The data.</param> 61 /// <returns>A fresh object instance.</returns> 62 Source Parse(SerialData data); 25 63 } 26 64
Note: See TracChangeset
for help on using the changeset viewer.