-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIMessageAdapter.cs
More file actions
71 lines (66 loc) · 2.66 KB
/
IMessageAdapter.cs
File metadata and controls
71 lines (66 loc) · 2.66 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
61
62
63
64
65
66
67
68
69
70
71
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using RapidField.SolidInstruments.Serialization;
using System;
namespace RapidField.SolidInstruments.Messaging
{
/// <summary>
/// Facilitates conversion of general-format messages to and from implementation-specific messages.
/// </summary>
/// <typeparam name="TAdaptedMessage">
/// The type of the implementation-specific message.
/// </typeparam>
public interface IMessageAdapter<TAdaptedMessage>
where TAdaptedMessage : class
{
/// <summary>
/// Converts the specified general-format message to an implementation-specific message.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message.
/// </typeparam>
/// <param name="message">
/// A general-format message to convert.
/// </param>
/// <returns>
/// The implementation-specific message.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="message" /> is <see langword="null" />.
/// </exception>
public TAdaptedMessage ConvertForward<TMessage>(TMessage message)
where TMessage : class, IMessageBase;
/// <summary>
/// Converts the specified implementation-specific message to a general-format message.
/// </summary>
/// <typeparam name="TMessage">
/// The type of the message.
/// </typeparam>
/// <param name="message">
/// An implementation-specific message to convert.
/// </param>
/// <returns>
/// The general-format message.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="message" /> is <see langword="null" />.
/// </exception>
public TMessage ConvertReverse<TMessage>(TAdaptedMessage message)
where TMessage : class, IMessageBase;
/// <summary>
/// Gets the type of implementation-specific adapted messages.
/// </summary>
public Type AdaptedMessageType
{
get;
}
/// <summary>
/// Gets the format that is used to serialize and deserialize messages.
/// </summary>
public SerializationFormat MessageSerializationFormat
{
get;
}
}
}