2 #include <Process/Dataflow/Cable.hpp>
3 #include <Process/Dataflow/Port.hpp>
5 #include <ossia/detail/ptr_set.hpp>
9 using SerializedCables = std::vector<std::pair<Id<Process::Cable>,
Process::CableData>>;
16 auto parent_n = parent.vec().size();
17 auto path_n = path.vec().size();
18 if(parent_n >= path_n)
20 for(std::size_t i = 0; i < parent_n; i++)
22 if(!(path.vec()[i] == parent.vec()[i]))
26 SCORE_ASSERT(parent_n > 1);
27 path.vec().erase(path.vec().begin(), path.vec().begin() + parent_n - 1);
34 bool source_ok =
false;
35 for(
const auto& parent : vec)
37 if(verifyAndUpdateIfChildOf(path.source.unsafePath(), parent.unsafePath()))
46 for(
const auto& parent : vec)
48 if(verifyAndUpdateIfChildOf(path.sink.unsafePath(), parent.unsafePath()))
59 Dataflow::SerializedCables cablesToCopy(
60 const std::vector<T*>& array,
61 const std::vector<
Path<std::remove_const_t<T>>>& siblings,
67 Dataflow::SerializedCables copiedCables;
68 ossia::ptr_set<Process::Inlet*> ins;
71 auto child_ins = itv->template findChildren<Process::Inlet*>();
72 ins.insert(child_ins.begin(), child_ins.end());
77 for(
const auto& c_inl : inl->cables())
81 auto cd = cable->toCableData();
82 if(verifyAndUpdateIfChildOf(cd, siblings))
84 copiedCables.push_back({cable->id(), cd});
94 Dataflow::SerializedCables
97 std::vector<Path<std::remove_const_t<T>>> siblings;
98 siblings.reserve(array.size());
101 siblings.emplace_back(*ptr);
103 return cablesToCopy(array, siblings, ctx);
The ObjectPath class.
Definition: ObjectPath.hpp:37
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: CableData.hpp:18
Definition: DocumentContext.hpp:18