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

◆ unrelate()

bool MayaFlux::Portal::Forma::Layer::unrelate ( uint32_t  primary_id,
uint32_t  related_id 
)

Remove a specific relation between two elements.

Does not remove either element from the layer.

Definition at line 170 of file Layer.cpp.

171{
172 auto it = m_relations.find(primary_id);
173 if (it == m_relations.end())
174 return false;
175 auto& rel = it->second;
176 auto rit = std::ranges::find(rel, related_id);
177 if (rit == rel.end())
178 return false;
179 rel.erase(rit);
180 if (rel.empty())
181 m_relations.erase(it);
182 return true;
183}
std::unordered_map< uint32_t, std::vector< uint32_t > > m_relations
Definition Layer.hpp:283

References m_relations.