2 #include <score/plugins/InterfaceList.hpp>
4 #include <core/application/ApplicationSettings.hpp>
6 #include <ossia/detail/for_each.hpp>
12 struct GUIApplicationContext;
13 struct ApplicationContext;
15 SCORE_LIB_BASE_EXPORT
bool
23 template <
typename Base_T,
typename... Args>
24 auto make_ptr_vector() noexcept
26 std::vector<std::unique_ptr<Base_T>> vec;
28 vec.reserve(
sizeof...(Args));
29 (vec.push_back(std::unique_ptr<Base_T>((Base_T*)
new Args)), ...);
48 if constexpr(std::is_constructible_v<Factory_T, const Context_T&>)
49 return new Factory_T(ctx);
51 return new Factory_T();
58 template <
typename Context_T,
typename... Args>
60 const Context_T& context, std::vector<score::InterfaceBase*>& vec) noexcept
62 vec.reserve(
sizeof...(Args));
67 struct has_ui :
public std::false_type
71 requires(T::ui_interface)
74 static const constexpr
bool value = T::ui_interface;
82 template <
typename Factory_T,
typename... Types_T>
85 #if !defined(_MSC_VER)
87 (std::is_base_of<Factory_T, Types_T>::value && ...),
88 "A type is not child of the parent.");
90 template <
typename Context_T>
93 std::vector<score::InterfaceBase*>& vec) noexcept
97 if(!appcontext_has_ui(ctx))
103 if(fact == Factory_T::static_interfaceKey())
105 vec.reserve(
sizeof...(Types_T));
114 template <
typename Factory_T,
typename... Args>
115 using FW =
FW_T<Factory_T, Args...>;
135 template <
typename Context_T,
typename... Args>
138 std::vector<score::InterfaceBase*> vec;
140 ossia::for_each_type_if_tagged<Args...>([&](
auto t) {
141 using fw_t =
typename decltype(t)::type;
142 return fw_t{}(ctx, key, vec);
Definition: UuidKey.hpp:343
Base class for plug-in interfaces.
Definition: Interface.hpp:52
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Used to group base classes and concrete classes in a single argument list.
Definition: FactorySetup.hpp:84
Definition: FactorySetup.hpp:45
Definition: FactorySetup.hpp:68
Used to access all the application-wide state and structures.
Definition: ApplicationContext.hpp:24
Specializes ApplicationContext with the QMainWindow.
Definition: GUIApplicationContext.hpp:15