MayaFlux 0.2.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 328 of file InputManager.cpp.

329{
330#ifdef MAYAFLUX_PLATFORM_MACOS
331 // Acquire hazard pointer slot
332 size_t slot = m_hazard_counter.fetch_add(1) % MAX_READERS;
333
334 const RegistrationList* current_regs;
335 do {
336 current_regs = m_registrations.load();
337 m_hazard_ptrs[slot].store(current_regs);
338 } while (current_regs != m_registrations.load());
339
340 // Safe to use current_regs now
341 for (const auto& reg : *current_regs) {
342 auto node = reg.node.lock();
343 if (!node)
344 continue;
345
346 if (matches_binding(value, reg.binding)) {
347 node->process_input(value);
348 }
349 }
350
351 // Release hazard pointer
352 m_hazard_ptrs[slot].store(nullptr);
353#else
354 auto current_regs = m_registrations.load();
355
356 for (const auto& reg : *current_regs) {
357 auto node = reg.node.lock();
358 if (!node)
359 continue;
360
361 if (matches_binding(value, reg.binding)) {
362 node->process_input(value);
363 }
364 }
365#endif
366}
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: