foreigners_support.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 foreigners_support_plugin_t
  10. *
  11. * \brief allows non-local actors to subscribe on the local addresses of a supervisor.
  12. */
  13. struct foreigners_support_plugin_t : public plugin_base_t {
  14. using plugin_base_t::plugin_base_t;
  15. /** The plugin unique identity to allow further static_cast'ing*/
  16. static const void *class_identity;
  17. const void *identity() const noexcept override;
  18. void activate(actor_base_t *actor) noexcept override;
  19. void deactivate() noexcept override;
  20. /** \brief handler for message call */
  21. virtual void on_call(message::handler_call_t &message) noexcept;
  22. /** \brief unsubscription message handler */
  23. virtual void on_unsubscription(message::commit_unsubscription_t &message) noexcept;
  24. /** \brief external unsubscription message handler */
  25. virtual void on_subscription_external(message::external_subscription_t &message) noexcept;
  26. private:
  27. subscription_container_t foreign_points;
  28. };
  29. } // namespace rotor::plugin