MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ commit()

void MayaFlux::Nexus::Fabric::commit ( )

Update all positions, publish the snapshot, fire all registered objects.

For each object with a position, calls m_index->update() then m_index->publish(). Then fires each object's function with a context built from the new snapshot.

Definition at line 163 of file Fabric.cpp.

164{
165 for (auto& [id, reg] : m_registrations) {
166 if (reg.spatial_id.has_value()) {
167 std::visit([&](const auto& ptr) {
168 if (ptr->m_position.has_value()) {
169 m_index->update(*reg.spatial_id, *ptr->m_position);
170 }
171 },
172 reg.member);
173 }
174 }
175
176 m_index->publish();
177
178 for (auto& [id, reg] : m_registrations) {
179 if (reg.commit_driven) {
180 fire(reg);
181 }
182 }
183}
std::unique_ptr< Kinesis::SpatialIndex3D > m_index
Definition Fabric.hpp:224
void fire(uint32_t id)
Fire a single object against the current snapshot without republishing.
Definition Fabric.cpp:185
std::unordered_map< uint32_t, Registration > m_registrations
Definition Fabric.hpp:225

References fire(), m_index, and m_registrations.

+ Here is the call graph for this function: