MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / FindNeighborOnDevice

Method FindNeighborOnDevice

Src/Core/Profiler.cpp:1189–1201  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1187
1188////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1189FSecure::C3::Core::Profiler::Agent* FSecure::C3::Core::Profiler::Gateway::FindNeighborOnDevice(Relay& relay, DeviceId did)
1190{
1191 auto& routes = relay.m_Routes.GetUnderlyingContainer();
1192 auto it = std::find_if(routes.begin(), routes.end(), [&](auto& e) { return e.m_IsNeighbour && e.m_OutgoingDevice == did; });
1193 if (it == routes.end())
1194 throw std::logic_error{ "There is no route from provided agent" };
1195
1196 auto ret = m_Agents.Find(it->m_Id.GetAgentId());
1197 if (!ret)
1198 throw std::logic_error{ "There is no route from provided agent" };
1199
1200 return ret;
1201}
1202
1203////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1204void FSecure::C3::Core::Profiler::Gateway::UpdateRouteTimestamps(AgentId agentId, int32_t timestamp)

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
endMethod · 0.45
FindMethod · 0.45
GetAgentIdMethod · 0.45

Tested by

no test coverage detected