Loading...
Searching...
No Matches
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>
11struct DataStreamInput;
12struct DataStreamOutput;
13
14namespace Scenario
15{
16class IntervalModel;
17
18namespace Command
19{
25class SCORE_PLUGIN_SCENARIO_EXPORT AddSlotToRack final : public score::Command
26{
27 SCORE_COMMAND_DECL(CommandFactoryName(), AddSlotToRack, "Create a slot")
28public:
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
35protected:
36 void serializeImpl(DataStreamInput&) const override;
37 void deserializeImpl(DataStreamOutput&) override;
38
39private:
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:13
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition Slot.hpp:8
Definition DocumentContext.hpp:18