| 30 | } |
| 31 | |
| 32 | int ElementRepository::GetManagedElement(const std::string& element_id, |
| 33 | ElementHandle* element_wrapper) const { |
| 34 | LOG(TRACE) << "Entering ElementRepository::GetManagedElement"; |
| 35 | |
| 36 | ElementMap::const_iterator found_iterator = this->managed_elements_.find(element_id); |
| 37 | if (found_iterator == this->managed_elements_.end()) { |
| 38 | LOG(DEBUG) << "Unable to find managed element with id " << element_id; |
| 39 | return ENOSUCHELEMENT; |
| 40 | } |
| 41 | |
| 42 | *element_wrapper = found_iterator->second; |
| 43 | return WD_SUCCESS; |
| 44 | } |
| 45 | |
| 46 | bool ElementRepository::AddManagedElement(ElementHandle element_wrapper) { |
| 47 | this->managed_elements_[element_wrapper->element_id()] = element_wrapper; |
no test coverage detected