cmFunctionBlocker.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "cmListFileCache.h"
  6. class cmExecutionStatus;
  7. class cmMakefile;
  8. class cmFunctionBlocker
  9. {
  10. public:
  11. /**
  12. * should a function be blocked
  13. */
  14. virtual bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
  15. cmExecutionStatus& status) = 0;
  16. /**
  17. * should this function blocker be removed, useful when one function adds a
  18. * blocker and another must remove it
  19. */
  20. virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile&)
  21. {
  22. return false;
  23. }
  24. virtual ~cmFunctionBlocker() {}
  25. /** Set/Get the context in which this blocker is created. */
  26. void SetStartingContext(cmListFileContext const& lfc)
  27. {
  28. this->StartingContext = lfc;
  29. }
  30. cmListFileContext const& GetStartingContext() const
  31. {
  32. return this->StartingContext;
  33. }
  34. private:
  35. cmListFileContext StartingContext;
  36. };
  37. #endif