Loading...
Searching...
No Matches
score::MatchingFactory< T > Class Template Reference
Utility class for making a factory interface list. More...
Inheritance diagram for score::MatchingFactory< T >:

Detailed Description
template<typename T>
class score::MatchingFactory< T >
class score::MatchingFactory< T >
Utility class for making a factory interface list.
Public Member Functions | |
template<typename Fun , typename... Args> requires std::is_invocable_v< Fun, typename score::InterfaceList<T>::factory_type&, Args...> | |
auto | make (Fun f, Args &&... args) const noexcept |
Apply a function on the correct factory according to a set of parameter. | |
![]() | |
constexpr score::InterfaceKey | interfaceKey () const noexcept final override |
A key that uniquely identifies this family of factories. | |
void | insert (std::unique_ptr< score::InterfaceBase > e) final override |
insert Register a new factory. | |
T * | get (const key_type &k) const noexcept |
Get a particular factory from its ConcreteKey. | |
auto | begin () noexcept |
auto | begin () const noexcept |
auto | end () noexcept |
auto | end () const noexcept |
auto | cbegin () const noexcept |
auto | cend () const noexcept |
![]() | |
void | insert_base (std::unique_ptr< score::InterfaceBase > e, score::uuid_t k) |
auto | reserve (std::size_t v) |
auto | size () const noexcept |
auto | empty () const noexcept |
void | optimize () noexcept final override |
optimize Called when all the factories are loaded. | |
![]() | |
InterfaceListBase (const InterfaceListBase &)=delete | |
InterfaceListBase (InterfaceListBase &&)=delete | |
InterfaceListBase & | operator= (const InterfaceListBase &)=delete |
InterfaceListBase & | operator= (InterfaceListBase &&)=delete |
Additional Inherited Members | |
![]() | |
using | factory_type = T |
using | key_type = typename FactoryType::ConcreteKey |
using | vector_type = IndirectContainer< T > |
![]() | |
static const constexpr score::InterfaceKey | static_interfaceKey () noexcept |
![]() | |
Nano::Signal< void(const score::InterfaceBase &)> | added |
ossia::hash_map< score::uuid_t, std::unique_ptr< score::InterfaceBase > > | map |
![]() | |
static constexpr bool | factory_list_tag = true |
Member Function Documentation
◆ make()
template<typename T >
template<typename Fun , typename... Args>
requires std::is_invocable_v< Fun, typename score::InterfaceList<T>::factory_type&, Args...>
requires std::is_invocable_v< Fun, typename score::InterfaceList<T>::factory_type&, Args...>
|
inlinenoexcept |
Apply a function on the correct factory according to a set of parameter.
The factory must have a function match
that takes some arguments, and return true
if these arguments are correct for the given factory.
Then, the function passed in first argument is called on the actual factory if it is found, else a default-constructed return value (so for instance a null pointer).
The documentation for this class was generated from the following file: