Loading...
Searching...
No Matches
CreateEvent_State.hpp
1#pragma once
2#include "CreateState.hpp"
3
4#include <Scenario/Commands/ScenarioCommandFactory.hpp>
5
6#include <score/command/Command.hpp>
7#include <score/model/Identifier.hpp>
8#include <score/model/path/Path.hpp>
9#include <score/tools/std/Optional.hpp>
10
11#include <QString>
12
13struct DataStreamInput;
14struct DataStreamOutput;
15
16namespace Scenario
17{
18class EventModel;
19class StateModel;
20class ProcessModel;
21class TimeSyncModel;
22namespace Command
23{
24class SCORE_PLUGIN_SCENARIO_EXPORT CreateEvent_State final : public score::Command
25{
26 SCORE_COMMAND_DECL(
27 CommandFactoryName(), CreateEvent_State, "Create an event and a state")
28public:
30 const Scenario::ProcessModel& scenario, Id<TimeSyncModel> timeSync, double stateY);
31
32 const Path<Scenario::ProcessModel>& scenarioPath() const
33 {
34 return m_command.scenarioPath();
35 }
36
37 const Id<StateModel>& createdState() const { return m_command.createdState(); }
38
39 const Id<EventModel>& createdEvent() const { return m_newEvent; }
40
41 void undo(const score::DocumentContext& ctx) const override;
42 void redo(const score::DocumentContext& ctx) const override;
43
44protected:
45 void serializeImpl(DataStreamInput&) const override;
46 void deserializeImpl(DataStreamOutput&) override;
47
48private:
49 Id<EventModel> m_newEvent;
50 QString m_createdName;
51
52 CreateState m_command;
53
54 Id<TimeSyncModel> m_timeSync;
55};
56}
57}
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
Definition CreateEvent_State.hpp:25
Definition CreateState.hpp:22
The core hierarchical and temporal process of score.
Definition ScenarioModel.hpp:37
The id_base_t class.
Definition Identifier.hpp:57
The Command class.
Definition Command.hpp:34
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition DocumentContext.hpp:18