2 #include <Process/ProcessFactory.hpp>
5 #include <score/tools/SafeCast.hpp>
13 template <
typename Model_T>
23 QString prettyName()
const noexcept
override
27 QString category()
const noexcept
override
31 Descriptor descriptor(QString)
const noexcept
override
46 QObject* parent)
final override;
49 template <
typename Model_T>
54 if constexpr(std::is_constructible_v<
59 return new Model_T{duration, data, id, parent};
63 if constexpr(std::is_constructible_v<
67 return new Model_T{duration, id, ctx, parent};
69 else if constexpr(std::is_constructible_v<
73 return new Model_T{duration, id, parent};
77 return new Model_T{duration, data, id, parent};
81 else if constexpr(std::is_constructible_v<
84 return new Model_T{duration, id, ctx, parent};
86 return new Model_T{duration, id, parent};
89 template <
typename Model_T>
90 Model_T* ProcessFactory_T<Model_T>::load(
93 return score::deserialize_dyn(vis, [&](
auto&& deserializer) {
94 if constexpr(std::is_constructible_v<
97 return new Model_T{deserializer, ctx, parent};
99 return new Model_T{deserializer, parent};
104 typename Model_T,
typename LayerPresenter_T,
typename LayerView_T,
105 typename HeaderDelegate_T = default_t>
117 std::optional<double> recommendedHeight()
const noexcept
override
119 if constexpr(
bool(LayerPresenter_T::recommendedHeight))
121 return LayerPresenter_T::recommendedHeight;
123 return LayerFactory::recommendedHeight();
126 LayerView_T* makeLayerView(
128 QGraphicsItem* parent)
const final override
130 if constexpr(std::is_constructible_v<
133 return new LayerView_T{safe_cast<const Model_T&>(viewmodel), context, parent};
134 else if constexpr(std::is_constructible_v<
135 LayerView_T,
const Model_T&, QGraphicsItem*>)
136 return new LayerView_T{safe_cast<const Model_T&>(viewmodel), parent};
138 return new LayerView_T{parent};
141 LayerPresenter_T* makeLayerPresenter(
145 return new LayerPresenter_T{
146 safe_cast<const Model_T&>(lm), safe_cast<LayerView_T*>(v), context, parent};
156 QGraphicsItem* parent)
const override
158 if constexpr(std::is_same_v<HeaderDelegate_T, default_t>)
159 return LayerFactory::makeHeaderDelegate(model, ctx, parent);
161 return new HeaderDelegate_T{model, ctx};
165 template <
typename Model_T>
185 template <
typename Model_T>
Definition: GenericProcessFactory.hpp:169
Definition: GenericProcessFactory.hpp:107
Definition: score-lib-process/Process/ProcessFactory.hpp:58
Definition: LayerView.hpp:21
Definition: GenericProcessFactory.hpp:15
The ProcessFactory class.
Definition: score-lib-process/Process/ProcessFactory.hpp:35
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
The id_base_t class.
Definition: Identifier.hpp:57
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
ProcessFlags
Various settings for processes.
Definition: ProcessFlags.hpp:17
Definition: ProcessContext.hpp:12
Definition: score-lib-process/Process/ProcessMetadata.hpp:37
Definition: GenericProcessFactory.hpp:10
Definition: TimeValue.hpp:21
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: ObjectMatches.hpp:6
Definition: DocumentContext.hpp:18