cmake/Source/cmExportSetMap.cxx

30 lines
679 B
C++
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2013-03-16 19:13:01 +02:00
#include "cmExportSetMap.h"
2016-07-09 11:21:54 +02:00
2015-08-17 11:37:30 +02:00
#include "cmAlgorithms.h"
2016-07-09 11:21:54 +02:00
#include "cmExportSet.h"
2013-03-16 19:13:01 +02:00
2016-10-30 18:24:19 +01:00
#include <utility>
2016-07-09 11:21:54 +02:00
cmExportSet* cmExportSetMap::operator[](const std::string& name)
2013-03-16 19:13:01 +02:00
{
std::map<std::string, cmExportSet*>::iterator it = this->find(name);
if (it == this->end()) // Export set not found
2016-07-09 11:21:54 +02:00
{
2013-03-16 19:13:01 +02:00
it = this->insert(std::make_pair(name, new cmExportSet(name))).first;
2016-07-09 11:21:54 +02:00
}
2013-03-16 19:13:01 +02:00
return it->second;
}
2014-08-03 19:52:23 +02:00
void cmExportSetMap::clear()
2013-03-16 19:13:01 +02:00
{
2015-04-27 22:25:09 +02:00
cmDeleteAll(*this);
2014-08-03 19:52:23 +02:00
this->derived::clear();
}
cmExportSetMap::~cmExportSetMap()
{
this->clear();
2013-03-16 19:13:01 +02:00
}