Loading...
Searching...
No Matches
CreateTimeSync_Event_State.hpp
1#pragma once
2#include "CreateEvent_State.hpp"
3
4#include <Process/TimeValue.hpp>
5
6#include <Scenario/Commands/ScenarioCommandFactory.hpp>
7
8#include <score/command/Command.hpp>
9#include <score/model/Identifier.hpp>
10#include <score/model/path/Path.hpp>
11#include <score/tools/std/Optional.hpp>
12
13#include <QString>
14
15#include <score_plugin_scenario_export.h>
16struct DataStreamInput;
17struct DataStreamOutput;
18namespace Scenario
19{
20class ProcessModel;
21class EventModel;
22class StateModel;
23class TimeSyncModel;
24namespace Command
25{
26class SCORE_PLUGIN_SCENARIO_EXPORT CreateTimeSync_Event_State final
27 : public score::Command
28{
29 SCORE_COMMAND_DECL(
30 CommandFactoryName(), CreateTimeSync_Event_State,
31 "Create a timesync, an event and a state")
32public:
34 const Scenario::ProcessModel& scenario, TimeVal date, double stateY);
35
36 const Path<Scenario::ProcessModel>& scenarioPath() const
37 {
38 return m_command.scenarioPath();
39 }
40
41 const Id<StateModel>& createdState() const { return m_command.createdState(); }
42
43 const Id<EventModel>& createdEvent() const { return m_command.createdEvent(); }
44
45 const Id<TimeSyncModel>& createdTimeSync() const { return m_newTimeSync; }
46
47 void undo(const score::DocumentContext& ctx) const override;
48 void redo(const score::DocumentContext& ctx) const override;
49
50protected:
51 void serializeImpl(DataStreamInput&) const override;
52 void deserializeImpl(DataStreamOutput&) override;
53
54private:
55 Id<TimeSyncModel> m_newTimeSync;
56 QString m_createdName;
57 TimeVal m_date;
58
59 CreateEvent_State m_command;
60};
61}
62}
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
Definition CreateEvent_State.hpp:25
Definition CreateTimeSync_Event_State.hpp:28
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 TimeValue.hpp:21
Definition DocumentContext.hpp:18