summaryrefslogtreecommitdiff
path: root/gruel
diff options
context:
space:
mode:
Diffstat (limited to 'gruel')
-rw-r--r--gruel/src/include/gruel/Makefile.am1
-rw-r--r--gruel/src/include/gruel/msg_accepter.h13
-rw-r--r--gruel/src/include/gruel/send.h49
3 files changed, 60 insertions, 3 deletions
diff --git a/gruel/src/include/gruel/Makefile.am b/gruel/src/include/gruel/Makefile.am
index c38c7fa38..9f50cb619 100644
--- a/gruel/src/include/gruel/Makefile.am
+++ b/gruel/src/include/gruel/Makefile.am
@@ -35,6 +35,7 @@ gruelinclude_HEADERS = \
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_accepter.h b/gruel/src/include/gruel/msg_accepter.h
index bc287afae..3afd6dde0 100644
--- a/gruel/src/include/gruel/msg_accepter.h
+++ b/gruel/src/include/gruel/msg_accepter.h
@@ -18,8 +18,8 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef INCLUDED_MSG_ACCEPTER_H
-#define INCLUDED_MSG_ACCEPTER_H
+#ifndef INCLUDED_GRUEL_MSG_ACCEPTER_H
+#define INCLUDED_GRUEL_MSG_ACCEPTER_H
#include <gruel/pmt.h>
@@ -34,9 +34,16 @@ namespace gruel {
msg_accepter() {};
virtual ~msg_accepter();
+ /*!
+ * \brief send \p msg to \p msg_accepter
+ *
+ * Sending a message is an asynchronous operation. The \p post
+ * call will not wait for the message either to arrive at the
+ * destination or to be received.
+ */
virtual void post(pmt::pmt_t msg) = 0;
};
} /* namespace gruel */
-#endif /* INCLUDED_MSG_ACCEPTER_H */
+#endif /* INCLUDED_GRUEL_MSG_ACCEPTER_H */
diff --git a/gruel/src/include/gruel/send.h b/gruel/src/include/gruel/send.h
new file mode 100644
index 000000000..292017d45
--- /dev/null
+++ b/gruel/src/include/gruel/send.h
@@ -0,0 +1,49 @@
+/* -*- 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 */