|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Context information controlling how a compute operation executes. More...
#include <ExecutionContext.hpp>
Collaboration diagram for MayaFlux::Yantra::ExecutionContext:Public Member Functions | |
| bool | contains (const std::string &key) const |
| Check whether a metadata key exists. | |
| template<typename T > | |
| ExecutionContext & | depends_on () |
| Register dependency on a specific operation type. | |
| template<typename T > | |
| CastResult< T > | get (const std::string &key) const |
| Retrieve metadata value using safe casting. | |
| template<typename T > | |
| T | get_or (const std::string &key, const T &default_value) const |
| Retrieve metadata value or return a default. | |
| template<typename T > | |
| T | get_or_throw (const std::string &key) const |
| Retrieve metadata value or throw if unavailable. | |
| ExecutionContext & | on_post (OperationHookCallback cb) |
| Set post-execution hook. | |
| ExecutionContext & | on_pre (OperationHookCallback cb) |
| Set pre-execution hook. | |
| ExecutionContext & | on_reconstruct (ReconstructionCallback cb) |
| Set reconstruction callback. | |
| template<typename T > | |
| ExecutionContext & | set (std::string key, T &&value) |
| Insert or update metadata value. | |
| ExecutionContext & | set_mode (ExecutionMode m) |
| Set execution mode. | |
| ExecutionContext & | with_timeout (std::chrono::milliseconds duration) |
| Set execution timeout. | |
Public Attributes | |
| std::vector< std::type_index > | dependencies |
| Operation dependencies required before execution. | |
| std::unordered_map< std::string, std::any > | execution_metadata |
| Arbitrary metadata parameters used by operations. | |
| ExecutionMode | mode = ExecutionMode::SYNC |
| Execution mode controlling scheduling behavior. | |
| OperationHookCallback | post_execution_hook = nullptr |
| Optional callback invoked after operation execution. | |
| OperationHookCallback | pre_execution_hook = nullptr |
| Optional callback invoked before operation execution. | |
| ReconstructionCallback | reconstruction_callback = nullptr |
| Optional callback used for custom reconstruction of results. | |
| std::shared_ptr< std::thread > | thread_pool = nullptr |
| Optional thread pool for asynchronous or parallel execution. | |
| std::chrono::milliseconds | timeout { 0 } |
| Optional timeout for operation execution. | |
Context information controlling how a compute operation executes.
ExecutionContext provides execution metadata, dependency hints, and hooks that influence how a Yantra operation is scheduled and run.
The execution_metadata map allows arbitrary user-defined parameters to be passed into operations. All reads should be performed using the provided accessors (get, get_or, get_or_throw) which internally use safe_any_cast to provide robust type conversion and diagnostics.
Typical usage:
Definition at line 65 of file ExecutionContext.hpp.