Loading...
Searching...
No Matches
SplitTimeSync.hpp
1#pragma once
2
3#include <Scenario/Commands/ScenarioCommandFactory.hpp>
4
5#include <score/command/Command.hpp>
6#include <score/model/Identifier.hpp>
7#include <score/model/path/Path.hpp>
8#include <score/tools/std/Optional.hpp>
9
10#include <QVector>
11
12struct DataStreamInput;
13struct DataStreamOutput;
14
15namespace Scenario
16{
17class EventModel;
18class TimeSyncModel;
19namespace Command
20{
21class SplitTimeSync final : public score::Command
22{
23 SCORE_COMMAND_DECL(CommandFactoryName(), SplitTimeSync, "Desynchronize")
24public:
26 const TimeSyncModel& path, std::vector<Id<EventModel>> eventsInNewTimeSync);
27 void undo(const score::DocumentContext& ctx) const override;
28 void redo(const score::DocumentContext& ctx) const override;
29
30protected:
31 void serializeImpl(DataStreamInput&) const override;
32 void deserializeImpl(DataStreamOutput&) override;
33
34private:
36 std::vector<Id<EventModel>> m_eventsInNewTimeSync;
37
38 Id<TimeSyncModel> m_originalTimeSyncId;
39 Id<TimeSyncModel> m_newTimeSyncId;
40};
41
42class SCORE_PLUGIN_SCENARIO_EXPORT SplitWholeSync final : public score::Command
43{
44 SCORE_COMMAND_DECL(CommandFactoryName(), SplitWholeSync, "Desynchronize")
45public:
46 SplitWholeSync(const TimeSyncModel& path);
47 SplitWholeSync(const TimeSyncModel& path, std::vector<Id<TimeSyncModel>> new_ids);
48 void undo(const score::DocumentContext& ctx) const override;
49 void redo(const score::DocumentContext& ctx) const override;
50
51protected:
52 void serializeImpl(DataStreamInput&) const override;
53 void deserializeImpl(DataStreamOutput&) override;
54
55private:
57
58 Id<TimeSyncModel> m_originalTimeSync;
59 std::vector<Id<TimeSyncModel>> m_newTimeSyncs;
60};
61}
62}
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
Definition SplitTimeSync.hpp:22
Definition SplitTimeSync.hpp:43
Definition TimeSyncModel.hpp:34
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