✨ feat(native-planning): 添加 Rust ICSP 原生规划核心及 C# 互操作集成
* 新增 Rust 原生 ICSP 规划库 (Cargo 项目, CubicSpline 算法, FFI 接口) * 新增 Flyshot.Native.Planning C# 互操作项目 (P/Invoke 封装) * 更新 ControllerClientCompat 适配新的规划接口 * 添加构建脚本 (Copy-NativePlanningArtifacts.ps1) * 新增互操作测试及一致性对比测试 * 更新解决方案文件和设计文档
This commit is contained in:
24
src/Flyshot.Native.Planning/NativePlanningException.cs
Normal file
24
src/Flyshot.Native.Planning/NativePlanningException.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Flyshot.Native.Planning;
|
||||
|
||||
/// <summary>
|
||||
/// 表示原生规划库加载、调用或数值计算失败。
|
||||
/// </summary>
|
||||
public sealed class NativePlanningException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化包含原生错误码和底层异常的规划异常。
|
||||
/// </summary>
|
||||
/// <param name="message">供调用方诊断的错误说明。</param>
|
||||
/// <param name="errorCode">Rust C ABI 返回的错误码;托管加载错误使用负数。</param>
|
||||
/// <param name="innerException">触发本异常的底层异常;没有时为 <see langword="null"/>。</param>
|
||||
public NativePlanningException(string message, int errorCode, Exception? innerException = null)
|
||||
: base(message, innerException)
|
||||
{
|
||||
ErrorCodeValue = errorCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取 Rust C ABI 错误码或托管互操作错误码。
|
||||
/// </summary>
|
||||
public int ErrorCodeValue { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user