mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-19 18:36:05 +08:00
Rationalised etl::send_message functions
This commit is contained in:
parent
00b970f7c9
commit
e10cd6dab3
@ -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.
|
||||
//*************************************************************************************************
|
||||
|
||||
@ -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
|
||||
|
||||
@ -424,25 +424,6 @@ namespace etl
|
||||
|
||||
etl::vector<etl::imessage_router*, MAX_ROUTERS_> 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
|
||||
|
||||
@ -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.
|
||||
//*************************************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user