Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System;
using CeresSharp.Native;
using CeresSharp.Native.SafeHandles;
namespace CeresSharp.Advanced;
/// <summary>
/// Context for performance optimization.
/// Allows reuse of expensive objects across multiple solves.
/// </summary>
public sealed class Context : IDisposable
{
private readonly ContextHandle _handle;
private bool _disposed;
/// <summary>
/// Creates a new Context instance.
/// </summary>
public Context()
{
_handle = ContextHandle.Create();
}
/// <summary>
/// Gets the native handle.
/// </summary>
internal ContextHandle Handle => _handle;
public void Dispose()
{
if (!_disposed)
{
_handle?.Dispose();
_disposed = true;
}
}
}