// // Generated by Brutal.Jolt.Generate; do not edit by hand. #nullable enable using Brutal.Interop; using Brutal.Numerics; namespace Brutal.JoltApi { /// /// /// C++: /// Jolt/Core/JobSystemThreadPool.h:25 ///
/// class JobSystemThreadPool final : public JobSystemWithBarrier ///
///
/// /// /// Implementation of a JobSystem using a thread pool /// /// Note that this is considered an example implementation. It is expected that when you integrate /// the physics engine into your own project that you'll provide your own implementation of the /// JobSystem built on top of whatever job system your project uses. /// /// [InteropHandle] public readonly partial struct JobSystemThreadPool : IDisposable { /// /// /// C++: /// Jolt/Core/JobSystemThreadPool.h:32 ///
/// JobSystemThreadPool(uint inMaxJobs, uint inMaxBarriers, int inNumThreads = -1) ///
///
/// /// /// Creates a thread pool. /// @see JobSystemThreadPool::Init /// /// public static JobSystemThreadPool Create(uint maxJobs, uint maxBarriers, int numThreads) => Jolt.PInvoke.JobSystemThreadPool_Create(maxJobs, maxBarriers, numThreads); /// /// /// C++: /// Jolt/Core/JobSystemThreadPool.h:33 ///
/// JobSystemThreadPool() = default ///
///
public static JobSystemThreadPool Create() => Jolt.PInvoke.JobSystemThreadPool_Create_2(); /// /// /// C++: /// Jolt/Core/JobSystemThreadPool.h:45 ///
/// void Init(uint inMaxJobs, uint inMaxBarriers, int inNumThreads = -1) ///
///
/// /// /// Initialize the thread pool /// @param inMaxJobs Max number of jobs that can be allocated at any time /// @param inMaxBarriers Max number of barriers that can be allocated at any time /// @param inNumThreads Number of threads to start (the number of concurrent jobs is 1 more because the main thread will also run jobs while waiting for a barrier to complete). Use -1 to auto detect the amount of CPU's. /// /// public void Init(uint maxJobs, uint maxBarriers, int numThreads) => Jolt.PInvoke.JobSystemThreadPool_Init(this, maxJobs, maxBarriers, numThreads); /// /// /// C++: /// Jolt/Core/JobSystemThreadPool.h:48 ///
/// virtual int GetMaxConcurrency() const override ///
///
/// /// /// See JobSystem /// /// public int GetMaxConcurrency() => Jolt.PInvoke.JobSystemThreadPool_GetMaxConcurrency(this); /// /// /// C++: /// Jolt/Core/JobSystemThreadPool.h:52 ///
/// void SetNumThreads(int inNumThreads) ///
///
/// /// /// Change the max concurrency after initialization /// /// public void SetNumThreads(int numThreads) => Jolt.PInvoke.JobSystemThreadPool_SetNumThreads(this, numThreads); public static implicit operator JobSystemWithBarrier(JobSystemThreadPool value) => Jolt.PInvoke.JobSystemThreadPool_AsJobSystemWithBarrier(value); public static implicit operator JobSystem(JobSystemThreadPool value) => Jolt.PInvoke.JobSystemThreadPool_AsJobSystem(value); public void Dispose() => Jolt.PInvoke.JobSystemThreadPool_Destroy(this); } }