33 #include <RobotComponents/interface/components/MotionPlanning/Tasks/RRTConnect/DataStructures.h>
49 (
static_cast<std::size_t
>(
workerId) < u.dependetOnUpdateIds.size()))
50 ? u.dependetOnUpdateIds.at(
workerId) + 1
74 if (appliedUpdateIds.size() < count)
76 appliedUpdateIds.resize(count, -1);
83 setTrees(
const std::vector<std::reference_wrapper<Tree>>& newTrees)
96 return pendingUpdateLookupTable.find(
id) != pendingUpdateLookupTable.end();
108 return pendingUpdates.at(
id);
114 template <
class LockType,
class RemoteUpdateGetter>
121 template <
class LockType,
class RemoteUpdateGetter,
class UpdateConsumer>
124 RemoteUpdateGetter getRemoteUpdate,
125 UpdateConsumer updateConsumer)
131 for (; i < pendingUpdates.size(); ++i)
144 template <
class LockType,
class RemoteUpdateGetter,
class UpdateConsumer>
148 RemoteUpdateGetter getRemoteUpdate,
149 UpdateConsumer updateConsumer)
154 if (u.dependetOnUpdateIds.empty())
161 u.dependetOnUpdateIds.size());
174 prepareUpdate(u.dependetOnUpdateIds, lock, getRemoteUpdate, updateConsumer);
181 updateConsumer(std::move(u));
183 u.dependetOnUpdateIds.clear();
186 template <
class LockType,
class RemoteUpdateGetter,
class UpdateConsumer>
190 RemoteUpdateGetter getRemoteUpdate,
191 UpdateConsumer updateConsumer)
196 static_cast<std::size_t
>(workerNodeId) < dependetOnUpdateIds.size();
199 const auto updateSubId = dependetOnUpdateIds.at(workerNodeId);
201 const UpdateId uId{workerNodeId, updateSubId};
222 Update
update = getRemoteUpdate(workerNodeId, updateSubId);
226 update.dependetOnUpdateIds, lock, getRemoteUpdate, updateConsumer);
231 updateConsumer(std::move(
update));
233 update.dependetOnUpdateIds.clear();
242 return (this->workerId == workerId) ||
243 ((
static_cast<std::size_t
>(workerId) < appliedUpdateIds.size())
244 ? updateSubId <= appliedUpdateIds.at(workerId)
256 const std::vector<Ice::Long>&
259 return appliedUpdateIds;
263 std::vector<std::reference_wrapper<Tree>> trees;
265 std::deque<Update> pendingUpdates;
266 std::map<UpdateId, std::size_t> pendingUpdateLookupTable;
268 std::vector<Ice::Long> appliedUpdateIds;