MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Yantra::OperationRegistry Class Reference

Manages operation type registration, discovery, and factory creation. More...

#include <ComputeRegistry.hpp>

+ Collaboration diagram for MayaFlux::Yantra::OperationRegistry:

Classes

struct  has_operation_category
 
struct  has_operation_category< T, std::void_t< decltype(T::operation_category)> >
 
struct  has_operation_traits
 
struct  has_operation_traits< T, std::void_t< decltype(T::operation_category), typename T::input_type, typename T::output_type > >
 
struct  TypeKey
 
struct  TypeKeyHash
 

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< OperationTypeget_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, TypeKeyHashm_factories
 
std::unordered_map< TypeKey, std::pair< std::type_index, std::type_index >, TypeKeyHashm_type_info
 

Detailed Description

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:

  • Type-safe registration with automatic trait detection
  • Factory-based operation creation
  • Discovery mechanisms for finding compatible operations
  • Integration points with the broader API/Proxy/Creator system

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.


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