brutal/Brutal.Jolt/Generated/Classes/Semaphore.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

79 lines
2.9 KiB
C#

// <auto-generated/>
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
/// <summary>
/// <para>
/// Implements a semaphore When we switch to C++20 we can use counting_semaphore to unify this
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/Semaphore.h#L31">Jolt/Core/Semaphore.h:31</see>
/// <br/>
/// <c>class Semaphore</c>
/// </para>
/// </summary>
[InteropHandle]
public readonly partial struct Semaphore : IDisposable
{
/// <summary>
/// <para>
/// Constructor
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/Semaphore.h#L35">Jolt/Core/Semaphore.h:35</see>
/// <br/>
/// <c>Semaphore()</c>
/// </para>
/// </summary>
public static Semaphore Create() => Jolt.PInvoke.Semaphore_Create();
/// <summary>
/// <para>
/// Release the semaphore, signaling the thread waiting on the barrier that there may be work
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/Semaphore.h#L39">Jolt/Core/Semaphore.h:39</see>
/// <br/>
/// <c>void Release(uint inNumber = 1)</c>
/// </para>
/// </summary>
public void Release(uint number = 1) => Jolt.PInvoke.Semaphore_Release(this, number);
/// <summary>
/// <para>
/// Acquire the semaphore inNumber times
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/Semaphore.h#L42">Jolt/Core/Semaphore.h:42</see>
/// <br/>
/// <c>void Acquire(uint inNumber = 1)</c>
/// </para>
/// </summary>
public void Acquire(uint number = 1) => Jolt.PInvoke.Semaphore_Acquire(this, number);
/// <summary>
/// <para>
/// Get the current value of the semaphore
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/Semaphore.h#L45">Jolt/Core/Semaphore.h:45</see>
/// <br/>
/// <c>inline int GetValue() const</c>
/// </para>
/// </summary>
public int GetValue() => Jolt.PInvoke.Semaphore_GetValue(this);
public void Dispose() => Jolt.PInvoke.Semaphore_Destroy(this);
}
}