-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathISerializer.cs
More file actions
60 lines (56 loc) · 2.04 KB
/
ISerializer.cs
File metadata and controls
60 lines (56 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using System;
namespace RapidField.SolidInstruments.Serialization
{
/// <summary>
/// Performs serialization and deserialization for a given type.
/// </summary>
/// <typeparam name="T">
/// The type of the serializable object.
/// </typeparam>
public interface ISerializer<T> : ISerializer
where T : class
{
/// <summary>
/// Converts the specified bit field to its typed equivalent.
/// </summary>
/// <param name="serializedObject">
/// A serialized object.
/// </param>
/// <returns>
/// The deserialized object.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="serializedObject" /> is <see langword="null" />.
/// </exception>
public T Deserialize(Byte[] serializedObject);
/// <summary>
/// Converts the specified object to a serialized bit field.
/// </summary>
/// <param name="target">
/// An object to be serialized.
/// </param>
/// <returns>
/// The serialized bit field.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="target" /> is <see langword="null" />.
/// </exception>
public Byte[] Serialize(T target);
}
/// <summary>
/// Performs serialization and deserialization for a given type.
/// </summary>
public interface ISerializer
{
/// <summary>
/// Gets the format to use for serialization and deserialization.
/// </summary>
public SerializationFormat Format
{
get;
}
}
}