diff --git a/include/etl/generators/message_router_generator.h b/include/etl/generators/message_router_generator.h index 1c803288..b9c2a799 100644 --- a/include/etl/generators/message_router_generator.h +++ b/include/etl/generators/message_router_generator.h @@ -370,6 +370,26 @@ namespace etl destination.receive(message); } + //*************************************************************************** + /// Send a message to a router with a particular id. + //*************************************************************************** + static inline void send_message(etl::imessage_router& destination, + etl::message_router_id_t id, + const etl::imessage& message) + { + destination.receive(id, message); + } + + //*************************************************************************** + /// Send a shared message to a router with a particular id. + //*************************************************************************** + static inline void send_message(etl::imessage_router& destination, + etl::message_router_id_t id, + etl::shared_message message) + { + destination.receive(id, message); + } + //************************************************************************************************* // For C++17 and above. //************************************************************************************************* diff --git a/include/etl/message_broker.h b/include/etl/message_broker.h index abf7b453..ddf8ae4f 100644 --- a/include/etl/message_broker.h +++ b/include/etl/message_broker.h @@ -330,24 +330,6 @@ namespace etl subscription_node head; }; - - //*************************************************************************** - /// Send a message to a broker. - //*************************************************************************** - static inline void send_message(etl::message_broker& broker, - const etl::imessage& message) - { - broker.receive(message); - } - - //*************************************************************************** - /// Send a shared message to a broker. - //*************************************************************************** - static inline void send_message(etl::message_broker& broker, - etl::shared_message message) - { - broker.receive(message); - } } #endif diff --git a/include/etl/message_bus.h b/include/etl/message_bus.h index 7a79ff9c..11815096 100644 --- a/include/etl/message_bus.h +++ b/include/etl/message_bus.h @@ -424,25 +424,6 @@ namespace etl etl::vector router_list; }; - - //*************************************************************************** - /// Send a message to a bus. - //*************************************************************************** - static inline void send_message(etl::imessage_bus& bus, - const etl::imessage& message) - { - bus.receive(message); - } - - //*************************************************************************** - /// Send a message to a bus. - //*************************************************************************** - static inline void send_message(etl::imessage_bus& bus, - etl::message_router_id_t id, - const etl::imessage& message) - { - bus.receive(id, message); - } } #endif diff --git a/include/etl/message_router.h b/include/etl/message_router.h index 4fd53849..98e18d2a 100644 --- a/include/etl/message_router.h +++ b/include/etl/message_router.h @@ -358,6 +358,26 @@ namespace etl destination.receive(message); } + //*************************************************************************** + /// Send a message to a router with a particular id. + //*************************************************************************** + static inline void send_message(etl::imessage_router& destination, + etl::message_router_id_t id, + const etl::imessage& message) + { + destination.receive(id, message); + } + + //*************************************************************************** + /// Send a shared message to a router with a particular id. + //*************************************************************************** + static inline void send_message(etl::imessage_router& destination, + etl::message_router_id_t id, + etl::shared_message message) + { + destination.receive(id, message); + } + //************************************************************************************************* // For C++17 and above. //*************************************************************************************************