2 #include <score/plugins/Interface.hpp>
3 #include <score/plugins/InterfaceList.hpp>
5 #define SCORE_CONCRETE_COMPONENT_FACTORY(AbstractFactory, ConcreteFactory)
7 #define SCORE_ABSTRACT_COMPONENT_FACTORY(Type) \
9 static Q_DECL_RELAXED_CONSTEXPR score::InterfaceKey static_interfaceKey() noexcept \
11 return static_cast<score::InterfaceKey>(Type::static_key().impl()); \
14 score::InterfaceKey interfaceKey() const noexcept final override \
16 return static_interfaceKey(); \
23 struct DocumentContext;
27 typename ComponentFactory_T>
31 using base_model_type = Model_T;
32 using system_type = System_T;
33 using factory_type = ComponentFactory_T;
40 virtual
bool matches(const base_model_type&) const = 0;
50 template <
typename... Args>
51 Factory_T* factory(Args&&... args)
const
53 for(
auto& factory : *
this)
55 if(factory.matches(std::forward<Args>(args)...))
69 typename DefaultFactory_T>
73 template <
typename... Args>
74 Factory_T& factory(Args&&... args)
const
76 for(
auto& factory : *
this)
78 if(factory.matches(std::forward<Args>(args)...))
88 mutable DefaultFactory_T m_default;
Definition: UuidKey.hpp:343
Definition: ComponentFactory.hpp:71
Definition: ComponentFactory.hpp:29
virtual ConcreteKey concreteKey() const noexcept=0
Identifies an implementation of an interface uniquely.
Definition: ComponentFactory.hpp:48
Base class for plug-in interfaces.
Definition: Interface.hpp:52
InterfaceList Default implementation of InterfaceListBase.
Definition: InterfaceList.hpp:80
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: ObjectMatches.hpp:6