diff options
author | Josh Blum | 2012-09-05 21:57:56 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-05 21:57:56 -0700 |
commit | 790fdae23bd4c322218dbb3ce9866d34937a6780 (patch) | |
tree | 4b9aa7ffc56207596781dec6f814ad4fa8177394 /swig | |
parent | c3809c21067f985a0a88cff4bef544fba9415e30 (diff) | |
download | sandhi-790fdae23bd4c322218dbb3ce9866d34937a6780.tar.gz sandhi-790fdae23bd4c322218dbb3ce9866d34937a6780.tar.bz2 sandhi-790fdae23bd4c322218dbb3ce9866d34937a6780.zip |
dont need extra copies of these files, use them from gnuradio
Diffstat (limited to 'swig')
-rw-r--r-- | swig/gr_message.i | 65 | ||||
-rw-r--r-- | swig/gr_msg_handler.i | 32 | ||||
-rw-r--r-- | swig/gr_msg_queue.i | 107 |
3 files changed, 0 insertions, 204 deletions
diff --git a/swig/gr_message.i b/swig/gr_message.i deleted file mode 100644 index 356bba5..0000000 --- a/swig/gr_message.i +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -class gr_message; -typedef boost::shared_ptr<gr_message> gr_message_sptr; -%template(gr_message_sptr) boost::shared_ptr<gr_message>; - -%rename(message_from_string) gr_make_message_from_string; -gr_message_sptr -gr_make_message_from_string(const std::string s, long type = 0, double arg1 = 0, double arg2 = 0); - -%rename(message) gr_make_message; -gr_message_sptr -gr_make_message(long type = 0, double arg1 = 0, double arg2 = 0, size_t length = 0); - -/*! - * \brief Message. - * - * The ideas and method names for adjustable message length were - * lifted from the click modular router "Packet" class. - */ -class gr_message { - gr_message (long type, double arg1, double arg2, size_t length); - - unsigned char *buf_data() const { return d_buf_start; } - size_t buf_len() const { return d_buf_end - d_buf_start; } - -public: - ~gr_message (); - - long type() const { return d_type; } - double arg1() const { return d_arg1; } - double arg2() const { return d_arg2; } - - void set_type(long type) { d_type = type; } - void set_arg1(double arg1) { d_arg1 = arg1; } - void set_arg2(double arg2) { d_arg2 = arg2; } - - size_t length() const; - std::string to_string() const; - -}; - -%rename(message_ncurrently_allocated) gr_message_ncurrently_allocated; -long gr_message_ncurrently_allocated(); - diff --git a/swig/gr_msg_handler.i b/swig/gr_msg_handler.i deleted file mode 100644 index f493dac..0000000 --- a/swig/gr_msg_handler.i +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/*! - * \brief abstract class of message handlers - */ -class gr_msg_handler { -public: - virtual ~gr_msg_handler () = 0; - - //! handle \p msg - virtual void handle (gr_message_sptr msg) = 0; -}; diff --git a/swig/gr_msg_queue.i b/swig/gr_msg_queue.i deleted file mode 100644 index 65cbe78..0000000 --- a/swig/gr_msg_queue.i +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2009,2010,2011 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -class gr_msg_queue; -typedef boost::shared_ptr<gr_msg_queue> gr_msg_queue_sptr; -%template(gr_msg_queue_sptr) boost::shared_ptr<gr_msg_queue>; - -%rename(msg_queue) gr_make_msg_queue; -gr_msg_queue_sptr gr_make_msg_queue(unsigned limit=0); - -/*! - * \brief thread-safe message queue - */ -%ignore gr_msg_queue; -class gr_msg_queue : public gr_msg_handler { -public: - gr_msg_queue(unsigned int limit); - ~gr_msg_queue(); - - //! Generic msg_handler method: insert the message. - //void handle(gr_message_sptr msg) { insert_tail (msg); } - - /*! - * \brief Insert message at tail of queue. - * \param msg message - * - * Block if queue if full. - */ - //void insert_tail(gr_message_sptr msg); - - /*! - * \brief Delete message from head of queue and return it. - * Block if no message is available. - */ - //gr_message_sptr delete_head(); - - /*! - * \brief If there's a message in the q, delete it and return it. - * If no message is available, return 0. - */ - gr_message_sptr delete_head_nowait(); - - //! is the queue empty? - bool empty_p() const; - - //! is the queue full? - bool full_p() const; - - //! return number of messages in queue - unsigned int count() const; - - //! Delete all messages from the queue - void flush(); -}; - -/* - * The following kludge-o-rama releases the Python global interpreter - * lock around these potentially blocking calls. We don't want - * libgnuradio-core to be dependent on Python, thus we create these - * functions that serve as replacements for the normal C++ delete_head - * and insert_tail methods. The %pythoncode smashes these new C++ - * functions into the gr.msg_queue wrapper class, so that everything - * appears normal. (An evil laugh is heard in the distance...) - */ -#ifdef SWIGPYTHON -%inline %{ - gr_message_sptr gr_py_msg_queue__delete_head(gr_msg_queue_sptr q) { - gr_message_sptr msg; - GR_PYTHON_BLOCKING_CODE( - msg = q->delete_head(); - ) - return msg; - } - - void gr_py_msg_queue__insert_tail(gr_msg_queue_sptr q, gr_message_sptr msg) { - GR_PYTHON_BLOCKING_CODE( - q->insert_tail(msg); - ) - } -%} - -// smash in new python delete_head and insert_tail methods... -%pythoncode %{ -gr_msg_queue_sptr.delete_head = gr_py_msg_queue__delete_head -gr_msg_queue_sptr.insert_tail = gr_py_msg_queue__insert_tail -gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail -%} -#endif // SWIGPYTHON |