summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-20 19:36:18 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-20 19:36:18 (GMT)
commit2c81e5fb5cd592e9450250364e6667082014f0b7 (patch)
tree8897bcaca936aaedba35f3153f976b315b912329 /Source/cmMakefile.h
parenta541cac325715cd50f604ede864eba8edfbb2673 (diff)
downloadCMake-2c81e5fb5cd592e9450250364e6667082014f0b7.zip
CMake-2c81e5fb5cd592e9450250364e6667082014f0b7.tar.gz
CMake-2c81e5fb5cd592e9450250364e6667082014f0b7.tar.bz2
ENH: Refactor function blocker deletion
When a function blocker decides to remove itself we previously removed it at every return point from the C++ scope in which its removal is needed. This teaches function blockers to transfer ownership of themselves from cmMakefile to an automatic variable for deletion on return. Since this removes blockers before they replay their commands, we no longer need to avoid running blockers on their own commands.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 6a09042..6da3646 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -31,6 +31,7 @@
#include "cmSourceGroup.h"
#endif
+#include <cmsys/auto_ptr.hxx>
#include <cmsys/RegularExpression.hxx>
class cmFunctionBlocker;
@@ -89,9 +90,13 @@ public:
*/
void AddFunctionBlocker(cmFunctionBlocker *fb)
{ this->FunctionBlockers.push_back(fb);}
- void RemoveFunctionBlocker(cmFunctionBlocker *fb)
- { this->FunctionBlockers.remove(fb);}
- void RemoveFunctionBlocker(const cmListFileFunction& lff);
+
+ /**
+ * Remove the function blocker whose scope ends with the given command.
+ * This returns ownership of the function blocker object.
+ */
+ cmsys::auto_ptr<cmFunctionBlocker>
+ RemoveFunctionBlocker(const cmListFileFunction& lff);
/**
* Try running cmake and building a file. This is used for dynalically