20 using param_type =
typename Property_T::param_type;
21 using score::Command::Command;
25 , m_newScript{std::move(newScript)}
26 , m_oldScript{(model.*Property_T::get)()}
28 m_oldCables = Dataflow::saveCables({
const_cast<Process_T*
>(&model)}, ctx);
30 for(
auto& port : model.inlets())
31 m_oldInlets.emplace_back(
SavedPort{port->name(), port->type(), port->saveData()});
32 for(
auto& port : model.outlets())
33 m_oldOutlets.emplace_back(
SavedPort{port->name(), port->type(), port->saveData()});
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 Dataflow::restoreCables(m_oldCables, ctx);
67 if constexpr(
requires { cmt.isGpu(); })
74 Dataflow::removeCables(m_oldCables, ctx);
76 auto& cmt = m_path.find(ctx);
80 Dataflow::reloadPortsInNewProcess(m_oldInlets, m_oldOutlets, m_oldCables, cmt, ctx);
84 if constexpr(
requires { cmt.isGpu(); })
95 s << m_path << m_newScript << m_oldScript << m_oldInlets << m_oldOutlets
101 s >> m_path >> m_newScript >> m_oldScript >> m_oldInlets >> m_oldOutlets
106 param_type m_newScript;
107 param_type m_oldScript;
109 std::vector<SavedPort> m_oldInlets, m_oldOutlets;
111 Dataflow::SerializedCables m_oldCables;
Definition DocumentContext.hpp:18