From 1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Thu, 4 Jul 2019 18:14:22 +0200 Subject: modernize: manage cmCommand instances using unique_ptr. --- Source/cmState.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Source/cmState.h') 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 command); + void AddDisallowedCommand(std::string const& name, + std::unique_ptr 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 command); void RemoveBuiltinCommand(std::string const& name); void RemoveUserDefinedCommands(); std::vector GetCommandNames() const; @@ -209,8 +212,8 @@ private: std::map PropertyDefinitions; std::vector EnabledLanguages; - std::map BuiltinCommands; - std::map ScriptedCommands; + std::map> BuiltinCommands; + std::map> ScriptedCommands; cmPropertyMap GlobalProperties; std::unique_ptr CacheManager; std::unique_ptr GlobVerificationManager; -- cgit v1.2.1