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

◆ get_sensor()

std::shared_ptr< Sensor > MayaFlux::Nexus::Fabric::get_sensor ( uint32_t  id) const

Get the Sensor registered under id.

Returns
The Sensor, or nullptr if id is not a Sensor or not registered.

Definition at line 137 of file Fabric.cpp.

138{
139 auto it = m_registrations.find(id);
140 if (it == m_registrations.end())
141 return nullptr;
142 if (auto* ptr = std::get_if<std::shared_ptr<Sensor>>(&it->second.member)) {
143 return *ptr;
144 }
145 return nullptr;
146}
std::unordered_map< uint32_t, Registration > m_registrations
Definition Fabric.hpp:225

References m_registrations.

Referenced by MayaFlux::Nexus::StateDecoder::decode(), MayaFlux::Nexus::StateEncoder::encode(), and MayaFlux::Nexus::StateDecoder::reconstruct().

+ Here is the caller graph for this function: