actor_test.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Copyright (c) 2019-2020 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
  3. //
  4. // Distributed under the MIT Software License
  5. //
  6. #pragma once
  7. #include "rotor/actor_base.h"
  8. #include <list>
  9. #include <functional>
  10. namespace rotor {
  11. namespace test {
  12. struct actor_test_t;
  13. using plugin_configurer_t = std::function<void(actor_base_t &self, plugin::plugin_base_t &)>;
  14. using shutdown_fn_t = std::function<void(actor_test_t &self)>;
  15. struct actor_test_t : public actor_base_t {
  16. using actor_base_t::actor_base_t;
  17. ~actor_test_t();
  18. plugin_configurer_t configurer;
  19. shutdown_fn_t shutdowner;
  20. void configure(plugin::plugin_base_t &plugin) noexcept override;
  21. auto &get_plugins() const noexcept { return plugins; }
  22. auto get_activating_plugins() noexcept { return this->activating_plugins; }
  23. auto get_deactivating_plugins() noexcept { return this->deactivating_plugins; }
  24. auto &get_state() noexcept { return state; }
  25. void shutdown_finish() noexcept override;
  26. void force_cleanup() noexcept;
  27. };
  28. } // namespace test
  29. } // namespace rotor