cmFunctionBlocker.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmFunctionBlocker_h
  4. #define cmFunctionBlocker_h
  5. #include <cmConfigure.h>
  6. #include "cmStandardIncludes.h"
  7. #include "cmExecutionStatus.h"
  8. #include "cmListFileCache.h"
  9. class cmMakefile;
  10. class cmFunctionBlocker
  11. {
  12. public:
  13. /**
  14. * should a function be blocked
  15. */
  16. virtual bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
  17. cmExecutionStatus& status) = 0;
  18. /**
  19. * should this function blocker be removed, useful when one function adds a
  20. * blocker and another must remove it
  21. */
  22. virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile&)
  23. {
  24. return false;
  25. }
  26. virtual ~cmFunctionBlocker() {}
  27. /** Set/Get the context in which this blocker is created. */
  28. void SetStartingContext(cmListFileContext const& lfc)
  29. {
  30. this->StartingContext = lfc;
  31. }
  32. cmListFileContext const& GetStartingContext() const
  33. {
  34. return this->StartingContext;
  35. }
  36. private:
  37. cmListFileContext StartingContext;
  38. };
  39. #endif