MoveEventOnCreationMeta.hpp
1 #pragma once
2 
3 #include <Process/ExpandMode.hpp>
4 #include <Process/TimeValue.hpp>
5 
6 #include <Scenario/Commands/Scenario/Displacement/SerializableMoveEvent.hpp>
7 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
8 
9 #include <score/model/Identifier.hpp>
10 #include <score/model/path/Path.hpp>
11 
12 #include <score_plugin_scenario_export.h>
13 
14 #include <memory>
15 struct DataStreamInput;
16 struct DataStreamOutput;
17 
18 namespace Scenario
19 {
20 class EventModel;
21 class ProcessModel;
22 namespace Command
23 {
24 
25 class SCORE_PLUGIN_SCENARIO_EXPORT MoveEventOnCreationMeta final
26  : public SerializableMoveEvent
27 {
28  SCORE_COMMAND_DECL(
29  CommandFactoryName(), MoveEventOnCreationMeta, "Move an event on creation")
30 public:
32  const Scenario::ProcessModel& scenarioPath, Id<EventModel> eventId,
33  TimeVal newDate, ExpandMode mode);
35 
36  void undo(const score::DocumentContext& ctx) const override;
37  void redo(const score::DocumentContext& ctx) const override;
38 
39  const Path<Scenario::ProcessModel>& path() const override;
40  void update(
41  Scenario::ProcessModel& scenario, const Id<EventModel>& eventId,
42  const TimeVal& newDate, double, ExpandMode mode, LockMode lm) override;
43 
44  // Command interface
45 protected:
46  void serializeImpl(DataStreamInput&) const override;
47  void deserializeImpl(DataStreamOutput&) override;
48 
49 private:
50  std::unique_ptr<SerializableMoveEvent> m_moveEventImplementation;
51 };
52 }
53 }
Definition: MoveEventOnCreationMeta.hpp:27
Definition: SerializableMoveEvent.hpp:20
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
The id_base_t class.
Definition: Identifier.hpp:57
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: TimeValue.hpp:21
Definition: DocumentContext.hpp:18