Remove unused cmData and cmMakefile::DataMap
These were implementation details of the unused methods cmMakefile::RegisterData cmMakefile::LookupData We simply remove the methods, members, and class cmData.
This commit is contained in:
parent
36d850b87e
commit
6e1b510319
|
@ -1,38 +0,0 @@
|
||||||
/*============================================================================
|
|
||||||
CMake - Cross Platform Makefile Generator
|
|
||||||
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
||||||
|
|
||||||
Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
see accompanying file Copyright.txt for details.
|
|
||||||
|
|
||||||
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
See the License for more information.
|
|
||||||
============================================================================*/
|
|
||||||
#ifndef cmData_h
|
|
||||||
#define cmData_h
|
|
||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
|
||||||
|
|
||||||
/** \class cmData
|
|
||||||
* \brief Hold extra data on a cmMakefile instance for a command.
|
|
||||||
*
|
|
||||||
* When CMake commands need to store extra information in a cmMakefile
|
|
||||||
* instance, but the information is not needed by the makefile generators,
|
|
||||||
* it can be held in a subclass of cmData. The cmMakefile class has a map
|
|
||||||
* from std::string to cmData*. On its destruction, it destroys all the
|
|
||||||
* extra data through the virtual destructor of cmData.
|
|
||||||
*/
|
|
||||||
class cmData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
cmData(const char* name): Name(name) {}
|
|
||||||
virtual ~cmData() {}
|
|
||||||
|
|
||||||
const std::string& GetName() const
|
|
||||||
{ return this->Name; }
|
|
||||||
protected:
|
|
||||||
std::string Name;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -124,7 +124,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
|
||||||
|
|
||||||
this->LocalGenerator = mf.LocalGenerator;
|
this->LocalGenerator = mf.LocalGenerator;
|
||||||
this->FunctionBlockers = mf.FunctionBlockers;
|
this->FunctionBlockers = mf.FunctionBlockers;
|
||||||
this->DataMap = mf.DataMap;
|
|
||||||
this->MacrosMap = mf.MacrosMap;
|
this->MacrosMap = mf.MacrosMap;
|
||||||
this->SubDirectoryOrder = mf.SubDirectoryOrder;
|
this->SubDirectoryOrder = mf.SubDirectoryOrder;
|
||||||
this->Properties = mf.Properties;
|
this->Properties = mf.Properties;
|
||||||
|
@ -200,14 +199,6 @@ cmMakefile::~cmMakefile()
|
||||||
{
|
{
|
||||||
delete this->UsedCommands[i];
|
delete this->UsedCommands[i];
|
||||||
}
|
}
|
||||||
for(DataMapType::const_iterator d = this->DataMap.begin();
|
|
||||||
d != this->DataMap.end(); ++d)
|
|
||||||
{
|
|
||||||
if(d->second)
|
|
||||||
{
|
|
||||||
delete d->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::vector<cmFunctionBlocker*>::iterator pos;
|
std::vector<cmFunctionBlocker*>::iterator pos;
|
||||||
for (pos = this->FunctionBlockers.begin();
|
for (pos = this->FunctionBlockers.begin();
|
||||||
pos != this->FunctionBlockers.end(); ++pos)
|
pos != this->FunctionBlockers.end(); ++pos)
|
||||||
|
@ -2593,54 +2584,6 @@ void cmMakefile::SetHomeOutputDirectory(const char* lib)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the given cmData instance with its own name.
|
|
||||||
*/
|
|
||||||
void cmMakefile::RegisterData(cmData* data)
|
|
||||||
{
|
|
||||||
std::string name = data->GetName();
|
|
||||||
DataMapType::const_iterator d = this->DataMap.find(name);
|
|
||||||
if((d != this->DataMap.end()) && (d->second != 0) && (d->second != data))
|
|
||||||
{
|
|
||||||
delete d->second;
|
|
||||||
}
|
|
||||||
this->DataMap[name] = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the given cmData instance with the given name. This can be used
|
|
||||||
* to register a NULL pointer.
|
|
||||||
*/
|
|
||||||
void cmMakefile::RegisterData(const char* name, cmData* data)
|
|
||||||
{
|
|
||||||
DataMapType::const_iterator d = this->DataMap.find(name);
|
|
||||||
if((d != this->DataMap.end()) && (d->second != 0) && (d->second != data))
|
|
||||||
{
|
|
||||||
delete d->second;
|
|
||||||
}
|
|
||||||
this->DataMap[name] = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lookup a cmData instance previously registered with the given name. If
|
|
||||||
* the instance cannot be found, return NULL.
|
|
||||||
*/
|
|
||||||
cmData* cmMakefile::LookupData(const char* name) const
|
|
||||||
{
|
|
||||||
DataMapType::const_iterator d = this->DataMap.find(name);
|
|
||||||
if(d != this->DataMap.end())
|
|
||||||
{
|
|
||||||
return d->second;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmSourceFile* cmMakefile::GetSource(const char* sourceName)
|
cmSourceFile* cmMakefile::GetSource(const char* sourceName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#define cmMakefile_h
|
#define cmMakefile_h
|
||||||
|
|
||||||
#include "cmCacheManager.h"
|
#include "cmCacheManager.h"
|
||||||
#include "cmData.h"
|
|
||||||
#include "cmExecutionStatus.h"
|
#include "cmExecutionStatus.h"
|
||||||
#include "cmListFileCache.h"
|
#include "cmListFileCache.h"
|
||||||
#include "cmPolicies.h"
|
#include "cmPolicies.h"
|
||||||
|
@ -692,10 +691,6 @@ public:
|
||||||
std::vector<cmSourceGroup> &groups);
|
std::vector<cmSourceGroup> &groups);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void RegisterData(cmData*);
|
|
||||||
void RegisterData(const char*, cmData*);
|
|
||||||
cmData* LookupData(const char*) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a single CMake command. Returns true if the command
|
* Execute a single CMake command. Returns true if the command
|
||||||
* succeeded or false if it failed.
|
* succeeded or false if it failed.
|
||||||
|
@ -916,9 +911,6 @@ private:
|
||||||
void PushFunctionBlockerBarrier();
|
void PushFunctionBlockerBarrier();
|
||||||
void PopFunctionBlockerBarrier(bool reportError = true);
|
void PopFunctionBlockerBarrier(bool reportError = true);
|
||||||
|
|
||||||
typedef std::map<cmStdString, cmData*> DataMapType;
|
|
||||||
DataMapType DataMap;
|
|
||||||
|
|
||||||
typedef std::map<cmStdString, cmStdString> StringStringMap;
|
typedef std::map<cmStdString, cmStdString> StringStringMap;
|
||||||
StringStringMap MacrosMap;
|
StringStringMap MacrosMap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue