warnings.h 1021 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #ifndef API_WARNINGS_H
  12. #define API_WARNINGS_H
  13. #include "generated/gen_warnings.h"
  14. #include "api/api_common.h"
  15. namespace MCell {
  16. namespace API {
  17. class Warnings: public GenWarnings {
  18. public:
  19. WARNINGS_CTOR()
  20. // must be called also manually during model initialization
  21. void check_semantics() const override {
  22. if (high_reaction_probability == WarningLevel::ERROR) {
  23. throw ValueError(S(NAME_CLASS_WARNINGS) + "." + NAME_HIGH_REACTION_PROBABILITY + " must not be set to " +
  24. NAME_ENUM_WARNING_LEVEL + "." + NAME_EV_ERROR + ".");
  25. }
  26. }
  27. };
  28. } // namespace API
  29. } // namespace MCell
  30. #endif // API_WARNINGS_H