18 using param_type =
typename Property_T::param_type;
19 using score::Command::Command;
23 , m_newScript{std::move(newScript)}
24 , m_oldScript{(model.*Property_T::get)()}
26 m_oldCables = Dataflow::saveCables({
const_cast<Process_T*
>(&model)}, ctx);
28 for(
auto& port : model.inlets())
29 m_oldInlets.emplace_back(
31 for(
auto& port : model.outlets())
32 m_oldOutlets.emplace_back(
39 auto& cmt = m_path.find(ctx);
42 Dataflow::removeCables(m_oldCables, ctx);
50 SCORE_ASSERT(m_oldInlets.size() == cmt.inlets().size());
51 SCORE_ASSERT(m_oldOutlets.size() == cmt.outlets().size());
54 for(std::size_t i = 0; i < m_oldInlets.size(); i++)
56 cmt.inlets()[i]->loadData(m_oldInlets[i].data);
58 for(std::size_t i = 0; i < m_oldOutlets.size(); i++)
60 cmt.outlets()[i]->loadData(m_oldOutlets[i].data);
64 auto cables = Dataflow::restoreCablesWithoutTouchingPorts(m_oldCables, ctx);
65 Dataflow::reattachCablesToPorts(cables, ctx);
70 Dataflow::notifyAddedCables(cables, ctx);
75 Dataflow::removeCables(m_oldCables, ctx);
77 auto& cmt = m_path.find(ctx);
81 auto cables = Dataflow::reloadPortsInNewProcess(
82 m_oldInlets, m_oldOutlets, m_oldCables, cmt, Process::PortLoadDataFlags{}, ctx,
89 Dataflow::notifyAddedCables(cables, ctx);
94 s << m_path << m_newScript << m_oldScript << m_oldInlets << m_oldOutlets
100 s >> m_path >> m_newScript >> m_oldScript >> m_oldInlets >> m_oldOutlets
105 param_type m_newScript;
106 param_type m_oldScript;
108 std::vector<SavedPort> m_oldInlets, m_oldOutlets;
110 Dataflow::SerializedCables m_oldCables;
Definition DocumentContext.hpp:18