|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Manages operation type registration, discovery, and factory creation. More...
#include <ComputeRegistry.hpp>
Collaboration diagram for MayaFlux::Yantra::OperationRegistry:Public Types | |
| using | Factory = std::function< std::any()> |
Public Member Functions | |
| template<typename OpClass > | |
| void | register_operation () |
| Register an operation using its intrinsic traits. | |
| template<typename OpClass > | |
| void | register_operation (OperationType category) |
| Register with explicit category (for operations without traits) | |
| template<typename OpClass > | |
| void | register_operation_with_factory (OperationType category, std::function< std::shared_ptr< OpClass >()> factory) |
| Register with custom factory function. | |
| template<typename OpClass > | |
| std::shared_ptr< OpClass > | create () |
| Create an operation instance. | |
| template<typename OpClass > | |
| bool | is_registered () const |
| Check if an operation type is registered. | |
| std::vector< std::type_index > | discover_operations (OperationType category, std::type_index input_type, std::type_index output_type) const |
| Discover operations matching specific criteria. | |
| std::vector< std::type_index > | get_operations_by_category (OperationType category) const |
| Get all registered operations of a specific category. | |
| template<typename OpClass > | |
| std::optional< OperationType > | get_category () const |
| Get category for a registered operation type. | |
| void | clear () |
| Clear all registrations. | |
| size_t | size () const |
| Get total number of registered operations. | |
Private Attributes | |
| std::unordered_map< TypeKey, Factory, TypeKeyHash > | m_factories |
| std::unordered_map< TypeKey, std::pair< std::type_index, std::type_index >, TypeKeyHash > | m_type_info |
Manages operation type registration, discovery, and factory creation.
The OperationRegistry acts as a centralized repository for all operation types in the Yantra compute system. It provides:
This registry follows a similar pattern to the channel/domain/shared_ptr model but focuses on operation types rather than runtime instances.
Definition at line 40 of file ComputeRegistry.hpp.