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

◆ kind()

Fabric::Kind MayaFlux::Nexus::Fabric::kind ( uint32_t  id) const

Return the kind of entity registered under id.

Exceptions
std::out_of_rangeif id is not registered.

Definition at line 129 of file Fabric.cpp.

130{
131 const auto& reg = m_registrations.at(id);
132 return std::visit([](const auto& ptr) -> Kind {
133 using T = std::decay_t<decltype(*ptr)>;
134 if constexpr (std::is_same_v<T, Emitter>) {
135 return Kind::Emitter;
136 } else if constexpr (std::is_same_v<T, Sensor>) {
137 return Kind::Sensor;
138 } else {
139 return Kind::Agent;
140 }
141 },
142 reg.member);
143}
const uint8_t * ptr
std::unordered_map< uint32_t, Registration > m_registrations
Definition Fabric.hpp:293

References Agent, Emitter, m_registrations, ptr, and Sensor.

Referenced by MayaFlux::Nexus::StateEncoder::encode_fabric().

+ Here is the caller graph for this function: