initial_surface_release.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_INITIAL_SURFACE_RELEASE_H
  12. #define API_INITIAL_SURFACE_RELEASE_H
  13. #include "generated/gen_initial_surface_release.h"
  14. #include "api/api_common.h"
  15. #include "api/complex.h"
  16. namespace MCell {
  17. namespace API {
  18. class InitialSurfaceRelease: public GenInitialSurfaceRelease {
  19. public:
  20. INITIAL_SURFACE_RELEASE_CTOR()
  21. void check_semantics() const override {
  22. if (get_num_set(number_to_release, density) != 1) {
  23. throw ValueError(S("Exactly one of ") + NAME_NUMBER_TO_RELEASE + " and " +
  24. NAME_DENSITY + " must be set.");
  25. }
  26. if (is_set(complex->compartment_name)) {
  27. throw ValueError(S("Compartment of the complex to be released in ") +
  28. NAME_CLASS_INITIAL_SURFACE_RELEASE + " must not be set.");
  29. }
  30. }
  31. };
  32. } // namespace API
  33. } // namespace MCell
  34. #endif // API_INITIAL_SURFACE_RELEASE_H