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 331 of file InputManager.cpp.

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