summaryrefslogtreecommitdiff
path: root/Source/cmState.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-07-04 18:14:22 +0200
committerMarc Chevrier <marc.chevrier@gmail.com>2019-07-14 15:37:30 +0200
commit1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb (patch)
tree4db8440a950a88b7c15ea43218f98f61775bf889 /Source/cmState.h
parentd9b2c7dae242868f13fc366773fb09448da26e8d (diff)
downloadcmake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.tar.gz
modernize: manage cmCommand instances using unique_ptr.
Diffstat (limited to 'Source/cmState.h')
-rw-r--r--Source/cmState.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmState.h b/Source/cmState.h
index 0649acea7b..7e88030cbb 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -146,11 +146,14 @@ public:
// Returns a command from its name, or nullptr
cmCommand* GetCommandByExactName(std::string const& name) const;
- void AddBuiltinCommand(std::string const& name, cmCommand* command);
- void AddDisallowedCommand(std::string const& name, cmCommand* command,
+ void AddBuiltinCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command);
+ void AddDisallowedCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command,
cmPolicies::PolicyID policy, const char* message);
void AddUnexpectedCommand(std::string const& name, const char* error);
- void AddScriptedCommand(std::string const& name, cmCommand* command);
+ void AddScriptedCommand(std::string const& name,
+ std::unique_ptr<cmCommand> command);
void RemoveBuiltinCommand(std::string const& name);
void RemoveUserDefinedCommands();
std::vector<std::string> GetCommandNames() const;
@@ -209,8 +212,8 @@ private:
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions;
std::vector<std::string> EnabledLanguages;
- std::map<std::string, cmCommand*> BuiltinCommands;
- std::map<std::string, cmCommand*> ScriptedCommands;
+ std::map<std::string, std::unique_ptr<cmCommand>> BuiltinCommands;
+ std::map<std::string, std::unique_ptr<cmCommand>> ScriptedCommands;
cmPropertyMap GlobalProperties;
std::unique_ptr<cmCacheManager> CacheManager;
std::unique_ptr<cmGlobVerificationManager> GlobVerificationManager;