30 #error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
51 #ifndef ETL_MESSAGE_ROUTER_INCLUDED
52 #define ETL_MESSAGE_ROUTER_INCLUDED
58 #include "message_packet.h"
59 #include "message_types.h"
79 message_router_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
92 message_router_illegal_id(string_type file_name_, numeric_type line_number_)
93 : message_router_exception(ETL_ERROR_TEXT(
"message router:illegal id", ETL_FILE
"A"), file_name_, line_number_)
101 class imessage_router
105 virtual ~imessage_router() {}
107 virtual void receive(imessage_router& source,
const etl::imessage& message) = 0;
108 virtual void receive(imessage_router& source, etl::message_router_id_t destination_router_id,
const etl::imessage& message) = 0;
110 virtual bool is_null_router()
const = 0;
111 virtual bool is_producer()
const = 0;
112 virtual bool is_consumer()
const = 0;
117 return accepts(msg.message_id);
121 etl::message_router_id_t get_message_router_id()
const
123 return message_router_id;
127 void set_successor(imessage_router& successor_)
129 successor = &successor_;
133 imessage_router& get_successor()
const
139 bool has_successor()
const
141 return (successor != ETL_NULLPTR);
146 NULL_MESSAGE_ROUTER = 255,
148 ALL_MESSAGE_ROUTERS = 253,
149 MAX_MESSAGE_ROUTER = 249
154 imessage_router(etl::message_router_id_t id_)
155 : successor(ETL_NULLPTR),
156 message_router_id(id_)
160 imessage_router(etl::message_router_id_t id_,
161 imessage_router& successor_)
162 : successor(&successor_),
163 message_router_id(id_)
170 imessage_router(
const imessage_router&);
171 imessage_router& operator =(
const imessage_router&);
175 etl::message_router_id_t message_router_id;
181 class null_message_router :
public imessage_router
185 null_message_router()
186 : imessage_router(imessage_router::NULL_MESSAGE_ROUTER)
201 void receive(imessage_router&, etl::message_router_id_t,
const etl::imessage&) ETL_OVERRIDE
212 ETL_DEPRECATED
bool is_null_router() const ETL_OVERRIDE
218 bool is_producer() const ETL_OVERRIDE
224 bool is_consumer() const ETL_OVERRIDE
230 static null_message_router& instance()
232 static null_message_router nmr;
240 class message_producer :
public imessage_router
244 message_producer(etl::message_router_id_t id_)
245 : imessage_router(id_)
260 void receive(imessage_router&, etl::message_router_id_t,
const etl::imessage&) ETL_OVERRIDE
271 ETL_DEPRECATED
bool is_null_router() const ETL_OVERRIDE
277 bool is_producer() const ETL_OVERRIDE
283 bool is_consumer() const ETL_OVERRIDE
295 destination.receive(message);
305 destination.receive(source, message);
311 template <
typename TDerived,
312 typename T1,
typename T2 = void,
typename T3 = void,
typename T4 = void,
313 typename T5 = void,
typename T6 = void,
typename T7 = void,
typename T8 = void,
314 typename T9 = void,
typename T10 = void,
typename T11 = void,
typename T12 = void,
315 typename T13 = void,
typename T14 = void,
typename T15 = void,
typename T16 =
void>
320 typedef etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> message_packet;
339 receive(etl::null_message_router::instance(), msg);
345 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
347 receive(source, msg);
358 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
359 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
360 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
361 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
362 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
363 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
364 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
365 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
366 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
367 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
368 case T11::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T11&
>(msg));
break;
369 case T12::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T12&
>(msg));
break;
370 case T13::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T13&
>(msg));
break;
371 case T14::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T14&
>(msg));
break;
372 case T15::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T15&
>(msg));
break;
373 case T16::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T16&
>(msg));
break;
378 get_successor().receive(source, msg);
382 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
389 using imessage_router::accepts;
396 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
397 case T9::ID:
case T10::ID:
case T11::ID:
case T12::ID:
case T13::ID:
case T14::ID:
case T15::ID:
case T16::ID:
405 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
411 bool is_producer()
const ETL_OVERRIDE
417 bool is_consumer()
const ETL_OVERRIDE
426 template <
typename TDerived,
427 typename T1,
typename T2,
typename T3,
typename T4,
428 typename T5,
typename T6,
typename T7,
typename T8,
429 typename T9,
typename T10,
typename T11,
typename T12,
430 typename T13,
typename T14,
typename T15>
431 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, void>
436 typedef etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> message_packet;
455 receive(etl::null_message_router::instance(), msg);
461 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
463 receive(source, msg);
470 const size_t id = msg.message_id;
474 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
475 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
476 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
477 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
478 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
479 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
480 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
481 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
482 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
483 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
484 case T11::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T11&
>(msg));
break;
485 case T12::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T12&
>(msg));
break;
486 case T13::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T13&
>(msg));
break;
487 case T14::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T14&
>(msg));
break;
488 case T15::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T15&
>(msg));
break;
493 get_successor().receive(source, msg);
497 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
504 using imessage_router::accepts;
511 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
512 case T9::ID:
case T10::ID:
case T11::ID:
case T12::ID:
case T13::ID:
case T14::ID:
case T15::ID:
520 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
526 bool is_producer()
const ETL_OVERRIDE
532 bool is_consumer()
const ETL_OVERRIDE
541 template <
typename TDerived,
542 typename T1,
typename T2,
typename T3,
typename T4,
543 typename T5,
typename T6,
typename T7,
typename T8,
544 typename T9,
typename T10,
typename T11,
typename T12,
545 typename T13,
typename T14>
546 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, void, void>
551 typedef etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> message_packet;
570 receive(etl::null_message_router::instance(), msg);
576 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
578 receive(source, msg);
585 const size_t id = msg.message_id;
589 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
590 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
591 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
592 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
593 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
594 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
595 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
596 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
597 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
598 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
599 case T11::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T11&
>(msg));
break;
600 case T12::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T12&
>(msg));
break;
601 case T13::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T13&
>(msg));
break;
602 case T14::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T14&
>(msg));
break;
607 get_successor().receive(source, msg);
611 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
618 using imessage_router::accepts;
625 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
626 case T9::ID:
case T10::ID:
case T11::ID:
case T12::ID:
case T13::ID:
case T14::ID:
634 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
640 bool is_producer()
const ETL_OVERRIDE
646 bool is_consumer()
const ETL_OVERRIDE
655 template <
typename TDerived,
656 typename T1,
typename T2,
typename T3,
typename T4,
657 typename T5,
typename T6,
typename T7,
typename T8,
658 typename T9,
typename T10,
typename T11,
typename T12,
660 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, void, void, void>
665 typedef etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> message_packet;
684 receive(etl::null_message_router::instance(), msg);
690 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
692 receive(source, msg);
699 const size_t id = msg.message_id;
703 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
704 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
705 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
706 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
707 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
708 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
709 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
710 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
711 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
712 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
713 case T11::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T11&
>(msg));
break;
714 case T12::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T12&
>(msg));
break;
715 case T13::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T13&
>(msg));
break;
720 get_successor().receive(source, msg);
724 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
731 using imessage_router::accepts;
738 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
739 case T9::ID:
case T10::ID:
case T11::ID:
case T12::ID:
case T13::ID:
747 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
753 bool is_producer()
const ETL_OVERRIDE
759 bool is_consumer()
const ETL_OVERRIDE
768 template <
typename TDerived,
769 typename T1,
typename T2,
typename T3,
typename T4,
770 typename T5,
typename T6,
typename T7,
typename T8,
771 typename T9,
typename T10,
typename T11,
typename T12>
772 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, void, void, void, void>
777 typedef etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> message_packet;
796 receive(etl::null_message_router::instance(), msg);
802 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
804 receive(source, msg);
811 const size_t id = msg.message_id;
815 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
816 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
817 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
818 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
819 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
820 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
821 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
822 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
823 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
824 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
825 case T11::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T11&
>(msg));
break;
826 case T12::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T12&
>(msg));
break;
831 get_successor().receive(source, msg);
835 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
842 using imessage_router::accepts;
849 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
850 case T9::ID:
case T10::ID:
case T11::ID:
case T12::ID:
858 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
864 bool is_producer()
const ETL_OVERRIDE
870 bool is_consumer()
const ETL_OVERRIDE
879 template <
typename TDerived,
880 typename T1,
typename T2,
typename T3,
typename T4,
881 typename T5,
typename T6,
typename T7,
typename T8,
882 typename T9,
typename T10,
typename T11>
883 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, void, void, void, void, void>
888 typedef etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> message_packet;
907 receive(etl::null_message_router::instance(), msg);
913 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
915 receive(source, msg);
922 const size_t id = msg.message_id;
926 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
927 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
928 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
929 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
930 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
931 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
932 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
933 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
934 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
935 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
936 case T11::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T11&
>(msg));
break;
941 get_successor().receive(source, msg);
945 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
952 using imessage_router::accepts;
959 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
960 case T9::ID:
case T10::ID:
case T11::ID:
968 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
974 bool is_producer()
const ETL_OVERRIDE
980 bool is_consumer()
const ETL_OVERRIDE
989 template <
typename TDerived,
990 typename T1,
typename T2,
typename T3,
typename T4,
991 typename T5,
typename T6,
typename T7,
typename T8,
992 typename T9,
typename T10>
993 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, void, void, void, void, void, void>
1017 receive(etl::null_message_router::instance(), msg);
1023 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1025 receive(source, msg);
1032 const size_t id = msg.message_id;
1036 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1037 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1038 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1039 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1040 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
1041 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
1042 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
1043 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
1044 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
1045 case T10::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T10&
>(msg));
break;
1048 if (has_successor())
1050 get_successor().receive(source, msg);
1054 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1061 using imessage_router::accepts;
1068 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
1069 case T9::ID:
case T10::ID:
1077 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1083 bool is_producer()
const ETL_OVERRIDE
1089 bool is_consumer()
const ETL_OVERRIDE
1098 template <
typename TDerived,
1099 typename T1,
typename T2,
typename T3,
typename T4,
1100 typename T5,
typename T6,
typename T7,
typename T8,
1102 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, T9, void, void, void, void, void, void, void>
1126 receive(etl::null_message_router::instance(), msg);
1132 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1134 receive(source, msg);
1141 const size_t id = msg.message_id;
1145 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1146 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1147 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1148 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1149 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
1150 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
1151 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
1152 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
1153 case T9::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T9&
>(msg));
break;
1156 if (has_successor())
1158 get_successor().receive(source, msg);
1162 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1169 using imessage_router::accepts;
1176 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
1185 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1191 bool is_producer()
const ETL_OVERRIDE
1197 bool is_consumer()
const ETL_OVERRIDE
1206 template <
typename TDerived,
1207 typename T1,
typename T2,
typename T3,
typename T4,
1208 typename T5,
typename T6,
typename T7,
typename T8>
1209 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, T8, void, void, void, void, void, void, void, void>
1233 receive(etl::null_message_router::instance(), msg);
1239 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1241 receive(source, msg);
1248 const size_t id = msg.message_id;
1252 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1253 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1254 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1255 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1256 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
1257 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
1258 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
1259 case T8::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T8&
>(msg));
break;
1262 if (has_successor())
1264 get_successor().receive(source, msg);
1268 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1275 using imessage_router::accepts;
1282 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
case T8::ID:
1291 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1297 bool is_producer()
const ETL_OVERRIDE
1303 bool is_consumer()
const ETL_OVERRIDE
1312 template <
typename TDerived,
1313 typename T1,
typename T2,
typename T3,
typename T4,
1314 typename T5,
typename T6,
typename T7>
1315 class message_router<TDerived, T1, T2, T3, T4, T5, T6, T7, void, void, void, void, void, void, void, void, void>
1339 receive(etl::null_message_router::instance(), msg);
1345 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1347 receive(source, msg);
1354 const size_t id = msg.message_id;
1358 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1359 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1360 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1361 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1362 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
1363 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
1364 case T7::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T7&
>(msg));
break;
1367 if (has_successor())
1369 get_successor().receive(source, msg);
1373 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1380 using imessage_router::accepts;
1387 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
case T7::ID:
1395 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1401 bool is_producer()
const ETL_OVERRIDE
1407 bool is_consumer()
const ETL_OVERRIDE
1416 template <
typename TDerived,
1417 typename T1,
typename T2,
typename T3,
typename T4,
1418 typename T5,
typename T6>
1419 class message_router<TDerived, T1, T2, T3, T4, T5, T6, void, void, void, void, void, void, void, void, void, void>
1443 receive(etl::null_message_router::instance(), msg);
1449 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1451 receive(source, msg);
1458 const size_t id = msg.message_id;
1462 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1463 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1464 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1465 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1466 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
1467 case T6::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T6&
>(msg));
break;
1470 if (has_successor())
1472 get_successor().receive(source, msg);
1476 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1483 using imessage_router::accepts;
1490 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
case T6::ID:
1498 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1504 bool is_producer()
const ETL_OVERRIDE
1510 bool is_consumer()
const ETL_OVERRIDE
1519 template <
typename TDerived,
1520 typename T1,
typename T2,
typename T3,
typename T4,
1522 class message_router<TDerived, T1, T2, T3, T4, T5, void, void, void, void, void, void, void, void, void, void, void>
1546 receive(etl::null_message_router::instance(), msg);
1552 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1554 receive(source, msg);
1561 const size_t id = msg.message_id;
1565 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1566 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1567 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1568 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1569 case T5::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T5&
>(msg));
break;
1572 if (has_successor())
1574 get_successor().receive(source, msg);
1578 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1585 using imessage_router::accepts;
1592 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
case T5::ID:
1600 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1606 bool is_producer()
const ETL_OVERRIDE
1612 bool is_consumer()
const ETL_OVERRIDE
1621 template <
typename TDerived,
1622 typename T1,
typename T2,
typename T3,
typename T4>
1623 class message_router<TDerived, T1, T2, T3, T4, void, void, void, void, void, void, void, void, void, void, void, void>
1647 receive(etl::null_message_router::instance(), msg);
1653 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1655 receive(source, msg);
1662 const size_t id = msg.message_id;
1666 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1667 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1668 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1669 case T4::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T4&
>(msg));
break;
1672 if (has_successor())
1674 get_successor().receive(source, msg);
1678 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1685 using imessage_router::accepts;
1692 case T1::ID:
case T2::ID:
case T3::ID:
case T4::ID:
1700 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1706 bool is_producer()
const ETL_OVERRIDE
1712 bool is_consumer()
const ETL_OVERRIDE
1721 template <
typename TDerived,
1722 typename T1,
typename T2,
typename T3>
1723 class message_router<TDerived, T1, T2, T3, void, void, void, void, void, void, void, void, void, void, void, void, void>
1747 receive(etl::null_message_router::instance(), msg);
1753 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1755 receive(source, msg);
1762 const size_t id = msg.message_id;
1766 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1767 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1768 case T3::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T3&
>(msg));
break;
1771 if (has_successor())
1773 get_successor().receive(source, msg);
1777 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1784 using imessage_router::accepts;
1791 case T1::ID:
case T2::ID:
case T3::ID:
1799 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1805 bool is_producer()
const ETL_OVERRIDE
1811 bool is_consumer()
const ETL_OVERRIDE
1820 template <
typename TDerived,
1821 typename T1,
typename T2>
1822 class message_router<TDerived, T1, T2, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
1846 receive(etl::null_message_router::instance(), msg);
1852 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1854 receive(source, msg);
1861 const size_t id = msg.message_id;
1865 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1866 case T2::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T2&
>(msg));
break;
1869 if (has_successor())
1871 get_successor().receive(source, msg);
1875 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1882 using imessage_router::accepts;
1889 case T1::ID:
case T2::ID:
1897 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
1903 bool is_producer()
const ETL_OVERRIDE
1909 bool is_consumer()
const ETL_OVERRIDE
1918 template <
typename TDerived,
1920 class message_router<TDerived, T1, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>
1944 receive(etl::null_message_router::instance(), msg);
1950 if ((destination_router_id == get_message_router_id()) || (destination_router_id == imessage_router::ALL_MESSAGE_ROUTERS))
1952 receive(source, msg);
1959 const size_t id = msg.message_id;
1963 case T1::ID:
static_cast<TDerived*
>(
this)->on_receive(source,
static_cast<const T1&
>(msg));
break;
1966 if (has_successor())
1968 get_successor().receive(source, msg);
1972 static_cast<TDerived*
>(
this)->on_receive_unknown(source, msg);
1979 using imessage_router::accepts;
1994 ETL_DEPRECATED
bool is_null_router()
const ETL_OVERRIDE
2000 bool is_producer()
const ETL_OVERRIDE
2006 bool is_consumer()
const ETL_OVERRIDE
This is the base of all message routers.
Definition: message_router_generator.h:114
Definition: message_packet.h:76
Base exception class for message router.
Definition: message_router_generator.h:88
Router id is out of the legal range.
Definition: message_router_generator.h:101
Definition: message_router.h:317
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
exception(string_type reason_, string_type file_, numeric_type line_)
Constructor.
Definition: exception.h:67
Definition: exception.h:47
Definition: absolute.h:37
uint_least8_t message_id_t
Allow alternative type for message id.
Definition: message_types.h:40