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

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

References count, and m_registrations.