diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-06 16:54:20 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-06 16:54:20 -0500 |
commit | dc44e9b9d9bc0b6cd88cafe88efb5bcb0fe8ab64 (patch) | |
tree | 0355fe948c6c939f1c5c92409a1efddb6468a12f /gr-blocks/include | |
parent | 9cfd03bd98693e62c6898f18d90d5d08f4d5c102 (diff) |
blocks: moving tag_debug block to gr-blocks.
Diffstat (limited to 'gr-blocks/include')
-rw-r--r-- | gr-blocks/include/blocks/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-blocks/include/blocks/tag_debug.h | 80 |
2 files changed, 81 insertions, 0 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index a223731cb0..79f095d265 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -156,6 +156,7 @@ install(FILES streams_to_stream.h streams_to_vector.h stretch_ff.h + tag_debug.h tagged_stream_to_pdu.h threshold_ff.h throttle.h diff --git a/gr-blocks/include/blocks/tag_debug.h b/gr-blocks/include/blocks/tag_debug.h new file mode 100644 index 0000000000..9d27a26ecd --- /dev/null +++ b/gr-blocks/include/blocks/tag_debug.h @@ -0,0 +1,80 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-2013 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. + */ + +#ifndef INCLUDED_GR_TAG_DEBUG_H +#define INCLUDED_GR_TAG_DEBUG_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief Bit bucket that prints out any tag received. + * \ingroup sink_blk + * + * This block collects all tags sent to it on all input ports and + * displays them to stdout in a formatted way. The \p name + * parameter is used to identify which debug sink generated the + * tag, so when connecting a block to this debug sink, an + * appropriate name is something that identifies the input block. + * + * This block otherwise acts as a NULL sink in that items from the + * input stream are ignored. It is designed to be able to attach + * to any block and watch all tags streaming out of that block for + * debugging purposes. + * + * The tags from the last call to this work function are stored + * and can be retrieved using the function 'current_tags'. + */ + class BLOCKS_API tag_debug : virtual public gr_sync_block + { + public: + // gr::blocks::tag_debug::sptr + typedef boost::shared_ptr<tag_debug> sptr; + + /*! + * Build a tag debug block + * + * \param sizeof_stream_item size of the items in the incoming stream. + * \param name name to identify which debug sink generated the info. + */ + static sptr make(size_t sizeof_stream_item, + const std::string &name); + + /*! + * \brief Returns a vector of gr_tag_t items as of the last call to + * work. + */ + virtual std::vector<gr_tag_t> current_tags() = 0; + + /*! + * \brief Set the display of tags to stdout on/off. + */ + virtual void set_display(bool d) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_TAG_DEBUG_H */ |