gr_io_signature.cc \
gr_local_sighandler.cc \
gr_message.cc \
+ gr_msg_accepter.cc \
gr_msg_handler.cc \
gr_msg_queue.cc \
gr_pagesize.cc \
gr_io_signature.h \
gr_local_sighandler.h \
gr_message.h \
+ gr_msg_accepter.h \
gr_msg_handler.h \
gr_msg_queue.h \
gr_pagesize.h \
gr_basic_block::gr_basic_block(const std::string &name,
gr_io_signature_sptr input_signature,
gr_io_signature_sptr output_signature)
- : gruel::msg_accepter_msgq(gruel::make_msg_queue(0)),
+ : gr_msg_accepter(gruel::make_msg_queue(0)), // Non-blocking insert
d_name(name),
d_input_signature(input_signature),
d_output_signature(output_signature),
#include <gr_runtime_types.h>
#include <gr_sptr_magic.h>
#include <boost/enable_shared_from_this.hpp>
-#include <gruel/msg_accepter_msgq.h>
+#include <gr_msg_accepter.h>
#include <string>
/*!
* signal processing functions.
*/
-class gr_basic_block : gruel::msg_accepter_msgq, public boost::enable_shared_from_this<gr_basic_block>
+class gr_basic_block : gr_msg_accepter, public boost::enable_shared_from_this<gr_basic_block>
{
protected:
friend class gr_flowgraph;
--- /dev/null
+/* -*- 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.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_msg_accepter.h>
+
+using namespace pmt;
+
+gr_msg_accepter::gr_msg_accepter(gruel::msg_queue_sptr msgq)
+ : gruel::msg_accepter_msgq(msgq)
+{
+}
+
+gr_msg_accepter::~gr_msg_accepter()
+{
+ // NOP, required as virtual destructor
+}
+
+void
+gr_msg_accepter::post(pmt_t msg)
+{
+ d_msg_queue->insert_tail(msg);
+}
--- /dev/null
+/* -*- 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_GR_MSG_ACCEPTER_H
+#define INCLUDED_GR_MSG_ACCEPTER_H
+
+#include <gruel/msg_accepter_msgq.h>
+
+/*!
+ * \brief Accepts messages and inserts them into a message queue, then notifies
+ * subclass gr_basic_block there is a message pending.
+ */
+class gr_msg_accepter : gruel::msg_accepter_msgq
+{
+public:
+ gr_msg_accepter(gruel::msg_queue_sptr msgq);
+ ~gr_msg_accepter();
+
+ void post(pmt::pmt_t msg);
+};
+
+#endif /* INCLUDED_GR_MSG_ACCEPTER_H */
*/
class msg_accepter_msgq : public msg_accepter
{
+ protected:
msg_queue_sptr d_msg_queue;
public:
msg_accepter_msgq(msg_queue_sptr msgq);
~msg_accepter_msgq();
- void post(pmt::pmt_t msg);
+ virtual void post(pmt::pmt_t msg);
msg_queue_sptr msg_queue() const { return d_msg_queue; }
};