IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
task_scoped_container.hxx
Go to the documentation of this file.
1
3
4#pragma once
6#include <ice/array.hxx>
8
9namespace ice
10{
11
13 {
14 public:
17
20 ice::u32 count,
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
Definition sync_manual_events.hxx:32
auto running_tasks() const noexcept -> ice::u32 override
Returns the number of tasks that are currently running.
auto await_tasks_scheduled_on(ice::TaskScheduler &scheduler, ice::TaskScheduler &resumer) noexcept -> ice::Task<> override
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.
void wait_tasks() noexcept override
Wait for all tasks to complete.
ScopedTaskContainer(ice::Allocator &alloc) noexcept
~ScopedTaskContainer() noexcept
auto execute_tasks() noexcept -> ice::u32 override
Execute all tasks that have been created.
auto extract_tasks() noexcept -> ice::Array< ice::Task<> > override
Definition task.hxx:12
Definition task_scheduler.hxx:13
SPDX-License-Identifier: MIT.
Definition array.hxx:12
auto alloc(ice::usize size) noexcept -> ice::AllocResult
constexpr auto shardid(ice::Shard shard) noexcept -> ice::ShardID
Returns the ice::ShardID value of a shard.
Definition shard.hxx:163
constexpr auto count(T const (&)[Size]) noexcept -> ice::u32
Definition base.hxx:43
std::uint32_t u32
Definition types.hxx:26
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition mem_types.hxx:25
A simple container storing items in continuous memory.
Definition array.hxx:24
Definition shard.hxx:107
A view into an array of objects laid out in contiguous memory.
Definition span.hxx:17
Definition task_container.hxx:14