cmExportSetMap.cxx 683 B

12345678910111213141516171819202122232425262728293031
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmExportSetMap.h"
  4. #include "cmAlgorithms.h"
  5. #include "cmExportSet.h"
  6. #include <utility>
  7. cmExportSet* cmExportSetMap::operator[](const std::string& name)
  8. {
  9. auto it = this->find(name);
  10. if (it == this->end()) // Export set not found
  11. {
  12. it = this->insert(std::make_pair(name, new cmExportSet(name))).first;
  13. }
  14. return it->second;
  15. }
  16. void cmExportSetMap::clear()
  17. {
  18. cmDeleteAll(*this);
  19. this->derived::clear();
  20. }
  21. cmExportSetMap::cmExportSetMap() = default;
  22. cmExportSetMap::~cmExportSetMap()
  23. {
  24. this->clear();
  25. }