cmExecutionStatus.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. void Clear()
  15. {
  16. this->ReturnInvoked = false;
  17. this->BreakInvoked = false;
  18. this->ContinueInvoked = false;
  19. this->NestedError = false;
  20. }
  21. void SetReturnInvoked() { this->ReturnInvoked = true; }
  22. bool GetReturnInvoked() const { return this->ReturnInvoked; }
  23. void SetBreakInvoked() { this->BreakInvoked = true; }
  24. bool GetBreakInvoked() const { return this->BreakInvoked; }
  25. void SetContinueInvoked() { this->ContinueInvoked = true; }
  26. bool GetContinueInvoked() const { return this->ContinueInvoked; }
  27. void SetNestedError() { this->NestedError = true; }
  28. bool GetNestedError() const { return this->NestedError; }
  29. private:
  30. bool ReturnInvoked = false;
  31. bool BreakInvoked = false;
  32. bool ContinueInvoked = false;
  33. bool NestedError = false;
  34. };
  35. #endif