AddSlotToRack.hpp
1 #pragma once
2 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
3 #include <Scenario/Document/Interval/Slot.hpp>
4 
5 #include <score/command/Command.hpp>
6 #include <score/model/Identifier.hpp>
7 #include <score/model/path/Path.hpp>
8 #include <score/tools/std/Optional.hpp>
9 
10 #include <score_plugin_scenario_export.h>
11 struct DataStreamInput;
12 struct DataStreamOutput;
13 
14 namespace Scenario
15 {
16 class IntervalModel;
17 
18 namespace Command
19 {
25 class SCORE_PLUGIN_SCENARIO_EXPORT AddSlotToRack final : public score::Command
26 {
27  SCORE_COMMAND_DECL(CommandFactoryName(), AddSlotToRack, "Create a slot")
28 public:
29  AddSlotToRack(const Path<IntervalModel>& rackPath);
30  AddSlotToRack(const Path<IntervalModel>& rackPath, Slot&& slot);
31 
32  void undo(const score::DocumentContext& ctx) const override;
33  void redo(const score::DocumentContext& ctx) const override;
34 
35 protected:
36  void serializeImpl(DataStreamInput&) const override;
37  void deserializeImpl(DataStreamOutput&) override;
38 
39 private:
40  Path<IntervalModel> m_path;
41  Scenario::Slot m_slot;
42 };
43 }
44 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
The AddSlotToRack class.
Definition: AddSlotToRack.hpp:26
The Command class.
Definition: Command.hpp:34
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: Slot.hpp:8
Definition: DocumentContext.hpp:18