SObjectizer 5.8
|
An interface of subscription storage. More...
#include <subscription_storage_iface.hpp>
Public Member Functions | |
subscription_storage_t () | |
virtual | ~subscription_storage_t () noexcept=default |
virtual void | create_event_subscription (const mbox_t &mbox, const std::type_index &msg_type, abstract_message_sink_t &message_sink, const state_t &target_state, const event_handler_method_t &method, thread_safety_t thread_safety, event_handler_kind_t handler_kind)=0 |
virtual void | drop_subscription (const mbox_t &mbox, const std::type_index &msg_type, const state_t &target_state) noexcept=0 |
virtual void | drop_subscription_for_all_states (const mbox_t &mbox, const std::type_index &msg_type) noexcept=0 |
virtual void | drop_all_subscriptions () noexcept=0 |
Drop all subscriptions. | |
virtual const event_handler_data_t * | find_handler (mbox_id_t mbox_id, const std::type_index &msg_type, const state_t ¤t_state) const noexcept=0 |
virtual void | debug_dump (std::ostream &to) const =0 |
virtual void | drop_content () noexcept=0 |
Drop all content. | |
virtual subscription_storage_common::subscr_info_vector_t | query_content () const =0 |
virtual void | setup_content (subscription_storage_common::subscr_info_vector_t &&info)=0 |
Setup content from information from another storage object. | |
virtual std::size_t | query_subscriptions_count () const =0 |
Count of subscriptions in the storage. | |
An interface of subscription storage.
Prior to v.5.5.3 there where only one subscription_storage implementation. But this implementation was not efficient for all cases.
Sometimes an agent has very few subscriptions and efficient implementation for that case can be based on std::vector. Sometimes an agent has very many subscriptions and efficient implementation can require std::map or std::unordered_map.
The purpose of this interface is hiding details of concrete subscription_storage implementation.
Definition at line 158 of file subscription_storage_iface.hpp.
so_5::impl::subscription_storage_t::subscription_storage_t | ( | ) |
Definition at line 21 of file subscription_storage_iface.cpp.
|
virtualdefaultnoexcept |
|
pure virtual |
|
pure virtual |
|
pure virtualnoexcept |
Drop all subscriptions.
All subscribed event-handlers have to be unsubscribed. The object should remain in the valid state and creation of new subscriptions have to be allowed.
This method is intended to be used when an agents what to erase all subscriptions at once.
Implemented in so_5::impl::adaptive_subscr_storage::storage_t, so_5::impl::flat_set_based_subscr_storage::storage_t, so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::map_based_subscr_storage::storage_t, and so_5::impl::vector_based_subscr_storage::storage_t.
|
pure virtualnoexcept |
Drop all content.
All information about subscription must be erased, but without real unsubscription.
This method will be called after successful copy of subscription information to another storage.
Implemented in so_5::impl::adaptive_subscr_storage::storage_t, so_5::impl::flat_set_based_subscr_storage::storage_t, so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::map_based_subscr_storage::storage_t, and so_5::impl::vector_based_subscr_storage::storage_t.
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtual |
Get content for copying subscription information to another storage object.
Implemented in so_5::impl::adaptive_subscr_storage::storage_t, so_5::impl::flat_set_based_subscr_storage::storage_t, so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::map_based_subscr_storage::storage_t, and so_5::impl::vector_based_subscr_storage::storage_t.
|
pure virtual |
Count of subscriptions in the storage.
Implemented in so_5::impl::adaptive_subscr_storage::storage_t, so_5::impl::flat_set_based_subscr_storage::storage_t, so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::map_based_subscr_storage::storage_t, and so_5::impl::vector_based_subscr_storage::storage_t.
|
pure virtual |
Setup content from information from another storage object.
Implemented in so_5::impl::adaptive_subscr_storage::storage_t, so_5::impl::flat_set_based_subscr_storage::storage_t, so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::map_based_subscr_storage::storage_t, and so_5::impl::vector_based_subscr_storage::storage_t.