mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
647db9635a
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows * Removing local settings. * Removing remining old files from merge.
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Checkpointing;
|
|
|
|
/// <summary>
|
|
/// Defines methods for marshalling and unmarshalling objects to and from a wire format.
|
|
/// </summary>
|
|
/// <typeparam name="TWireContainer"></typeparam>
|
|
public interface IWireMarshaller<TWireContainer>
|
|
{
|
|
/// <summary>
|
|
/// Marshals the specified value of the given type into a wire format container.
|
|
/// </summary>
|
|
/// <param name="value"></param>
|
|
/// <param name="type"></param>
|
|
/// <returns></returns>
|
|
TWireContainer Marshal(object value, Type type);
|
|
|
|
/// <summary>
|
|
/// Marshals the specified value into a wire format container.
|
|
/// </summary>
|
|
/// <typeparam name="TValue"></typeparam>
|
|
/// <param name="value"></param>
|
|
/// <returns></returns>
|
|
TWireContainer Marshal<TValue>(TValue value);
|
|
|
|
/// <summary>
|
|
/// Unmarshals the specified wire format container into an object of the given type.
|
|
/// </summary>
|
|
/// <typeparam name="TValue"></typeparam>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
TValue Marshal<TValue>(TWireContainer data);
|
|
|
|
/// <summary>
|
|
/// Unmarshals the specified wire format container into an object of the specified target type.
|
|
/// </summary>
|
|
/// <param name="targetType"></param>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
object Marshal(Type targetType, TWireContainer data);
|
|
}
|