cmExecutionStatus.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 cmExecutionStatus_h
  4. #define cmExecutionStatus_h
  5. /** \class cmExecutionStatus
  6. * \brief Superclass for all command status classes
  7. *
  8. * when a command is involked it may set values on a command status instance
  9. */
  10. class cmExecutionStatus
  11. {
  12. public:
  13. cmExecutionStatus()
  14. : ReturnInvoked(false)
  15. , BreakInvoked(false)
  16. , ContinueInvoked(false)
  17. , NestedError(false)
  18. {
  19. }
  20. void Clear()
  21. {
  22. this->ReturnInvoked = false;
  23. this->BreakInvoked = false;
  24. this->ContinueInvoked = false;
  25. this->NestedError = false;
  26. }
  27. void SetReturnInvoked() { this->ReturnInvoked = true; }
  28. bool GetReturnInvoked() const { return this->ReturnInvoked; }
  29. void SetBreakInvoked() { this->BreakInvoked = true; }
  30. bool GetBreakInvoked() const { return this->BreakInvoked; }
  31. void SetContinueInvoked() { this->ContinueInvoked = true; }
  32. bool GetContinueInvoked() const { return this->ContinueInvoked; }
  33. void SetNestedError() { this->NestedError = true; }
  34. bool GetNestedError() const { return this->NestedError; }
  35. private:
  36. bool ReturnInvoked;
  37. bool BreakInvoked;
  38. bool ContinueInvoked;
  39. bool NestedError;
  40. };
  41. #endif