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

◆ evict()

void MayaFlux::Nexus::Expanse::evict ( uint32_t  fabric_id)

Fire the exit actions for everything inside for fabric_id and forget it.

Called by a Fabric when it drops this Expanse, so state an entry action changed is not left in the entered state.

Parameters
fabric_idStable id of the Fabric dropping the Expanse.

Definition at line 13 of file Expanse.cpp.

14{
15 const auto it = m_occupants_by_fabric.find(fabric_id);
16 if (it == m_occupants_by_fabric.end()) {
17 return;
18 }
19
20 const auto leaving = std::move(it->second);
21 m_occupants_by_fabric.erase(it);
22
23 for (uint32_t eid : leaving) {
24 if (m_on_exit)
25 m_on_exit(eid);
26
27 const CrossingContext ctx { .fabric_id = fabric_id, .entity = eid };
28 for (const auto& [handle, action] : m_exits)
29 action(ctx);
30 }
31}
std::unordered_map< uint32_t, std::unordered_set< uint32_t > > m_occupants_by_fabric
Definition Expanse.hpp:354

References MayaFlux::Nexus::CrossingContext::fabric_id, m_exits, m_occupants_by_fabric, and m_on_exit.