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

Method GetByTypeAndName

lib/config/configitem.cpp:377–392  ·  view source on GitHub ↗

* Retrieves a configuration item by type and name. * * @param type The type of the ConfigItem that is to be looked up. * @param name The name of the ConfigItem that is to be looked up. * @returns The configuration item. */

Source from the content-addressed store, hash-verified

375 * @returns The configuration item.
376 */
377ConfigItem::Ptr ConfigItem::GetByTypeAndName(const Type::Ptr& type, const String& name)
378{
379 std::unique_lock<std::mutex> lock(m_Mutex);
380
381 auto it = m_Items.find(type);
382
383 if (it == m_Items.end())
384 return nullptr;
385
386 auto it2 = it->second.find(name);
387
388 if (it2 == it->second.end())
389 return nullptr;
390
391 return it2->second;
392}
393
394bool ConfigItem::CommitNewItems(const ActivationContext::Ptr& context, WorkQueue& upq, std::vector<ConfigItem::Ptr>& newItems)
395{

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected