* Sets the property using the provided name * @param property name * @param value property value. * @return result of setting property. */
| 99 | * @return result of setting property. |
| 100 | */ |
| 101 | bool ConfigurableComponent::updateProperty(const std::string &name, const std::string &value) { |
| 102 | std::lock_guard<std::mutex> lock(configuration_mutex_); |
| 103 | auto &&it = properties_.find(name); |
| 104 | |
| 105 | if (it != properties_.end()) { |
| 106 | Property orig_property = it->second; |
| 107 | Property& new_property = it->second; |
| 108 | auto onExit = gsl::finally([&] { |
| 109 | onPropertyModified(orig_property, new_property); |
| 110 | logger_->log_debug("Component %s property name %s value %s", name, new_property.getName(), value); |
| 111 | }); |
| 112 | new_property.addValue(value); |
| 113 | return true; |
| 114 | } else { |
| 115 | return false; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Sets the property using the provided name |