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

Method Set

lib/base/dictionary.cpp:90–99  ·  view source on GitHub ↗

* Sets a value in the dictionary. * * @param key The key. * @param value The value. */

Source from the content-addressed store, hash-verified

88 * @param value The value.
89 */
90void Dictionary::Set(const String& key, Value value)
91{
92 ObjectLock olock(this);
93 std::unique_lock<std::shared_timed_mutex> lock (m_DataMutex);
94
95 if (m_Frozen)
96 BOOST_THROW_EXCEPTION(std::invalid_argument("Value in dictionary must not be modified."));
97
98 m_Data[key] = std::move(value);
99}
100
101/**
102 * Returns the number of elements in the dictionary.

Callers 1

CopyToMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected