static inline pmt::pmt_t
send(msg_accepter_sptr accepter, const pmt::pmt_t &msg)
{
- return accepter->post(msg);
+ accepter->post(msg);
+ return msg;
+ }
+
+ /*!
+ * \brief send message to msg_accepter
+ *
+ * \param accepter is the target of the send.
+ * \param msg is the message to send. It's usually a pmt tuple.
+ *
+ * Sending a message is an asynchronous operation. The \p send
+ * call will not wait for the message either to arrive at the
+ * destination or to be received.
+ *
+ * \returns msg
+ */
+ static inline pmt::pmt_t
+ send(msg_accepter *accepter, const pmt::pmt_t &msg)
+ {
+ accepter->post(msg);
+ return msg;
}
/*!
static inline pmt::pmt_t
send(msg_accepter &accepter, const pmt::pmt_t &msg)
{
- return accepter.post(msg);
+ accepter.post(msg);
+ return msg;
}
/*!
*
* \returns msg
*/
- pmt::pmt_t
- send(const pmt_t &accepter, const pmt::pmt_t &msg);
-
+ static inline pmt::pmt_t
+ send(pmt::pmt_t accepter, const pmt::pmt_t &msg)
+ {
+ return send(pmt_msg_accepter_ref(accepter), msg);
+ }
} /* namespace gruel */
#include <qa_pmt_prims.h>
#include <cppunit/TestAssert.h>
-#include <gruel/pmt.h>
-#include <gruel/msg_accepter.h>
+#include <gruel/msg_passing.h>
#include <stdio.h>
#include <sstream>
CPPUNIT_ASSERT_THROW(pmt_msg_accepter_ref(sym), pmt_wrong_type);
CPPUNIT_ASSERT_THROW(pmt_msg_accepter_ref(p0), pmt_wrong_type);
+
+ // just confirm interfaces on send are OK
+ gruel::send(ma0.get(), sym);
+ gruel::send(ma0, sym);
+ gruel::send(p1, sym);
+
}
// ------------------------------------------------------------------------