cmFunctionBlocker.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmFunctionBlocker_h
  11. #define cmFunctionBlocker_h
  12. #include "cmStandardIncludes.h"
  13. #include "cmExecutionStatus.h"
  14. #include "cmListFileCache.h"
  15. class cmMakefile;
  16. class cmFunctionBlocker
  17. {
  18. public:
  19. /**
  20. * should a function be blocked
  21. */
  22. virtual bool IsFunctionBlocked(const cmListFileFunction& lff,
  23. cmMakefile&mf,
  24. cmExecutionStatus &status) = 0;
  25. /**
  26. * should this function blocker be removed, useful when one function adds a
  27. * blocker and another must remove it
  28. */
  29. virtual bool ShouldRemove(const cmListFileFunction&,
  30. cmMakefile&) {return false;}
  31. virtual ~cmFunctionBlocker() {}
  32. /** Set/Get the context in which this blocker is created. */
  33. void SetStartingContext(cmListFileContext const& lfc)
  34. { this->StartingContext = lfc; }
  35. cmListFileContext const& GetStartingContext() const
  36. { return this->StartingContext; }
  37. private:
  38. cmListFileContext StartingContext;
  39. };
  40. #endif