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

◆ get_agent()

std::shared_ptr< Agent > MayaFlux::Nexus::Fabric::get_agent ( uint32_t  id) const

Get the Agent registered under id.

Returns
The Agent, or nullptr if id is not an Agent or not registered.

Definition at line 161 of file Fabric.cpp.

162{
163 auto it = m_registrations.find(id);
164 if (it == m_registrations.end())
165 return nullptr;
166 if (auto* ptr = std::get_if<std::shared_ptr<Agent>>(&it->second.member)) {
167 return *ptr;
168 }
169 return nullptr;
170}
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: