LocalTree/ProcessComponent.hpp
1 #pragma once
2 #include <Process/ProcessComponent.hpp>
3 
4 #include <LocalTree/LocalTreeComponent.hpp>
5 
6 #include <score/model/Component.hpp>
7 #include <score/model/ComponentFactory.hpp>
8 #include <score/plugins/ModelFactory.hpp>
9 
10 #include <score_lib_process_export.h>
11 namespace LocalTree
12 {
13 class SCORE_LIB_PROCESS_EXPORT ProcessComponent
14  : public Component<Process::GenericProcessComponent<const score::DocumentContext>>
15 {
16  ABSTRACT_COMPONENT_METADATA(
17  LocalTree::ProcessComponent, "0732ab51-a052-4e2e-a1f7-9bf2926c199c")
18 public:
20  ossia::net::node_base& node, Process::ProcessModel& proc,
21  const score::DocumentContext& doc, const QString& name, QObject* parent);
22 
23  virtual ~ProcessComponent();
24 };
25 
26 template <typename Process_T>
29 
30 class SCORE_LIB_PROCESS_EXPORT ProcessComponentFactory
32  Process::ProcessModel, score::DocumentContext,
33  LocalTree::ProcessComponentFactory>
34 {
35  SCORE_ABSTRACT_COMPONENT_FACTORY(LocalTree::ProcessComponent)
36 public:
37  virtual ~ProcessComponentFactory();
38  virtual ProcessComponent* make(
39  ossia::net::node_base& parent, Process::ProcessModel& proc,
40  const score::DocumentContext& doc, QObject* paren_objt) const = 0;
41 };
42 
43 template <typename ProcessComponent_T>
46  ProcessComponent_T, ProcessComponentFactory>
47 {
48 public:
49  using model_type = typename ProcessComponent_T::model_type;
50  ProcessComponent* make(
51  ossia::net::node_base& parent, Process::ProcessModel& proc,
52  const score::DocumentContext& doc, QObject* paren_objt) const override
53  {
54  return new ProcessComponent_T{
55  parent, static_cast<model_type&>(proc), doc, paren_objt};
56  }
57 };
58 
59 class SCORE_LIB_PROCESS_EXPORT ProcessComponentFactoryList final
61  Process::ProcessModel, score::DocumentContext,
62  LocalTree::ProcessComponentFactory>
63 {
64 public:
66 };
67 }
Definition: LocalTreeComponent.hpp:12
Definition: LocalTree/ProcessComponent.hpp:47
Definition: LocalTree/ProcessComponent.hpp:34
Definition: LocalTree/ProcessComponent.hpp:63
Definition: LocalTree/ProcessComponent.hpp:15
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: ComponentFactory.hpp:29
Definition: ModelFactory.hpp:8
Definition: ComponentFactory.hpp:48
Local tree provides a way to extend the tree given through the Engine::Network::LocalDevice.
Definition: BaseCallbackWrapper.hpp:9
Definition: DocumentContext.hpp:18