count.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_COUNT_H
  12. #define API_COUNT_H
  13. #include "generated/gen_count.h"
  14. #include "api/api_common.h"
  15. #include "api/count_term.h"
  16. namespace MCell {
  17. class MolOrRxnCountEvent;
  18. namespace API {
  19. class Count: public GenCount {
  20. public:
  21. COUNT_CTOR()
  22. void set_all_custom_attributes_to_default() override {
  23. count_event = nullptr;
  24. }
  25. void postprocess_in_ctor() override;
  26. void check_semantics() const override;
  27. double get_current_value() override;
  28. // count event, owned by Scheduler if every_n_timesteps > 0,
  29. // owned by World if every_n_timesteps == 0
  30. MolOrRxnCountEvent* count_event;
  31. private:
  32. void set_automatically_output_format_if_needed();
  33. };
  34. } // namespace API
  35. } // namespace MCell
  36. #endif // API_COUNT_H