RemoveStateProcess.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 
8 #include <score_plugin_scenario_export.h>
9 namespace Process
10 {
11 class ProcessModel;
12 class ProcessFactory;
13 }
14 namespace Scenario
15 {
16 class StateModel;
17 namespace Command
18 {
19 
20 class SCORE_PLUGIN_SCENARIO_EXPORT RemoveStateProcess final : public score::Command
21 {
22  SCORE_COMMAND_DECL(CommandFactoryName(), RemoveStateProcess, "Remove a state process")
23 public:
25  const Scenario::StateModel& state, Id<Process::ProcessModel> processId);
26 
27  void undo(const score::DocumentContext& ctx) const override;
28  void redo(const score::DocumentContext& ctx) const override;
29 
30 protected:
31  void serializeImpl(DataStreamInput& s) const override;
32  void deserializeImpl(DataStreamOutput& s) override;
33 
34 private:
35  Path<StateModel> m_path;
36  UuidKey<Process::ProcessModel> m_processUuid;
37 
38  Id<Process::ProcessModel> m_processId{};
39  QByteArray m_data;
40 };
41 }
42 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
Definition: RemoveStateProcess.hpp:21
Definition: StateModel.hpp:63
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