MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ register_operation_with_factory()

template<typename OpClass >
void MayaFlux::Yantra::OperationRegistry::register_operation_with_factory ( OperationType  category,
std::function< std::shared_ptr< OpClass >()>  factory 
)
inline

Register with custom factory function.

Template Parameters
OpClassOperation class to register
Parameters
categoryOperation category
factoryCustom factory function

Definition at line 88 of file ComputeRegistry.hpp.

90 {
91 TypeKey key {
92 .category = category,
93 .operation_type = std::type_index(typeid(OpClass))
94 };
95
96 m_factories[key] = [factory]() -> std::any {
97 return std::static_pointer_cast<void>(factory());
98 };
99
100 m_type_info[key] = {
101 std::type_index(typeid(typename OpClass::input_type)),
102 std::type_index(typeid(typename OpClass::output_type))
103 };
104 }
std::unordered_map< TypeKey, Factory, TypeKeyHash > m_factories
std::unordered_map< TypeKey, std::pair< std::type_index, std::type_index >, TypeKeyHash > m_type_info

References MayaFlux::Yantra::OperationRegistry::TypeKey::category, m_factories, and m_type_info.