2 #include <score/model/Component.hpp>
4 #include <ossia/detail/algorithms.hpp>
22 static_assert(T::is_unique,
"Components must be unique to use getComponent");
25 = ossia::find_if(c, [](
auto& other) {
return other.key_match(T::static_key()); });
27 SCORE_ASSERT(it != c.end());
28 return static_cast<T&
>(*it);
41 static_assert(T::is_unique,
"Components must be unique to use getComponent");
44 = ossia::find_if(c, [](
auto& other) {
return other->key_match(T::static_key()); });
48 return static_cast<T*
>(*it);
Base toolkit upon which the software is built.
Definition: Application.cpp:90
T * findComponent(const score::Components &c) noexcept
findComponent Tryies to fetch a Component from Components by type.
Definition: ComponentUtils.hpp:39
T & component(const score::Components &c)
component Fetch a Component from Components by type
Definition: ComponentUtils.hpp:20
Definition: lib/score/model/Component.hpp:41