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

◆ get_registered_node_count()

size_t MayaFlux::Core::InputManager::get_registered_node_count ( ) const

Get count of registered nodes.

Definition at line 278 of file InputManager.cpp.

279{
280#ifdef MAYAFLUX_PLATFORM_MACOS
281 // Brief hazard pointer acquisition for count
282 size_t slot = m_hazard_counter.fetch_add(1) % MAX_READERS;
283 const RegistrationList* current;
284 do {
285 current = m_registrations.load();
286 m_hazard_ptrs[slot].store(current);
287 } while (current != m_registrations.load());
288
289 size_t count = current->size();
290 m_hazard_ptrs[slot].store(nullptr);
291 return count;
292#else
293 return m_registrations.load()->size();
294#endif
295}
Eigen::Index count
std::vector< NodeRegistration > RegistrationList
std::atomic< std::shared_ptr< const RegistrationList > > m_registrations

References count, and m_registrations.