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 150 of file Fabric.cpp.

151{
152 auto it = m_registrations.find(id);
153 if (it == m_registrations.end())
154 return nullptr;
155 if (auto* ptr = std::get_if<std::shared_ptr<Sensor>>(&it->second.member)) {
156 return *ptr;
157 }
158 return nullptr;
159}
const uint8_t * ptr
std::unordered_map< uint32_t, Registration > m_registrations
Definition Fabric.hpp:292

References m_registrations, and ptr.

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

+ Here is the caller graph for this function: