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

149{
150 auto it = m_registrations.find(id);
151 if (it == m_registrations.end())
152 return nullptr;
153 if (auto* ptr = std::get_if<std::shared_ptr<Agent>>(&it->second.member)) {
154 return *ptr;
155 }
156 return nullptr;
157}
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: