AddStateProcess.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 
10 // RENAMEME
11 
12 namespace Process
13 {
14 class ProcessModel;
15 class ProcessFactory;
16 }
17 namespace Scenario
18 {
19 class StateModel;
20 namespace Command
21 {
22 class SCORE_PLUGIN_SCENARIO_EXPORT AddStateProcessToState final : public score::Command
23 {
24  SCORE_COMMAND_DECL(CommandFactoryName(), AddStateProcessToState, "Add a state process")
25 public:
30  const QString& data);
32  const Scenario::StateModel& state, Id<Process::ProcessModel> idToUse,
33  UuidKey<Process::ProcessModel> process, const QString& data);
34 
35  void undo(const score::DocumentContext& ctx) const override;
36  void redo(const score::DocumentContext& ctx) const override;
37 
38  const Id<Process::ProcessModel>& processId() const noexcept
39  {
40  return m_createdProcessId;
41  }
42 
43 protected:
44  void serializeImpl(DataStreamInput& s) const override;
45  void deserializeImpl(DataStreamOutput& s) override;
46 
47 private:
48  Path<StateModel> m_path;
49  UuidKey<Process::ProcessModel> m_processName;
50  QString m_data{};
51  Id<Process::ProcessModel> m_createdProcessId{};
52 };
53 }
54 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
Definition: AddStateProcess.hpp:23
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