mqtt_cpp
Public Types | Public Member Functions | List of all members
multiple_subscription_map< Key, Value, Hash, Pred, Cont > Class Template Reference

#include <subscription_map.hpp>

Inheritance diagram for multiple_subscription_map< Key, Value, Hash, Pred, Cont >:
Inheritance graph
[legend]
Collaboration diagram for multiple_subscription_map< Key, Value, Hash, Pred, Cont >:
Collaboration graph
[legend]

Public Types

using container_t = Cont
 
using handle = typename subscription_map_base< Value >::handle
 
- Public Types inherited from subscription_map_base< std::unordered_map< Key, Value, std::hash< Key >, std::equal_to< Key >, std::allocator< std::pair< const Key, Value > > > >
using node_id_t = std::size_t
 
using path_entry_key = std::pair< node_id_t, buffer >
 
using handle = path_entry_key
 

Public Member Functions

template<typename K , typename V >
std::pair< handle, bool > insert_or_assign (string_view topic_filter, K &&key, V &&value)
 
template<typename K , typename V >
std::pair< handle, bool > insert_or_assign (handle const &h, K &&key, V &&value)
 
std::size_t erase (handle const &h, Key const &key)
 
std::size_t erase (string_view topic_filter, Key const &key)
 
template<typename Output >
void find (string_view topic, Output &&callback) const
 
template<typename Output >
void modify (string_view topic, Output &&callback)
 
template<typename Output >
void dump (Output &out)
 
- Public Member Functions inherited from subscription_map_base< std::unordered_map< Key, Value, std::hash< Key >, std::equal_to< Key >, std::allocator< std::pair< const Key, Value > > > >
std::size_t internal_size () const
 
std::size_t size () const
 
optional< handlelookup (string_view topic_filter)
 
std::string handle_to_topic_filter (handle const &h) const
 

Additional Inherited Members

- Protected Member Functions inherited from subscription_map_base< std::unordered_map< Key, Value, std::hash< Key >, std::equal_to< Key >, std::allocator< std::pair< const Key, Value > > > >
map_type_iterator get_root ()
 
map_type_const_iterator get_root () const
 
map_type_iterator get_key (path_entry_key key)
 
map_type_iterator begin ()
 
map_type_iterator end ()
 
map_type const & get_map () const
 
handle path_to_handle (std::vector< map_type_iterator > const &path) const
 
std::vector< map_type_iterator > find_topic_filter (string_view topic_filter)
 
std::vector< map_type_iterator > create_topic_filter (string_view topic_filter)
 
void remove_topic_filter (std::vector< map_type_iterator > const &path)
 
void find_match (string_view topic, Output &&callback) const
 
void modify_match (string_view topic, Output &&callback)
 
std::vector< map_type_iterator > handle_to_iterators (handle const &h)
 
void increase_subscriptions (handle const &h)
 
void increase_subscriptions (std::vector< map_type_iterator > const &path)
 
void increase_map_size ()
 
void decrease_map_size ()
 
 subscription_map_base ()
 
- Static Protected Member Functions inherited from subscription_map_base< std::unordered_map< Key, Value, std::hash< Key >, std::equal_to< Key >, std::allocator< std::pair< const Key, Value > > > >
static void find_match_impl (ThisType &self, string_view topic, Output &&callback)
 
static void handle_to_iterators (ThisType &self, handle const &h, Output &&output)
 
static void throw_invalid_topic_filter ()
 
static void throw_invalid_handle ()
 
static void throw_max_stored_topics ()
 
- Protected Attributes inherited from subscription_map_base< std::unordered_map< Key, Value, std::hash< Key >, std::equal_to< Key >, std::allocator< std::pair< const Key, Value > > > >
path_entry_key root_key
 
node_id_t root_node_id
 
size_t map_size
 

Member Typedef Documentation

◆ container_t

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
using multiple_subscription_map< Key, Value, Hash, Pred, Cont >::container_t = Cont

◆ handle

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
using multiple_subscription_map< Key, Value, Hash, Pred, Cont >::handle = typename subscription_map_base< Value >::handle

Member Function Documentation

◆ dump()

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
template<typename Output >
void multiple_subscription_map< Key, Value, Hash, Pred, Cont >::dump ( Output &  out)
inline

◆ erase() [1/2]

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
std::size_t multiple_subscription_map< Key, Value, Hash, Pred, Cont >::erase ( handle const &  h,
Key const &  key 
)
inline

◆ erase() [2/2]

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
std::size_t multiple_subscription_map< Key, Value, Hash, Pred, Cont >::erase ( string_view  topic_filter,
Key const &  key 
)
inline

◆ find()

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
template<typename Output >
void multiple_subscription_map< Key, Value, Hash, Pred, Cont >::find ( string_view  topic,
Output &&  callback 
) const
inline

◆ insert_or_assign() [1/2]

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
template<typename K , typename V >
std::pair<handle, bool> multiple_subscription_map< Key, Value, Hash, Pred, Cont >::insert_or_assign ( handle const &  h,
K &&  key,
V &&  value 
)
inline

◆ insert_or_assign() [2/2]

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
template<typename K , typename V >
std::pair<handle, bool> multiple_subscription_map< Key, Value, Hash, Pred, Cont >::insert_or_assign ( string_view  topic_filter,
K &&  key,
V &&  value 
)
inline

◆ modify()

template<typename Key , typename Value , class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Cont = std::unordered_map<Key, Value, Hash, Pred, std::allocator< std::pair<const Key, Value> > >>
template<typename Output >
void multiple_subscription_map< Key, Value, Hash, Pred, Cont >::modify ( string_view  topic,
Output &&  callback 
)
inline

The documentation for this class was generated from the following file: