EnTT 3.14.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
entt::basic_organizer< Registry > Class Template Reference

Utility class for creating a static task graph. More...

#include <organizer.hpp>

Classes

struct  vertex
 Vertex type of a task graph defined as an adjacency list. More...
 

Public Types

using registry_type = Registry
 
using entity_type = typename registry_type::entity_type
 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.
 
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.
 
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.
 
std::vector< vertexgraph ()
 Generates a task graph for the current content.
 
void clear ()
 Erases all elements from a container.
 

Detailed Description

template<typename Registry>
class entt::basic_organizer< Registry >

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.

Template Parameters
RegistryBasic registry type.

Definition at line 100 of file organizer.hpp.

Member Typedef Documentation

◆ entity_type

template<typename Registry >
using entt::basic_organizer< Registry >::entity_type = typename registry_type::entity_type

Underlying entity identifier.

Definition at line 162 of file organizer.hpp.

◆ function_type

template<typename Registry >
using entt::basic_organizer< Registry >::function_type = callback_type

Raw task function type.

Definition at line 166 of file organizer.hpp.

◆ registry_type

Basic registry type.

Definition at line 160 of file organizer.hpp.

◆ size_type

template<typename Registry >
using entt::basic_organizer< Registry >::size_type = std::size_t

Unsigned integer type.

Definition at line 164 of file organizer.hpp.

Member Function Documentation

◆ clear()

template<typename Registry >
void entt::basic_organizer< Registry >::clear ( )
inline

Erases all elements from a container.

Definition at line 414 of file organizer.hpp.

◆ emplace() [1/3]

template<typename Registry >
template<auto Candidate, typename... Req>
void entt::basic_organizer< Registry >::emplace ( const char * name = nullptr)
inline

Adds a free function to the task list.

Template Parameters
CandidateFunction to add to the task list.
ReqAdditional requirements and/or override resource access mode.
Parameters
nameOptional name to associate with the task.

Definition at line 305 of file organizer.hpp.

◆ emplace() [2/3]

template<typename Registry >
template<typename... Req>
void entt::basic_organizer< Registry >::emplace ( function_type * func,
const void * payload = nullptr,
const char * name = nullptr )
inline

Adds an user defined function with optional payload to the task list.

Template Parameters
ReqAdditional requirements and/or override resource access mode.
Parameters
funcFunction to add to the task list.
payloadUser defined arbitrary data.
nameOptional name to associate with the task.

Definition at line 369 of file organizer.hpp.

◆ emplace() [3/3]

template<typename Registry >
template<auto Candidate, typename... Req, typename Type >
void entt::basic_organizer< Registry >::emplace ( Type & value_or_instance,
const char * name = nullptr )
inline

Adds a free function with payload or a member function with an instance to the task list.

Template Parameters
CandidateFunction or member to add to the task list.
ReqAdditional requirements and/or override resource access mode.
TypeType of class or type of payload.
Parameters
value_or_instanceA valid object that fits the purpose.
nameOptional name to associate with the task.

Definition at line 337 of file organizer.hpp.

◆ graph()

template<typename Registry >
std::vector< vertex > entt::basic_organizer< Registry >::graph ( )
inline

Generates a task graph for the current content.

Returns
The adjacency list of the task graph.

Definition at line 390 of file organizer.hpp.


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