forward.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. //
  3. // Copyright (c) 2019-2022 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
  4. //
  5. // Distributed under the MIT Software License
  6. //
  7. #include <functional>
  8. #include "arc.hpp"
  9. #include <boost/date_time/posix_time/posix_time.hpp>
  10. namespace rotor {
  11. struct address_t;
  12. struct actor_base_t;
  13. struct handler_base_t;
  14. struct supervisor_t;
  15. struct system_context_t;
  16. using address_ptr_t = intrusive_ptr_t<address_t>;
  17. /** \brief intrusive pointer for actor*/
  18. using actor_ptr_t = intrusive_ptr_t<actor_base_t>;
  19. /** \brief intrusive pointer for handler */
  20. using handler_ptr_t = intrusive_ptr_t<handler_base_t>;
  21. /** \brief intrusive pointer for supervisor */
  22. using supervisor_ptr_t = intrusive_ptr_t<supervisor_t>;
  23. namespace pt = boost::posix_time;
  24. /** \brief timer identifier type in the scope of the actor */
  25. using request_id_t = std::size_t;
  26. /** \brief factory which allows to create actors lazily or on demand
  27. *
  28. * The spawner address MUST be set to the newly created actor to
  29. * allow further spawning.
  30. *
  31. * This function might throw an exception, which is however ignored,
  32. * but spawner might attempt to create new actor instance.
  33. *
  34. */
  35. using factory_t = std::function<actor_ptr_t(supervisor_t &, const address_ptr_t &)>;
  36. } // namespace rotor
  37. namespace rotor::plugin {
  38. struct plugin_base_t;
  39. }