AddLayerInNewSlot.hpp
1 #pragma once
2 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
3 
4 #include <score/command/Command.hpp>
5 #include <score/model/Identifier.hpp>
6 #include <score/model/path/Path.hpp>
7 #include <score/tools/std/Optional.hpp>
8 
9 struct DataStreamInput;
10 struct DataStreamOutput;
11 namespace Process
12 {
13 class ProcessModel;
14 }
15 
16 namespace Scenario
17 {
18 class IntervalModel;
19 namespace Command
20 {
24 class SCORE_PLUGIN_SCENARIO_EXPORT AddLayerInNewSlot final : public score::Command
25 {
26  SCORE_COMMAND_DECL(CommandFactoryName(), AddLayerInNewSlot, "Add a new layer")
27 public:
29  Path<IntervalModel>&& intervalPath, Id<Process::ProcessModel> process);
30 
31  void undo(const score::DocumentContext& ctx) const override;
32  void redo(const score::DocumentContext& ctx) const override;
33 
34  Id<Process::ProcessModel> processId() const { return m_processId; }
35 
36 protected:
37  void serializeImpl(DataStreamInput&) const override;
38  void deserializeImpl(DataStreamOutput&) override;
39 
40 private:
41  Path<IntervalModel> m_path;
42  Id<Process::ProcessModel> m_processId{};
43 };
44 }
45 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
The AddLayerInNewSlot class.
Definition: AddLayerInNewSlot.hpp:25
The id_base_t class.
Definition: Identifier.hpp:57
The Command class.
Definition: Command.hpp:34
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: DocumentContext.hpp:18