51 class subscription_node
64 void set_next(subscription_node*
sub)
70 subscription_node* get_next()
const
78 set_next(ETL_NULLPTR);
82 void append(subscription_node*
sub)
84 if (
sub != ETL_NULLPTR)
86 sub->set_next(get_next());
91 subscription_node* p_next;
131 using etl::imessage_router::receive;
182 initialise_insertion_point(&
router, ETL_NULLPTR);
188 receive(etl::imessage_router::ALL_MESSAGE_ROUTERS, msg);
193 receive(etl::imessage_router::ALL_MESSAGE_ROUTERS, shared_msg);
205 subscription* sub =
static_cast<subscription*
>(head.get_next());
207 while (sub != ETL_NULLPTR)
209 message_id_span_t message_ids = sub->message_id_list();
211 message_id_span_t::iterator itr = etl::find(message_ids.begin(), message_ids.end(),
id);
213 if (itr != message_ids.end())
217 if (destination_router_id == etl::imessage_router::ALL_MESSAGE_ROUTERS ||
218 destination_router_id == router->get_message_router_id())
220 router->receive(msg);
224 sub = sub->next_subscription();
244 subscription* sub =
static_cast<subscription*
>(head.get_next());
246 while (sub != ETL_NULLPTR)
248 message_id_span_t message_ids = sub->message_id_list();
250 message_id_span_t::iterator itr = etl::find(message_ids.begin(), message_ids.end(),
id);
252 if (itr != message_ids.end())
256 if (destination_router_id == etl::imessage_router::ALL_MESSAGE_ROUTERS ||
257 destination_router_id == router->get_message_router_id())
259 router->receive(shared_msg);
263 sub = sub->next_subscription();
274 using imessage_router::accepts;
287 while (
sub != ETL_NULLPTR)
303 sub =
sub->next_subscription();
328 ETL_DEPRECATED
virtual bool is_null_router() const ETL_OVERRIDE
334 virtual bool is_producer() const ETL_OVERRIDE
340 virtual bool is_consumer() const ETL_OVERRIDE
348 return head.get_next() == ETL_NULLPTR;
358 subscription_node* p_sub = head.get_next();
359 subscription_node* p_sub_previous = &head;
361 while (p_sub != ETL_NULLPTR)
364 if (
static_cast<subscription*
>(p_sub)->get_router() == p_target_router)
367 p_sub_previous->set_next(p_sub->get_next());
375 p_sub = p_sub->get_next();
376 p_sub_previous = p_sub_previous->get_next();
379 if (p_new_sub != ETL_NULLPTR)
382 p_sub_previous->append(p_new_sub);
386 subscription_node head;
uint_least8_t message_id_t
Allow alternative type for message id.
Definition message_types.h:40