Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
helios::async Namespace Reference

Namespaces

namespace  details
 

Classes

class  AsyncTask
 Handle to an asynchronous task managed by the Executor. More...
 
class  Executor
 Manages worker threads and executes task graphs using work-stealing scheduling. More...
 
class  Future
 Wrapper around tf::Future for handling asynchronous task results. More...
 
class  SubTaskGraph
 Dynamic task graph that can be created within the execution of a task. More...
 
class  Task
 Represents a single task within a task graph. More...
 
class  TaskGraph
 Represents a task dependency graph that can be executed by an Executor. More...
 

Concepts

concept  StaticTask
 Concept for static task callables.
 
concept  SubTask
 Concept for sub-task callables that receive a SubTaskGraph reference.
 
concept  AnyTask
 Concept for any valid task callable.
 

Typedefs

template<typename T = void>
using AsyncResult = std::expected< T, AsyncError >
 Result type for async operations.
 

Enumerations

enum class  TaskType : uint8_t { Undefined , Static , SubTask , Async }
 Types of tasks in the async system. More...
 
enum class  AsyncError : uint8_t {
  InvalidTask , ExecutorShutdown , TaskNotFound , InvalidDependency ,
  CircularDependency , SchedulingFailed , ThreadNotAvailable
}
 Error codes for async operations. More...
 

Functions

constexpr std::string_view ToString (AsyncError error) noexcept
 Converts AsyncError to string representation.
 

Typedef Documentation

◆ AsyncResult

template<typename T = void>
using helios::async::AsyncResult = typedef std::expected<T, AsyncError>

Result type for async operations.

Definition at line 68 of file common.hpp.

Enumeration Type Documentation

◆ AsyncError

enum class helios::async::AsyncError : uint8_t
strong

Error codes for async operations.

Enumerator
InvalidTask 

Task handle is invalid or empty.

ExecutorShutdown 

Executor has been shut down.

TaskNotFound 

Specified task could not be found.

InvalidDependency 

Dependency relationship is invalid.

CircularDependency 

Circular dependency detected in task graph.

SchedulingFailed 

Task could not be scheduled for execution.

ThreadNotAvailable 

No worker thread available for execution.

Definition at line 30 of file common.hpp.

30 : uint8_t {
31 InvalidTask, ///< Task handle is invalid or empty
32 ExecutorShutdown, ///< Executor has been shut down
33 TaskNotFound, ///< Specified task could not be found
34 InvalidDependency, ///< Dependency relationship is invalid
35 CircularDependency, ///< Circular dependency detected in task graph
36 SchedulingFailed, ///< Task could not be scheduled for execution
37 ThreadNotAvailable ///< No worker thread available for execution
38};
@ ThreadNotAvailable
No worker thread available for execution.
@ SchedulingFailed
Task could not be scheduled for execution.
@ CircularDependency
Circular dependency detected in task graph.
@ TaskNotFound
Specified task could not be found.
@ ExecutorShutdown
Executor has been shut down.
@ InvalidDependency
Dependency relationship is invalid.
@ InvalidTask
Task handle is invalid or empty.

◆ TaskType

enum class helios::async::TaskType : uint8_t
strong

Types of tasks in the async system.

Enumerator
Undefined 
Static 

Static task with fixed callable.

SubTask 

Dynamic task that can spawn subtasks.

Async 

Asynchronous task executed independently.

Definition at line 20 of file common.hpp.

20 : uint8_t {
22 Static, ///< Static task with fixed callable
23 SubTask, ///< Dynamic task that can spawn subtasks
24 Async ///< Asynchronous task executed independently
25};
Concept for sub-task callables that receive a SubTaskGraph reference.
Definition common.hpp:80
@ Async
Asynchronous task executed independently.
@ Static
Static task with fixed callable.

Function Documentation

◆ ToString()

constexpr std::string_view helios::async::ToString ( AsyncError  error)
constexprnoexcept

Converts AsyncError to string representation.

Definition at line 43 of file common.hpp.

43 {
44 switch (error) {
45 case AsyncError::InvalidTask:
46 return "Invalid task";
47 case AsyncError::ExecutorShutdown:
48 return "Executor is shutdown";
49 case AsyncError::TaskNotFound:
50 return "Task not found";
51 case AsyncError::InvalidDependency:
52 return "Invalid dependency";
53 case AsyncError::CircularDependency:
54 return "Circular dependency detected";
55 case AsyncError::SchedulingFailed:
56 return "Task scheduling failed";
57 case AsyncError::ThreadNotAvailable:
58 return "Thread not available";
59 default:
60 return "Unknown async error";
61 }
62}