InsertContentInState.hpp
1 #pragma once
2 #include <Process/State/MessageNode.hpp>
3 
4 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
5 
6 #include <score/command/Command.hpp>
7 #include <score/model/path/Path.hpp>
8 
9 #include <ossia/detail/json.hpp>
10 
11 namespace Scenario
12 {
13 class StateModel;
14 namespace Command
15 {
17 {
18  SCORE_COMMAND_DECL(
19  CommandFactoryName(), InsertContentInState, "Insert content in a state")
20 
21 public:
23  const rapidjson::Value& stateData, const Scenario::StateModel& state);
24 
25  void undo(const score::DocumentContext& ctx) const override;
26  void redo(const score::DocumentContext& ctx) const override;
27 
28 private:
29  void serializeImpl(DataStreamInput& s) const override;
30  void deserializeImpl(DataStreamOutput& s) override;
31 
32  Process::MessageNode m_oldNode;
33  Process::MessageNode m_newNode;
34  Path<StateModel> m_state;
35 };
36 }
37 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
Definition: InsertContentInState.hpp:17
Definition: StateModel.hpp:63
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: DocumentContext.hpp:18