Clementine
|
Utility class for creating a static task graph. More...
#include <entt.hpp>
Classes | |
struct | vertex |
Vertex type of a task graph defined as an adjacency list. More... | |
Public Types | |
using | entity_type = Entity |
Underlying entity identifier. | |
using | size_type = std::size_t |
Unsigned integer type. | |
using | function_type = callback_type |
Raw task function type. | |
Public Member Functions | |
template<auto Candidate, typename... Req> | |
void | emplace (const char *name=nullptr) |
Adds a free function to the task list. More... | |
template<auto Candidate, typename... Req, typename Type > | |
void | emplace (Type &value_or_instance, const char *name=nullptr) |
Adds a free function with payload or a member function with an instance to the task list. More... | |
template<typename... Req> | |
void | emplace (function_type *func, const void *payload=nullptr, const char *name=nullptr) |
Adds an user defined function with optional payload to the task list. More... | |
std::vector< vertex > | graph () |
Generates a task graph for the current content. More... | |
void | clear () |
Erases all elements from a container. | |
Utility class for creating a static task graph.
This class offers minimal support (but sufficient in many cases) for creating an execution graph from functions and their requirements on resources.
Note that the resulting tasks aren't executed in any case. This isn't the goal of the tool. Instead, they are returned to the user in the form of a graph that allows for safe execution.
Entity | A valid entity type (see entt_traits for more details). |
|
inline |
Adds a free function to the task list.
Candidate | Function to add to the task list. |
Req | Additional requirements and/or override resource access mode. |
name | Optional name to associate with the task. |
|
inline |
Adds a free function with payload or a member function with an instance to the task list.
Candidate | Function or member to add to the task list. |
Req | Additional requirements and/or override resource access mode. |
Type | Type of class or type of payload. |
value_or_instance | A valid object that fits the purpose. |
name | Optional name to associate with the task. |
|
inline |
Adds an user defined function with optional payload to the task list.
Req | Additional requirements and/or override resource access mode. |
func | Function to add to the task list. |
payload | User defined arbitrary data. |
name | Optional name to associate with the task. |
|
inline |
Generates a task graph for the current content.