MayaFlux 1.0.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 344 of file InputManager.cpp.

345{
346#ifdef MAYAFLUX_PLATFORM_MACOS
347 // Acquire hazard pointer slot
348 size_t slot = m_hazard_counter.fetch_add(1) % MAX_READERS;
349
350 const RegistrationList* current_regs;
351 do {
352 current_regs = m_registrations.load();
353 m_hazard_ptrs[slot].store(current_regs);
354 } while (current_regs != m_registrations.load());
355
356 // Safe to use current_regs now
357 for (const auto& reg : *current_regs) {
358 auto node = reg.node.lock();
359 if (!node)
360 continue;
361
362 if (matches_binding(value, reg.binding)) {
363 node->process_input(value);
364 }
365 }
366
367 // Release hazard pointer
368 m_hazard_ptrs[slot].store(nullptr);
369#else
370 auto current_regs = m_registrations.load();
371
372 for (const auto& reg : *current_regs) {
373 auto node = reg.node.lock();
374 if (!node)
375 continue;
376
377 if (matches_binding(value, reg.binding)) {
378 node->process_input(value);
379 }
380 }
381#endif
382}
glm::vec3 value
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, matches_binding(), and value.

Referenced by processing_loop().

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