2 #include <score/model/EntityMap.hpp>
3 #include <score/plugins/UuidKey.hpp>
5 #if defined(SCORE_SERIALIZABLE_COMPONENTS)
6 #include <score/tools/std/HashMap.hpp>
24 class SCORE_LIB_BASE_EXPORT
Component :
public QObject
29 explicit Component(
const QString& name, QObject* parent);
40 struct SCORE_LIB_BASE_EXPORT
Components : std::vector<score::Component*>
56 template <
typename System_T>
60 template <
typename... Args>
67 System_T& system()
const noexcept {
return m_system; }
73 #if defined(SCORE_SERIALIZABLE_COMPONENTS)
74 class SerializableComponent;
75 using DataStreamComponents
76 = score::hash_map<UuidKey<score::SerializableComponent>, QByteArray>;
78 = score::hash_map<UuidKey<score::SerializableComponent>, QJsonObject>;
82 #if defined(SCORE_SERIALIZABLE_COMPONENTS)
83 #if !defined(SCORE_ALL_UNITY) && !defined(__MINGW32__)
84 extern template class SCORE_LIB_BASE_EXPORT
85 ossia::fast_hash_map<UuidKey<score::SerializableComponent>, QByteArray>;
86 extern template class SCORE_LIB_BASE_EXPORT
87 ossia::fast_hash_map<UuidKey<score::SerializableComponent>, QJsonObject>;
94 #define ABSTRACT_COMPONENT_METADATA(Type, Uuid) \
96 using base_component_type = Type; \
98 static constexpr UuidKey<score::Component> static_key() noexcept \
103 static constexpr bool base_key_match(UuidKey<score::Component> other) noexcept \
105 return static_key() == other; \
113 #define COMPONENT_METADATA(Uuid) \
115 static constexpr UuidKey<score::Component> static_key() noexcept \
120 constexpr UuidKey<score::Component> key() const noexcept final override \
122 return static_key(); \
125 constexpr bool key_match(UuidKey<score::Component> other) \
126 const noexcept final override \
128 return static_key() == other || base_component_type::base_key_match(other); \
136 #define COMMON_COMPONENT_METADATA(Uuid) \
138 static constexpr UuidKey<score::Component> static_key() noexcept \
143 UuidKey<score::Component> key() const noexcept final override \
145 return static_key(); \
148 bool key_match(UuidKey<score::Component> other) const noexcept final override \
150 return static_key() == other; \
Definition: UuidKey.hpp:343
A component adds custom data to an Entity.
Definition: lib/score/model/Component.hpp:25
A component that has a reference to a specific context object.
Definition: lib/score/model/Component.hpp:58
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: lib/score/model/Component.hpp:41
Definition: lib/score/model/Component.hpp:16