Add top-level msg_passing.h include file.
authorEric Blossom <eb@comsec.com>
Wed, 19 Aug 2009 02:12:15 +0000 (19:12 -0700)
committerEric Blossom <eb@comsec.com>
Wed, 19 Aug 2009 02:12:15 +0000 (19:12 -0700)
Incorporate send.h into msg_passing.h.

gruel/src/include/gruel/Makefile.am
gruel/src/include/gruel/msg_passing.h [new file with mode: 0644]
gruel/src/include/gruel/send.h [deleted file]

index 9f50cb619f3e391cfa406d8a1611c4a2ae3d5790..9aedc7fda2c40e5d7e1d5280d81724c93f2145e1 100644 (file)
@@ -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 (file)
index 0000000..6110584
--- /dev/null
@@ -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 (file)
index 292017d..0000000
+++ /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 */