29#ifndef ETL_MESSAGE_ROUTER_REGISTRY_INCLUDED
30#define ETL_MESSAGE_ROUTER_REGISTRY_INCLUDED
34#include "message_router.h"
115 return *(itr->second);
121 return *(itr->second);
154 return lhs.itr == rhs.itr;
160 return !(lhs == rhs);
210 return *(itr->second);
237 return lhs.itr == rhs.itr;
243 return !(lhs == rhs);
265 const_iterator
begin()
const
267 return const_iterator(registry.
cbegin());
270 const_iterator
cbegin()
const
272 return const_iterator(registry.
cbegin());
283 const_iterator
end()
const
285 return const_iterator(registry.
cend());
288 const_iterator
cend()
const
290 return const_iterator(registry.
cend());
300 if (registry.
find(
id) != registry.
end())
312 IRegistry::const_iterator itr = registry.
find(
id);
314 if (registry.
find(
id) != registry.
end())
332 const_iterator
lower_bound(etl::message_router_id_t
id)
const
334 return const_iterator(IRegistry::const_iterator(registry.
lower_bound(
id)));
345 const_iterator
upper_bound(etl::message_router_id_t
id)
const
347 return const_iterator(IRegistry::const_iterator(registry.
upper_bound(
id)));
358 IRegistry::value_type element(router.get_message_router_id(), &router);
374 if (p_router != ETL_NULLPTR)
384 template <
typename TIterator>
385 void add(TIterator first,
const TIterator& last)
387 while (first != last)
406 bool contains(
const etl::message_router_id_t
id)
const
408 return find(
id) != ETL_NULLPTR;
420 if (p_router == ETL_NULLPTR)
427 return (irouter != registry.
cend()) && (irouter->second == p_router);
438 return (irouter != registry.
cend()) && (irouter->second == &router);
444 size_t count(
const etl::message_router_id_t
id)
const
446 return registry.
count(
id);
454 return registry.
empty();
462 return registry.
full();
470 return registry.
size();
495 : registry(registry_)
507 template <
size_t MaxRouters>
524 template <
typename TIterator>
528 while (first != last)
535#if ETL_HAS_INITIALIZER_LIST
542 std::initializer_list<etl::imessage_router*>::const_iterator itr = init.
begin();
544 while (itr != init.end())
555 message_router_registry(
const message_router_registry& rhs)
556 : imessage_router_registry(registry)
558 registry = rhs.registry;
564 message_router_registry& operator =(
const message_router_registry& rhs)
566 registry = rhs.registry;
Const Iterator.
Definition: message_router_registry.h:178
Iterator.
Definition: message_router_registry.h:88
This is the base of all message router registries.
Definition: message_router_registry.h:75
void add(etl::imessage_router *p_router)
Definition: message_router_registry.h:372
iterator lower_bound(etl::message_router_id_t id)
Get the lower bound in the registry with the specified ID.
Definition: message_router_registry.h:327
bool contains(const etl::message_router_id_t id) const
Definition: message_router_registry.h:406
bool contains(const etl::imessage_router &router) const
Definition: message_router_registry.h:434
bool full() const
Returns true if the registry is full, otherwise false.
Definition: message_router_registry.h:460
etl::imessage_router * find(etl::message_router_id_t id)
Get the first router in the registry with the specified ID.
Definition: message_router_registry.h:296
bool empty() const
Returns true if the registry is empty, otherwise false.
Definition: message_router_registry.h:452
void add(TIterator first, const TIterator &last)
Definition: message_router_registry.h:385
size_t size() const
Returns the size of the registry.
Definition: message_router_registry.h:468
size_t available() const
Returns the available size of the registry.
Definition: message_router_registry.h:476
iterator upper_bound(etl::message_router_id_t id)
Get the upper bound in the registry with the specified ID.
Definition: message_router_registry.h:340
bool contains(const etl::imessage_router *const p_router) const
Definition: message_router_registry.h:418
size_t max_size() const
Returns the maximum size of the registry.
Definition: message_router_registry.h:484
iterator end()
Get the end of the registry.
Definition: message_router_registry.h:278
void add(etl::imessage_router &router)
Definition: message_router_registry.h:354
iterator begin()
Get the beginning of the registry.
Definition: message_router_registry.h:260
void remove(etl::message_router_id_t id)
Unregisters a router.
Definition: message_router_registry.h:397
size_t count(const etl::message_router_id_t id) const
Returns the number of routers with the specified ID.
Definition: message_router_registry.h:444
This is the base of all message routers.
Definition: message_router_generator.h:121
Definition: reference_flat_multimap.h:191
Definition: reference_flat_multimap.h:107
Base exception class for message router registry.
Definition: message_router_registry.h:49
The registry is full.
Definition: message_router_registry.h:62
Message router registry.
Definition: message_router_registry.h:509
message_router_registry(TIterator first, const TIterator &last)
Definition: message_router_registry.h:525
Definition: exception.h:47
iterator end()
Definition: flat_multimap.h:145
size_type size() const
Definition: flat_multimap.h:788
const_iterator cbegin() const
Definition: flat_multimap.h:163
size_t available() const
Definition: flat_multimap.h:833
bool full() const
Definition: flat_multimap.h:806
size_type max_size() const
Definition: flat_multimap.h:824
size_t erase(const_key_reference key)
Definition: flat_multimap.h:464
size_t count(const_key_reference key) const
Definition: flat_multimap.h:614
iterator begin()
Definition: flat_multimap.h:127
const_iterator cend() const
Definition: flat_multimap.h:172
iterator upper_bound(const_key_reference key)
Definition: flat_multimap.h:671
ETL_OR_STD::pair< iterator, bool > insert(const value_type &value)
Definition: flat_multimap.h:260
bool empty() const
Definition: flat_multimap.h:797
iterator find(const_key_reference key)
Definition: flat_multimap.h:576
iterator lower_bound(const_key_reference key)
Definition: flat_multimap.h:633
Definition: flat_multimap.h:62
bitset_ext
Definition: absolute.h:38
ETL_CONSTEXPR TContainer::const_iterator cbegin(const TContainer &container)
Definition: iterator.h:951
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:645
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:633
ETL_CONSTEXPR TContainer::const_iterator cend(const TContainer &container)
Definition: iterator.h:981
iterator
Definition: iterator.h:399