LeviLamina
Loading...
Searching...
No Matches
WorkerPool.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/container/MovePriorityQueue.h"
7#include "mc/deps/core/threading/BackgroundTaskBase.h"
8#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
9#include "mc/platform/brstd/flat_set.h"
10
11// auto generated forward declare list
12// clang-format off
14class Scheduler;
15namespace Bedrock::Threading { class Mutex; }
16namespace Bedrock::Threading { class OSThreadPriority; }
17// clang-format on
18
20public:
21 // member variables
22 // NOLINTBEGIN
36 // NOLINTEND
37
38public:
39 // prevent constructor by default
40 WorkerPool& operator=(WorkerPool const&);
41 WorkerPool(WorkerPool const&);
42 WorkerPool();
43
44public:
45 // virtual functions
46 // NOLINTBEGIN
47 // vIndex: 0
48 virtual ~WorkerPool() /*override*/;
49 // NOLINTEND
50
51public:
52 // member functions
53 // NOLINTBEGIN
54 MCNAPI WorkerPool(::std::string name, ::Scheduler& owner);
55
56 MCNAPI WorkerPool(
57 ::std::string name,
58 uint64 threadCount,
60 ::std::optional<uint64> coreAffinityMask,
61 bool suppressWorkerProfiling,
62 ::std::optional<int> idealCore
63 );
64
65 MCNAPI bool _checkPendingWork();
66
67 MCNAPI void queue(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate);
68
69 MCNAPI ::std::shared_ptr<::BackgroundTaskBase> tryPop(int minPriority);
70 // NOLINTEND
71
72public:
73 // static functions
74 // NOLINTBEGIN
75 MCNAPI static void _registerPool(::WorkerPool& pool);
76 // NOLINTEND
77
78public:
79 // static variables
80 // NOLINTBEGIN
81 MCNAPI static ::brstd::flat_set<::WorkerPool*, ::std::less<::WorkerPool*>, ::std::vector<::WorkerPool*>>&
83
84 MCNAPI static ::Bedrock::Threading::Mutex& sAllPoolsMutex();
85 // NOLINTEND
86
87public:
88 // constructor thunks
89 // NOLINTBEGIN
90 MCNAPI void* $ctor(::std::string name, ::Scheduler& owner);
91
92 MCNAPI void* $ctor(
93 ::std::string name,
94 uint64 threadCount,
96 ::std::optional<uint64> coreAffinityMask,
97 bool suppressWorkerProfiling,
98 ::std::optional<int> idealCore
99 );
100 // NOLINTEND
101
102public:
103 // destructor thunk
104 // NOLINTBEGIN
105 MCNAPI void $dtor();
106 // NOLINTEND
107
108public:
109 // vftables
110 // NOLINTBEGIN
111 MCNAPI static void** $vftable();
112 // NOLINTEND
113};
Definition BackgroundTaskBase.h:15
Definition EnableNonOwnerReferences.h:7
Definition OSThreadPriority.h:7
Definition Scheduler.h:13
Definition WorkerPool.h:19
MCAPI void queue(::std::shared_ptr<::BackgroundTaskBase > task, bool queueImmediate)
MCAPI WorkerPool(::std::string name, ::Scheduler &owner)
static MCAPI void ** $vftable()
MCAPI ::std::shared_ptr<::BackgroundTaskBase > tryPop(int minPriority)
MCAPI void * $ctor(::std::string name, uint64 threadCount, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > coreAffinityMask, bool suppressWorkerProfiling, ::std::optional< int > idealCore)
MCAPI WorkerPool(::std::string name, uint64 threadCount, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > coreAffinityMask, bool suppressWorkerProfiling, ::std::optional< int > idealCore)
static MCAPI ::Bedrock::Threading::Mutex & sAllPoolsMutex()
MCAPI void * $ctor(::std::string name, ::Scheduler &owner)
static MCAPI ::brstd::flat_set<::WorkerPool *, ::std::less<::WorkerPool * >, ::std::vector<::WorkerPool * > > & sAllPools()
MCAPI void $dtor()
static MCAPI void _registerPool(::WorkerPool &pool)
MCAPI bool _checkPendingWork()
Definition Alias.h:14