GNU Radio 3.6.4.1 C++ API
gr_tag_debug.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2012 Free Software Foundation, Inc.
4
*
5
* This file is part of GNU Radio
6
*
7
* GNU Radio is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3, or (at your option)
10
* any later version.
11
*
12
* GNU Radio is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with GNU Radio; see the file COPYING. If not, write to
19
* the Free Software Foundation, Inc., 51 Franklin Street,
20
* Boston, MA 02110-1301, USA.
21
*/
22
23
#ifndef INCLUDED_GR_TAG_DEBUG_H
24
#define INCLUDED_GR_TAG_DEBUG_H
25
26
#include <
gr_core_api.h
>
27
#include <
gr_sync_block.h
>
28
#include <
gruel/thread.h
>
29
#include <stddef.h>
30
31
class
gr_tag_debug;
32
typedef
boost::shared_ptr<gr_tag_debug>
gr_tag_debug_sptr
;
33
34
GR_CORE_API
gr_tag_debug_sptr
35
gr_make_tag_debug(
size_t
sizeof_stream_item,
const
std::string &name);
36
37
/*!
38
* \brief Bit bucket that prints out any tag received.
39
* \ingroup sink_blk
40
*
41
* This block collects all tags sent to it on all input ports and
42
* displays them to stdout in a formatted way. The \p name parameter
43
* is used to identify which debug sink generated the tag, so when
44
* connecting a block to this debug sink, an appropriate name is
45
* something that identifies the input block.
46
*
47
* This block otherwise acts as a NULL sink in that items from the
48
* input stream are ignored. It is designed to be able to attach to
49
* any block and watch all tags streaming out of that block for
50
* debugging purposes.
51
*
52
* The tags from the last call to this work function are stored and
53
* can be retrieved using the function 'current_tags'.
54
*/
55
class
GR_CORE_API
gr_tag_debug :
public
gr_sync_block
56
{
57
private
:
58
friend
GR_CORE_API
gr_tag_debug_sptr
59
gr_make_tag_debug(
size_t
sizeof_stream_item,
const
std::string &name);
60
gr_tag_debug(
size_t
sizeof_stream_item,
const
std::string &name);
61
62
std::string
d_name
;
63
std::vector<gr_tag_t> d_tags;
64
std::vector<gr_tag_t>::iterator d_tags_itr;
65
bool
d_display;
66
gruel::mutex
d_mutex;
67
68
public
:
69
/*!
70
* \brief Returns a vector of gr_tag_t items as of the last call to
71
* work.
72
*/
73
std::vector<gr_tag_t> current_tags();
74
75
/*!
76
* \brief Set the display of tags to stdout on/off.
77
*/
78
void
set_display(
bool
d);
79
80
int
work
(
int
noutput_items,
81
gr_vector_const_void_star
&input_items,
82
gr_vector_void_star
&output_items);
83
};
84
85
#endif
/* INCLUDED_GR_TAG_DEBUG_H */
gnuradio
gnuradio-core
src
lib
general
gr_tag_debug.h
Generated by
1.8.1.1