MCPcopy Create free account
hub / github.com/MITK/MITK / CheckConvertibility

Function CheckConvertibility

Modules/CppMicroServices/test/usServiceTrackerTest.cpp:29–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using namespace us;
28
29bool CheckConvertibility(const std::vector<ServiceReferenceU>& refs,
30 std::vector<std::string>::const_iterator idBegin,
31 std::vector<std::string>::const_iterator idEnd)
32{
33 std::vector<std::string> ids;
34 ids.assign(idBegin, idEnd);
35
36 for (std::vector<ServiceReferenceU>::const_iterator sri = refs.begin();
37 sri != refs.end(); ++sri)
38 {
39 for (std::vector<std::string>::iterator idIter = ids.begin();
40 idIter != ids.end(); ++idIter)
41 {
42 if (sri->IsConvertibleTo(*idIter))
43 {
44 ids.erase(idIter);
45 break;
46 }
47 }
48 }
49
50 return ids.empty();
51}
52
53struct MyInterfaceOne {
54 virtual ~MyInterfaceOne() {}

Callers 1

TestServiceTrackerFunction · 0.85

Calls 5

beginMethod · 0.45
endMethod · 0.45
IsConvertibleToMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected