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

Method FindDevice

Src/Core/Relay.cpp:84–99  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

82
83////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
84std::shared_ptr<FSecure::C3::Core::DeviceBridge> FSecure::C3::Core::Relay::FindDevice(DeviceId did)
85{
86 std::shared_ptr<FSecure::C3::Core::DeviceBridge> retVal;
87 m_Devices.Find([&did, &retVal](std::weak_ptr<DeviceBridge> const& c)
88 {
89 if (auto ri = c.lock(); ri && ri->GetDid() == did)
90 {
91 retVal = std::move(ri);
92 return true;
93 }
94
95 return false;
96 });
97
98 return retVal;
99}
100
101////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
102void FSecure::C3::Core::Relay::Close()

Callers 2

RestoreFromSnapshotMethod · 0.80
ParseAndRunCommandMethod · 0.80

Calls 3

GetDidMethod · 0.80
FindMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected