cmFunctionBlocker.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmFunctionBlocker_h
  14. #define cmFunctionBlocker_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmExecutionStatus.h"
  17. #include "cmListFileCache.h"
  18. class cmMakefile;
  19. /** \class cmFunctionBlocker
  20. * \brief A class that defines an interface for blocking cmake functions
  21. *
  22. * This is the superclass for any classes that need to block a cmake function
  23. */
  24. class cmFunctionBlocker
  25. {
  26. public:
  27. /**
  28. * should a function be blocked
  29. */
  30. virtual bool IsFunctionBlocked(const cmListFileFunction& lff,
  31. cmMakefile&mf,
  32. cmExecutionStatus &status) = 0;
  33. /**
  34. * should this function blocker be removed, useful when one function adds a
  35. * blocker and another must remove it
  36. */
  37. virtual bool ShouldRemove(const cmListFileFunction&,
  38. cmMakefile&) {return false;}
  39. virtual ~cmFunctionBlocker() {}
  40. /** Set/Get the context in which this blocker is created. */
  41. void SetStartingContext(cmListFileContext const& lfc)
  42. { this->StartingContext = lfc; }
  43. cmListFileContext const& GetStartingContext()
  44. { return this->StartingContext; }
  45. private:
  46. cmListFileContext StartingContext;
  47. };
  48. #endif