MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
ExecutionContext.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <typeindex>
4
5namespace MayaFlux::Yantra {
6
7/**
8 * @enum OperationType
9 * @brief Operation categories for organization and discovery
10 */
11enum class OperationType : uint8_t {
13 SORTER,
16 CUSTOM
17};
18
19/**
20 * @enum ExecutionMode
21 * @brief Execution paradigms for operations
22 */
23enum class ExecutionMode : uint8_t {
24 SYNC, ///< Synchronous execution
25 ASYNC, ///< Asynchronous execution
26 PARALLEL, ///< Parallel with other operations
27 CHAINED, ///< Part of a sequential chain
28 DEPENDENCY ///< Part of dependency graph
29};
30
31/**
32 * @brief Callback type for pre/post operation hooks
33 */
34using OpererationHookCallback = std::function<void(std::any&)>;
35
36/**
37 * @brief Callback type for custom reconstruction logic
38 */
39using ReconstructionCallback = std::function<std::any(std::vector<std::vector<double>>&, std::any&)>;
40
41/**
42 * @struct ExecutionContext
43 * @brief Context information for operation execution
44 */
45struct MAYAFLUX_API ExecutionContext {
46 ExecutionMode mode = ExecutionMode::SYNC;
47 std::shared_ptr<std::thread> thread_pool = nullptr;
48 std::vector<std::type_index> dependencies;
49 std::chrono::milliseconds timeout { 0 };
50 std::unordered_map<std::string, std::any> execution_metadata;
51
52 OpererationHookCallback pre_execution_hook = nullptr;
53 OpererationHookCallback post_execution_hook = nullptr;
54 ReconstructionCallback reconstruction_callback = nullptr;
55};
56
57}
@ CUSTOM
User-defined analysis types.
std::function< void(std::any &)> OpererationHookCallback
Callback type for pre/post operation hooks.
OperationType
Operation categories for organization and discovery.
ExecutionMode
Execution paradigms for operations.
@ SYNC
Synchronous execution.
@ CHAINED
Part of a sequential chain.
@ DEPENDENCY
Part of dependency graph.
@ ASYNC
Asynchronous execution.
@ PARALLEL
Parallel with other operations.
std::function< std::any(std::vector< std::vector< double > > &, std::any &)> ReconstructionCallback
Callback type for custom reconstruction logic.
std::vector< std::type_index > dependencies
std::unordered_map< std::string, std::any > execution_metadata
Context information for operation execution.