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

◆ dispatch_to_nodes()

void MayaFlux::Core::InputManager::dispatch_to_nodes ( const InputValue value)
private

Definition at line 335 of file InputManager.cpp.

336{
337#ifdef MAYAFLUX_PLATFORM_MACOS
338 // Acquire hazard pointer slot
339 size_t slot = m_hazard_counter.fetch_add(1) % MAX_READERS;
340
341 const RegistrationList* current_regs;
342 do {
343 current_regs = m_registrations.load();
344 m_hazard_ptrs[slot].store(current_regs);
345 } while (current_regs != m_registrations.load());
346
347 // Safe to use current_regs now
348 for (const auto& reg : *current_regs) {
349 auto node = reg.node.lock();
350 if (!node)
351 continue;
352
353 if (matches_binding(value, reg.binding)) {
354 node->process_input(value);
355 }
356 }
357
358 // Release hazard pointer
359 m_hazard_ptrs[slot].store(nullptr);
360#else
361 auto current_regs = m_registrations.load();
362
363 for (const auto& reg : *current_regs) {
364 auto node = reg.node.lock();
365 if (!node)
366 continue;
367
368 if (matches_binding(value, reg.binding)) {
369 node->process_input(value);
370 }
371 }
372#endif
373}
std::vector< NodeRegistration > RegistrationList
std::atomic< std::shared_ptr< const RegistrationList > > m_registrations
bool matches_binding(const InputValue &value, const InputBinding &binding) const

References m_registrations, and matches_binding().

Referenced by processing_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: