summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gruel/src/include/gruel/Makefile.am2
-rw-r--r--gruel/src/include/gruel/msg_passing.h88
-rw-r--r--gruel/src/include/gruel/send.h49
3 files changed, 89 insertions, 50 deletions
diff --git a/gruel/src/include/gruel/Makefile.am b/gruel/src/include/gruel/Makefile.am
index 9f50cb619..9aedc7fda 100644
--- a/gruel/src/include/gruel/Makefile.am
+++ b/gruel/src/include/gruel/Makefile.am
@@ -31,11 +31,11 @@ gruelinclude_HEADERS = \
msg_accepter.h \
msg_accepter_msgq.h \
msg_queue.h \
+ msg_passing.h \
pmt.h \
pmt_pool.h \
pmt_serial_tags.h \
realtime.h \
- send.h \
sys_pri.h \
thread_body_wrapper.h \
thread_group.h \
diff --git a/gruel/src/include/gruel/msg_passing.h b/gruel/src/include/gruel/msg_passing.h
new file mode 100644
index 000000000..611058499
--- /dev/null
+++ b/gruel/src/include/gruel/msg_passing.h
@@ -0,0 +1,88 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_GRUEL_MSG_PASSING_H
+#define INCLUDED_GRUEL_MSG_PASSING_H
+
+/*!
+ * \brief Include this header to use the message passing features
+ */
+
+#include <gruel/pmt.h>
+#include <gruel/msg_accepter.h>
+
+
+namespace gruel {
+
+ /*!
+ * \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_sptr accepter, const pmt::pmt_t &msg)
+ {
+ return accepter->post(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)
+ {
+ return accepter.post(msg);
+ }
+
+ /*!
+ * \brief send message to msg_accepter
+ *
+ * \param accepter is the target of the send. precond: pmt_is_msg_accepter(accepter)
+ * \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
+ */
+ pmt::pmt_t
+ send(const pmt_t &accepter, const pmt::pmt_t &msg);
+
+
+} /* namespace gruel */
+
+#endif /* INCLUDED_GRUEL_MSG_PASSING_H */
diff --git a/gruel/src/include/gruel/send.h b/gruel/src/include/gruel/send.h
deleted file mode 100644
index 292017d45..000000000
--- a/gruel/src/include/gruel/send.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GRUEL_SEND_H
-#define INCLUDED_GRUEL_SEND_H
-
-#include <gruel/msg_accepter.h>
-
-namespace gruel {
-
-
- /*!
- * \brief send \p msg to \p msg_accepter
- *
- * 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 &acc, pmt::pmt_t msg)
- {
- return acc.post(msg);
- }
-
-
-
-} /* namespace gruel */
-
-
-#endif /* INCLUDED_SEND_H */