Loading...
Searching...
No Matches
SetProcessPosition.hpp
1#pragma once
2#include <Scenario/Commands/ScenarioCommandFactory.hpp>
3
4#include <score/command/Command.hpp>
5#include <score/model/path/Path.hpp>
6
7struct DataStreamInput;
9
10namespace Process
11{
12class ProcessModel;
13}
14namespace Scenario
15{
16class IntervalModel;
17class StateModel;
18namespace Command
19{
20class PutProcessBefore final : public score::Command
21{
22 SCORE_COMMAND_DECL(CommandFactoryName(), PutProcessBefore, "Set process position")
23
24public:
25 // Put proc2 before proc
27 const IntervalModel& cst, std::optional<Id<Process::ProcessModel>> proc,
29
30 void undo(const score::DocumentContext& ctx) const override;
31 void redo(const score::DocumentContext& ctx) const override;
32
33protected:
34 void serializeImpl(DataStreamInput& s) const override;
35 void deserializeImpl(DataStreamOutput& s) override;
36
37private:
38 void putBefore(
39 const score::DocumentContext& ctx, std::optional<Id<Process::ProcessModel>> proc,
40 Id<Process::ProcessModel> proc2) const;
41
43 std::optional<Id<Process::ProcessModel>> m_proc;
45 std::optional<Id<Process::ProcessModel>> m_old_after_proc2;
46};
47
49{
50 SCORE_COMMAND_DECL(CommandFactoryName(), PutStateProcessBefore, "Set process position")
51
52public:
53 // Put proc2 before proc
55 const StateModel& cst, std::optional<Id<Process::ProcessModel>> proc,
57
58 void undo(const score::DocumentContext& ctx) const override;
59 void redo(const score::DocumentContext& ctx) const override;
60
61protected:
62 void serializeImpl(DataStreamInput& s) const override;
63 void deserializeImpl(DataStreamOutput& s) override;
64
65private:
66 void putBefore(
67 const score::DocumentContext& ctx, std::optional<Id<Process::ProcessModel>> proc,
68 Id<Process::ProcessModel> proc2) const;
69
71 std::optional<Id<Process::ProcessModel>> m_proc;
73 std::optional<Id<Process::ProcessModel>> m_old_after_proc2;
74};
75}
76}
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
Definition SetProcessPosition.hpp:21
Definition SetProcessPosition.hpp:49
Definition IntervalModel.hpp:50
Definition StateModel.hpp:63
The id_base_t class.
Definition Identifier.hpp:57
The Command class.
Definition Command.hpp:34
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
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