EnTT 3.13.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
entt::basic_flow< Allocator > Class Template Reference

Utility class for creating task graphs. More...

#include <flow.hpp>

Public Types

using allocator_type = Allocator
 Allocator type.
 
using size_type = std::size_t
 Unsigned integer type.
 
using iterable = iterable_adaptor< typename task_container_type::const_iterator >
 Iterable task list.
 
using graph_type = adjacency_matrix_type
 Adjacency matrix type.
 

Public Member Functions

 basic_flow ()
 Default constructor.
 
 basic_flow (const allocator_type &allocator)
 Constructs a flow builder with a given allocator.
 
 basic_flow (const basic_flow &)=default
 Default copy constructor.
 
 basic_flow (const basic_flow &other, const allocator_type &allocator)
 Allocator-extended copy constructor.
 
 basic_flow (basic_flow &&) noexcept=default
 Default move constructor.
 
 basic_flow (basic_flow &&other, const allocator_type &allocator)
 Allocator-extended move constructor.
 
basic_flowoperator= (const basic_flow &)=default
 Default copy assignment operator.
 
basic_flowoperator= (basic_flow &&) noexcept=default
 Default move assignment operator.
 
constexpr allocator_type get_allocator () const noexcept
 Returns the associated allocator.
 
id_type operator[] (const size_type pos) const
 Returns the identifier at specified location.
 
void clear () noexcept
 Clears the flow builder.
 
void swap (basic_flow &other)
 Exchanges the contents with those of a given flow builder.
 
size_type size () const noexcept
 Returns the number of tasks.
 
basic_flowbind (const id_type value)
 Binds a task to a flow builder.
 
basic_flowsync ()
 Turns the current task into a sync point.
 
basic_flowset (const id_type res, bool is_rw=false)
 Assigns a resource to the current task with a given access mode.
 
basic_flowro (const id_type res)
 Assigns a read-only resource to the current task.
 
template<typename It >
std::enable_if_t< std::is_same_v< std::remove_const_t< typename std::iterator_traits< It >::value_type >, id_type >, basic_flow & > ro (It first, It last)
 Assigns a range of read-only resources to the current task.
 
basic_flowrw (const id_type res)
 Assigns a writable resource to the current task.
 
template<typename It >
std::enable_if_t< std::is_same_v< std::remove_const_t< typename std::iterator_traits< It >::value_type >, id_type >, basic_flow & > rw (It first, It last)
 Assigns a range of writable resources to the current task.
 
graph_type graph () const
 Generates a task graph for the current content.
 

Detailed Description

template<typename Allocator>
class entt::basic_flow< Allocator >

Utility class for creating task graphs.

Template Parameters
AllocatorType of allocator used to manage memory and elements.

Definition at line 29 of file flow.hpp.

Member Typedef Documentation

◆ allocator_type

template<typename Allocator >
using entt::basic_flow< Allocator >::allocator_type = Allocator

Allocator type.

Definition at line 119 of file flow.hpp.

◆ graph_type

template<typename Allocator >
using entt::basic_flow< Allocator >::graph_type = adjacency_matrix_type

Adjacency matrix type.

Definition at line 125 of file flow.hpp.

◆ iterable

template<typename Allocator >
using entt::basic_flow< Allocator >::iterable = iterable_adaptor<typename task_container_type::const_iterator>

Iterable task list.

Definition at line 123 of file flow.hpp.

◆ size_type

template<typename Allocator >
using entt::basic_flow< Allocator >::size_type = std::size_t

Unsigned integer type.

Definition at line 121 of file flow.hpp.

Constructor & Destructor Documentation

◆ basic_flow() [1/4]

template<typename Allocator >
entt::basic_flow< Allocator >::basic_flow ( )
inline

Default constructor.

Definition at line 128 of file flow.hpp.

◆ basic_flow() [2/4]

template<typename Allocator >
entt::basic_flow< Allocator >::basic_flow ( const allocator_type allocator)
inlineexplicit

Constructs a flow builder with a given allocator.

Parameters
allocatorThe allocator to use.

Definition at line 135 of file flow.hpp.

◆ basic_flow() [3/4]

template<typename Allocator >
entt::basic_flow< Allocator >::basic_flow ( const basic_flow< Allocator > &  other,
const allocator_type allocator 
)
inline

Allocator-extended copy constructor.

Parameters
otherThe instance to copy from.
allocatorThe allocator to use.

Definition at line 149 of file flow.hpp.

◆ basic_flow() [4/4]

template<typename Allocator >
entt::basic_flow< Allocator >::basic_flow ( basic_flow< Allocator > &&  other,
const allocator_type allocator 
)
inline

Allocator-extended move constructor.

Parameters
otherThe instance to move from.
allocatorThe allocator to use.

Definition at line 163 of file flow.hpp.

Member Function Documentation

◆ bind()

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::bind ( const id_type  value)
inline

Binds a task to a flow builder.

Parameters
valueTask identifier.
Returns
This flow builder.

Definition at line 231 of file flow.hpp.

◆ clear()

template<typename Allocator >
void entt::basic_flow< Allocator >::clear ( )
inlinenoexcept

Clears the flow builder.

Definition at line 199 of file flow.hpp.

◆ get_allocator()

template<typename Allocator >
constexpr allocator_type entt::basic_flow< Allocator >::get_allocator ( ) const
inlineconstexprnoexcept

Returns the associated allocator.

Returns
The associated allocator.

Definition at line 185 of file flow.hpp.

◆ graph()

template<typename Allocator >
graph_type entt::basic_flow< Allocator >::graph ( ) const
inline

Generates a task graph for the current content.

Returns
The adjacency matrix of the task graph.

Definition at line 322 of file flow.hpp.

◆ operator=() [1/2]

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::operator= ( basic_flow< Allocator > &&  )
defaultnoexcept

Default move assignment operator.

Returns
This flow builder.

◆ operator=() [2/2]

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::operator= ( const basic_flow< Allocator > &  )
default

Default copy assignment operator.

Returns
This flow builder.

◆ operator[]()

template<typename Allocator >
id_type entt::basic_flow< Allocator >::operator[] ( const size_type  pos) const
inline

Returns the identifier at specified location.

Parameters
posPosition of the identifier to return.
Returns
The requested identifier.

Definition at line 194 of file flow.hpp.

◆ ro() [1/2]

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::ro ( const id_type  res)
inline

Assigns a read-only resource to the current task.

Parameters
resResource identifier.
Returns
This flow builder.

Definition at line 269 of file flow.hpp.

◆ ro() [2/2]

template<typename Allocator >
template<typename It >
std::enable_if_t< std::is_same_v< std::remove_const_t< typename std::iterator_traits< It >::value_type >, id_type >, basic_flow & > entt::basic_flow< Allocator >::ro ( It  first,
It  last 
)
inline

Assigns a range of read-only resources to the current task.

Template Parameters
ItType of input iterator.
Parameters
firstAn iterator to the first element of the range of elements.
lastAn iterator past the last element of the range of elements.
Returns
This flow builder.

Definition at line 283 of file flow.hpp.

◆ rw() [1/2]

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::rw ( const id_type  res)
inline

Assigns a writable resource to the current task.

Parameters
resResource identifier.
Returns
This flow builder.

Definition at line 296 of file flow.hpp.

◆ rw() [2/2]

template<typename Allocator >
template<typename It >
std::enable_if_t< std::is_same_v< std::remove_const_t< typename std::iterator_traits< It >::value_type >, id_type >, basic_flow & > entt::basic_flow< Allocator >::rw ( It  first,
It  last 
)
inline

Assigns a range of writable resources to the current task.

Template Parameters
ItType of input iterator.
Parameters
firstAn iterator to the first element of the range of elements.
lastAn iterator past the last element of the range of elements.
Returns
This flow builder.

Definition at line 310 of file flow.hpp.

◆ set()

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::set ( const id_type  res,
bool  is_rw = false 
)
inline

Assigns a resource to the current task with a given access mode.

Parameters
resResource identifier.
is_rwAccess mode.
Returns
This flow builder.

Definition at line 259 of file flow.hpp.

◆ size()

template<typename Allocator >
size_type entt::basic_flow< Allocator >::size ( ) const
inlinenoexcept

Returns the number of tasks.

Returns
The number of tasks.

Definition at line 222 of file flow.hpp.

◆ swap()

template<typename Allocator >
void entt::basic_flow< Allocator >::swap ( basic_flow< Allocator > &  other)
inline

Exchanges the contents with those of a given flow builder.

Parameters
otherFlow builder to exchange the content with.

Definition at line 210 of file flow.hpp.

◆ sync()

template<typename Allocator >
basic_flow & entt::basic_flow< Allocator >::sync ( )
inline

Turns the current task into a sync point.

Returns
This flow builder.

Definition at line 242 of file flow.hpp.


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