SetCondition.hpp
1 #pragma once
2 #include <State/Expression.hpp>
3 
4 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
5 #include <Scenario/Document/Event/ExecutionStatus.hpp>
6 
7 #include <score/command/Command.hpp>
8 #include <score/command/PropertyCommand.hpp>
9 #include <score/model/path/Path.hpp>
10 
11 struct DataStreamInput;
12 struct DataStreamOutput;
13 
14 namespace Scenario
15 {
16 class EventModel;
17 namespace Command
18 {
19 class SCORE_PLUGIN_SCENARIO_EXPORT SetCondition final : public score::Command
20 {
21  SCORE_COMMAND_DECL(CommandFactoryName(), SetCondition, "Set an Event's condition")
22 public:
23  SetCondition(const EventModel& event, State::Expression&& condition);
24  void undo(const score::DocumentContext& ctx) const override;
25  void redo(const score::DocumentContext& ctx) const override;
26 
27 protected:
28  void serializeImpl(DataStreamInput&) const override;
29  void deserializeImpl(DataStreamOutput&) override;
30 
31 private:
32  Path<EventModel> m_path;
33  State::Expression m_condition;
34  State::Expression m_previousCondition;
35 };
36 
38 {
39  SCORE_COMMAND_DECL(CommandFactoryName(), SetOffsetBehavior, "Set offset behavior")
40 public:
41  SetOffsetBehavior(const EventModel& event, OffsetBehavior newval);
42 };
43 }
44 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
Definition: SetCondition.hpp:20
Definition: SetCondition.hpp:38
Definition: EventModel.hpp:36
The Command class.
Definition: Command.hpp:34
The PropertyCommand class.
Definition: PropertyCommand.hpp:21
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