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

Method EventsInbox

lib/remote/eventqueue.cpp:133–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131EventsRouter EventsRouter::m_Instance;
132
133EventsInbox::EventsInbox(String filter, const String& filterSource)
134 : m_Timer(IoEngine::Get().GetIoContext())
135{
136 std::unique_lock<std::mutex> lock (m_FiltersMutex);
137 m_Filter = m_Filters.find(filter);
138
139 if (m_Filter == m_Filters.end()) {
140 lock.unlock();
141
142 auto expr (ConfigCompiler::CompileText(filterSource, filter));
143
144 lock.lock();
145
146 m_Filter = m_Filters.find(filter);
147
148 if (m_Filter == m_Filters.end()) {
149 m_Filter = m_Filters.emplace(std::move(filter), Filter{1, Expression::Ptr(expr.release())}).first;
150 } else {
151 ++m_Filter->second.Refs;
152 }
153 } else {
154 ++m_Filter->second.Refs;
155 }
156}
157
158EventsInbox::~EventsInbox()
159{

Callers

nothing calls this directly

Calls 3

findMethod · 0.80
emplaceMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected