address_maker.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. //
  3. // Copyright (c) 2019-2020 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
  4. //
  5. // Distributed under the MIT Software License
  6. //
  7. #include "plugin_base.h"
  8. namespace rotor::plugin {
  9. /** \struct address_maker_plugin_t
  10. *
  11. * \brief create actor's addresses
  12. *
  13. * The plugin is executed on very early stage of actor creation
  14. * to assing its main address as soon as possible.
  15. *
  16. * If additional addresses are needed by the actor, they can be
  17. * asked via the plugin.
  18. *
  19. */
  20. struct address_maker_plugin_t : public plugin_base_t {
  21. using plugin_base_t::plugin_base_t;
  22. /** The plugin unique identity to allow further static_cast'ing*/
  23. static const void *class_identity;
  24. const void *identity() const noexcept override;
  25. void activate(actor_base_t *actor) noexcept override;
  26. void deactivate() noexcept override;
  27. /** \brief creates additional actor address (on demand)
  28. *
  29. * This is just a shortcut method to create_address() of supervisor
  30. *
  31. */
  32. virtual address_ptr_t create_address() noexcept;
  33. };
  34. } // namespace rotor::plugin