SObjectizer
5.5
|
An interface of subscription storage. More...
#include <subscription_storage_iface.hpp>
Public Member Functions | |
subscription_storage_t (agent_t *owner) | |
virtual | ~subscription_storage_t () SO_5_NOEXCEPT=default |
virtual void | create_event_subscription (const mbox_t &mbox, const std::type_index &msg_type, const message_limit::control_block_t *limit, const state_t &target_state, const event_handler_method_t &method, thread_safety_t thread_safety)=0 |
virtual void | drop_subscription (const mbox_t &mbox, const std::type_index &msg_type, const state_t &target_state)=0 |
virtual void | drop_subscription_for_all_states (const mbox_t &mbox, const std::type_index &msg_type)=0 |
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 SO_5_NOEXCEPT=0 |
virtual void | debug_dump (std::ostream &to) const =0 |
virtual void | drop_content ()=0 |
Drop all content. More... | |
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. More... | |
virtual std::size_t | query_subscriptions_count () const =0 |
Count of subscriptions in the storage. More... | |
Protected Member Functions | |
agent_t * | owner () const |
Private Attributes | |
agent_t * | m_owner |
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.
so_5::impl::subscription_storage_t::subscription_storage_t | ( | agent_t * | owner | ) |
|
virtualdefault |
|
pure virtual |
|
pure virtual |
|
pure virtual |
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::hash_table_subscr_storage::storage_t, so_5::impl::vector_based_subscr_storage::storage_t, so_5::impl::adaptive_subscr_storage::storage_t, and so_5::impl::map_based_subscr_storage::storage_t.
|
pure virtual |
|
pure virtual |
|
protected |
|
pure virtual |
Get content for copying subscription information to another storage object.
Implemented in so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::vector_based_subscr_storage::storage_t, so_5::impl::adaptive_subscr_storage::storage_t, and so_5::impl::map_based_subscr_storage::storage_t.
|
pure virtual |
Count of subscriptions in the storage.
Implemented in so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::vector_based_subscr_storage::storage_t, so_5::impl::adaptive_subscr_storage::storage_t, and so_5::impl::map_based_subscr_storage::storage_t.
|
pure virtual |
Setup content from information from another storage object.
Implemented in so_5::impl::hash_table_subscr_storage::storage_t, so_5::impl::vector_based_subscr_storage::storage_t, so_5::impl::adaptive_subscr_storage::storage_t, and so_5::impl::map_based_subscr_storage::storage_t.
|
private |