MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / getTrigger

Method getTrigger

src/Core/Triggers/TriggerManager.cpp:13–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 }
12
13 std::weak_ptr<Trigger> TriggerManager::getTrigger(
14 const std::string& space, const std::string& group, const std::string& trigger)
15 {
16 if (m_allTriggers.find(space) != m_allTriggers.end())
17 {
18 if (m_allTriggers[space].find(group) != m_allTriggers[space].end())
19 return m_allTriggers[space][group].lock()->get(trigger);
20 auto& selectedNamespace = m_allTriggers[space];
21 std::vector<std::string> triggerGroupNames(selectedNamespace.size());
22 std::transform(selectedNamespace.begin(), selectedNamespace.end(),
23 triggerGroupNames.begin(), [](const auto& pair) { return pair.first; });
24 throw Exceptions::UnknownTriggerGroup(
25 space, group, triggerGroupNames, EXC_INFO);
26 }
27 std::vector<std::string> namespaces(m_allTriggers.size());
28 std::transform(m_allTriggers.begin(), m_allTriggers.end(), namespaces.begin(),
29 [](const auto& pair) { return pair.first; });
30 throw Exceptions::UnknownTriggerNamespace(space, namespaces, EXC_INFO);
31 }
32
33 void TriggerManager::createNamespace(const std::string& space)
34 {

Callers 2

useTriggerMethod · 0.80
removeTriggerMethod · 0.80

Calls 8

UnknownTriggerGroupClass · 0.85
lockMethod · 0.80
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected