score
Home
Classes
Namespaces
Files
LoadCables.hpp
1
#pragma once
2
#include <Scenario/Commands/ScenarioCommandFactory.hpp>
3
4
#include <Dataflow/Commands/CableHelpers.hpp>
5
6
#include <score/command/Command.hpp>
7
#include <score/model/path/Path.hpp>
8
9
namespace
Dataflow
10
{
11
class
LoadCables
final :
public
score::Command
12
{
13
SCORE_COMMAND_DECL(Scenario::Command::CommandFactoryName(),
LoadCables
,
"Remove cable"
)
14
15
public
:
16
LoadCables
(
const
ObjectPath
& p,
const
SerializedCables& c)
17
: m_cables{c}
18
{
19
Dataflow::unstripCables(p, m_cables);
20
}
21
22
void
undo(
const
score::DocumentContext
& ctx)
const override
23
{
24
Dataflow::removeCables(m_cables, ctx);
25
}
26
27
void
redo(
const
score::DocumentContext
& ctx)
const override
28
{
29
Dataflow::restoreCables(m_cables, ctx);
30
}
31
32
protected
:
33
void
serializeImpl(
DataStreamInput
& s)
const override
{ s << m_cables; }
34
void
deserializeImpl(
DataStreamOutput
& s)
override
{ s >> m_cables; }
35
36
private
:
37
SerializedCables m_cables;
38
};
39
}
Dataflow::LoadCables
Definition:
LoadCables.hpp:12
ObjectPath
The ObjectPath class.
Definition:
ObjectPath.hpp:37
score::Command
The Command class.
Definition:
Command.hpp:34
DataStreamInput
Definition:
DataStreamHelpers.hpp:99
DataStreamOutput
Definition:
DataStreamHelpers.hpp:103
score::DocumentContext
Definition:
DocumentContext.hpp:18