* Sets a value in the dictionary. * * @param key The key. * @param value The value. */
| 88 | * @param value The value. |
| 89 | */ |
| 90 | void 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. |