release_pattern.h 1001 B

123456789101112131415161718192021222324252627282930313233343536373839
  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_RELEASE_PATTERN_H
  12. #define API_RELEASE_PATTERN_H
  13. #include "generated/gen_release_pattern.h"
  14. #include "api/api_common.h"
  15. namespace MCell {
  16. namespace API {
  17. class ReleasePattern: public GenReleasePattern {
  18. public:
  19. RELEASE_PATTERN_CTOR()
  20. void check_semantics() const override {
  21. GenReleasePattern::check_semantics();
  22. if (train_interval < train_duration) {
  23. throw ValueError(S(NAME_RELEASE_PATTERN) + name + ": " +
  24. NAME_TRAIN_INTERVAL + " is shorter than " + NAME_TRAIN_DURATION + ".");
  25. }
  26. }
  27. };
  28. } // namespace API
  29. } // namespace MCell
  30. #endif // API_RELEASE_PATTERN_H