GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::execution::Schedule< EntReg, ResReg > Class Template Reference

Statically scheduled task graph built by a Scheduler. More...

#include <GREM/execution/Schedule.hpp>

Classes

struct  TaskContext
 Task context that the scheduled tasks expect to receive a pointer to through their void* context parameter. More...

Public Member Functions

 Schedule () noexcept=default
 Construct an empty schedule with an empty name.
 Schedule (ArrayList< Task > tasks, Task::SharedMemorySize requiredSharedMemorySize, String name)
 Construct a schedule.
Span< const Task > getTasks () const noexcept
 Get the list of scheduled tasks.
Task::SharedMemorySize getRequiredSharedMemorySize () const noexcept
 Get the total amount of contiguous shared memory required by the byte* sharedMemory parameter of Task::execute().
CStringView getName () const noexcept
 Get the human-readable name of the schedule.
String formatDOTGraph () const
 Build a string representation of the directed acyclic graph formed by the schedule's tasks, and the dependencies between them, in Graphviz DOT format.

Detailed Description

template<typename EntReg, typename ResReg>
class grem::execution::Schedule< EntReg, ResReg >

Statically scheduled task graph built by a Scheduler.

Template Parameters
EntRegconcrete entity registry type used by the scheduled tasks, e.g. some specialization of EntityRegistry or EntityTable.
ResRegconcrete resource registry type used by the scheduled tasks, e.g. some specialization of ResourceRegistry or ResourceTable.
See also
Scheduler

Constructor & Destructor Documentation

◆ Schedule() [1/2]

template<typename EntReg, typename ResReg>
grem::execution::Schedule< EntReg, ResReg >::Schedule ( )
defaultnoexcept

Construct an empty schedule with an empty name.

See also
Scheduler

◆ Schedule() [2/2]

template<typename EntReg, typename ResReg>
grem::execution::Schedule< EntReg, ResReg >::Schedule ( ArrayList< Task > tasks,
Task::SharedMemorySize requiredSharedMemorySize,
String name )
inline

Construct a schedule.

Parameters
taskstopologically ordered list of scheduled tasks. The tasks must not depend on the results of tasks that appear later in the list. Dependencies between tasks must be specified through Task::getDependencyIndices(), all of which must be less than the index of the dependent task. Each task function must not access its byte* taskSharedMemory parameter outside of the offset interval [0, requiredSharedMemorySize - task.getSharedMemoryOffset()).
requiredSharedMemorySizetotal amount of contiguous shared memory required by the byte* sharedMemory parameter of Task::execute(). Must be greater than or equal to task.getSharedMemoryOffset() for all tasks.
nameUTF-8-encoded human-readable name of the schedule, or an empty string for an unnamed schedule.
See also
Scheduler

Member Function Documentation

◆ getTasks()

template<typename EntReg, typename ResReg>
Span< const Task > grem::execution::Schedule< EntReg, ResReg >::getTasks ( ) const
inlinenodiscardnoexcept

Get the list of scheduled tasks.

Returns
a topologically ordered view over the tasks defined by the schedule.

◆ getRequiredSharedMemorySize()

template<typename EntReg, typename ResReg>
Task::SharedMemorySize grem::execution::Schedule< EntReg, ResReg >::getRequiredSharedMemorySize ( ) const
inlinenodiscardnoexcept

Get the total amount of contiguous shared memory required by the byte* sharedMemory parameter of Task::execute().

Returns
the required shared memory size, in bytes.

◆ getName()

template<typename EntReg, typename ResReg>
CStringView grem::execution::Schedule< EntReg, ResReg >::getName ( ) const
inlinenodiscardnoexcept

Get the human-readable name of the schedule.

Returns
a UTF-8-encoded string containing the human-readable name of the schedule, or an empty string if the schedule is unnamed.

◆ formatDOTGraph()

template<typename EntReg, typename ResReg>
String grem::execution::Schedule< EntReg, ResReg >::formatDOTGraph ( ) const
inlinenodiscard

Build a string representation of the directed acyclic graph formed by the schedule's tasks, and the dependencies between them, in Graphviz DOT format.

Returns
a string in the DOT graph description language that can, for example, be saved to a file schedule.gv and visualized using the Graphviz command dot -Tpng -oschedule.png schedule.gv.

The documentation for this class was generated from the following file: