IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
tasks
public
ice
task_scoped_container.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/task_container.hxx
>
6
#include <
ice/array.hxx
>
7
#include <
ice/sync_manual_events.hxx
>
8
9
namespace
ice
10
{
11
12
class
ScopedTaskContainer
:
public
TaskContainer
13
{
14
public
:
15
ScopedTaskContainer
(
ice::Allocator
&
alloc
)
noexcept
;
16
~ScopedTaskContainer
() noexcept;
17
19
auto
create_tasks
(
20
ice
::
u32
count
,
21
ice
::
ShardID
shardid
22
) noexcept ->
ice
::
Span
<
ice
::
Task
<>> override;
23
24
auto
await_tasks_scheduled_on
(
ice
::
TaskScheduler
& scheduler,
ice
::
TaskScheduler
& resumer) noexcept ->
ice
::
Task
<> override;
25
27
auto
execute_tasks
() noexcept ->
ice
::
u32
override;
28
30
auto
running_tasks
() const noexcept ->
ice
::
u32
override;
31
33
void
wait_tasks
() noexcept override;
34
35
auto
extract_tasks
() noexcept ->
ice
::
Array
<
ice
::
Task
<>> override;
36
37
private:
38
ice
::
Allocator
& _allocator;
39
ice
::
Array
<
ice
::
Task
<>> _tasks;
40
ice
::
ManualResetBarrier
_barrier;
41
};
42
43
}
// namespace ice
ice::ManualResetBarrier
Definition
sync_manual_events.hxx:32
ice::ScopedTaskContainer::running_tasks
auto running_tasks() const noexcept -> ice::u32 override
Returns the number of tasks that are currently running.
ice::ScopedTaskContainer::await_tasks_scheduled_on
auto await_tasks_scheduled_on(ice::TaskScheduler &scheduler, ice::TaskScheduler &resumer) noexcept -> ice::Task<> override
ice::ScopedTaskContainer::create_tasks
auto create_tasks(ice::u32 count, ice::ShardID shardid) noexcept -> ice::Span< ice::Task<> > override
Create a new set of tasks and return the slice containing them.
ice::ScopedTaskContainer::wait_tasks
void wait_tasks() noexcept override
Wait for all tasks to complete.
ice::ScopedTaskContainer::ScopedTaskContainer
ScopedTaskContainer(ice::Allocator &alloc) noexcept
ice::ScopedTaskContainer::~ScopedTaskContainer
~ScopedTaskContainer() noexcept
ice::ScopedTaskContainer::execute_tasks
auto execute_tasks() noexcept -> ice::u32 override
Execute all tasks that have been created.
ice::ScopedTaskContainer::extract_tasks
auto extract_tasks() noexcept -> ice::Array< ice::Task<> > override
ice::Task
Definition
task.hxx:12
ice::TaskScheduler
Definition
task_scheduler.hxx:13
array.hxx
ice
SPDX-License-Identifier: MIT.
Definition
array.hxx:12
ice::alloc
auto alloc(ice::usize size) noexcept -> ice::AllocResult
ice::shardid
constexpr auto shardid(ice::Shard shard) noexcept -> ice::ShardID
Returns the ice::ShardID value of a shard.
Definition
shard.hxx:163
ice::count
constexpr auto count(T const (&)[Size]) noexcept -> ice::u32
Definition
base.hxx:43
ice::u32
std::uint32_t u32
Definition
types.hxx:26
ice::Allocator
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition
mem_types.hxx:25
ice::Array
A simple container storing items in continuous memory.
Definition
array.hxx:24
ice::ShardID
Definition
shard.hxx:107
ice::Span
A view into an array of objects laid out in contiguous memory.
Definition
span.hxx:17
ice::TaskContainer
Definition
task_container.hxx:14
sync_manual_events.hxx
task_container.hxx
Generated by
1.18.0