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

◆ unregister_node()

void MayaFlux::Core::InputManager::unregister_node ( const std::shared_ptr< Nodes::Input::InputNode > &  node)

Unregister a node.

Parameters
nodeThe node to unregister

Removes the node from all bindings.

Definition at line 212 of file InputManager.cpp.

213{
214 if (!node)
215 return;
216
217 {
218 std::lock_guard lock(m_registry_mutex);
219
220#ifdef MAYAFLUX_PLATFORM_MACOS
221 auto* old_list = m_registrations.load();
222 auto* new_list = new RegistrationList(*old_list);
223
224 new_list->erase(
225 std::remove_if(new_list->begin(), new_list->end(),
226 [&node](const NodeRegistration& reg) {
227 auto locked = reg.node.lock();
228 return !locked || locked == node;
229 }),
230 new_list->end());
231
232 m_registrations.store(new_list);
233 retire_list(old_list);
234#else
235 auto current_list = m_registrations.load();
236 auto new_list = std::make_shared<RegistrationList>(*current_list);
237
238 new_list->erase(
239 std::remove_if(new_list->begin(), new_list->end(),
240 [&node](const NodeRegistration& reg) {
241 auto locked = reg.node.lock();
242 return !locked || locked == node;
243 }),
244 new_list->end());
245
246 m_registrations.store(new_list);
247#endif
248 m_tracked_nodes.erase(
249 std::remove(m_tracked_nodes.begin(), m_tracked_nodes.end(), node),
250 m_tracked_nodes.end());
251 }
252
254 "Unregistered InputNode");
255}
#define MF_DEBUG(comp, ctx,...)
std::vector< NodeRegistration > RegistrationList
std::atomic< std::shared_ptr< const RegistrationList > > m_registrations
std::vector< std::shared_ptr< Nodes::Input::InputNode > > m_tracked_nodes
To keep nodes alive.
@ InputManagement
Input management (Core::InputManager)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::InputManagement, m_registrations, m_registry_mutex, m_tracked_nodes, and MF_DEBUG.

Referenced by MayaFlux::unregister_input_node().

+ Here is the caller graph for this function: