MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetByName

Method GetByName

lib/db_ido/dbtype.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42DbType::Ptr DbType::GetByName(const String& name)
43{
44 String typeName;
45
46 if (name == "CheckCommand" || name == "NotificationCommand" || name == "EventCommand")
47 typeName = "Command";
48 else
49 typeName = name;
50
51 std::unique_lock<std::mutex> lock(GetStaticMutex());
52 auto it = GetTypes().find(typeName);
53
54 if (it == GetTypes().end())
55 return nullptr;
56
57 return it->second;
58}
59
60DbType::Ptr DbType::GetByID(long tid)
61{

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected