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