GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
tags_strobe.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 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_TAGS_STROBE_H
24 #define INCLUDED_GR_TAGS_STROBE_H
25 
26 #include <gnuradio/blocks/api.h>
27 #include <gnuradio/sync_block.h>
28 
29 namespace gr {
30 namespace blocks {
31 
32 /*!
33  * \brief Send tags at defined interval
34  * \ingroup debug_blk
35  *
36  * \details
37  * Sends a tag with key 'strobe' and a user-defined value (as a
38  * PMT) every \p nsamps number of samples. Useful for
39  * testing/debugging the tags system.
40  *
41  * Because tags are sent with a data stream, this is a source
42  * block that acts identical to a null_source block.
43  */
44 class BLOCKS_API tags_strobe : virtual public sync_block
45 {
46 public:
47  // gr::blocks::tags_strobe::sptr
48  typedef boost::shared_ptr<tags_strobe> sptr;
49 
50  /*!
51  * Make a tags stobe block to send tags with value \p value
52  * every \p nsamps number of samples.
53  *
54  * \param sizeof_stream_item size of the stream items in bytes.
55  * \param value The value of the tags to send, as a PMT.
56  * \param nsamps the number of samples between each tag.
57  * \param key The tag key to sent
58  */
59  static sptr make(size_t sizeof_stream_item,
60  pmt::pmt_t value,
61  uint64_t nsamps,
62  pmt::pmt_t key = pmt::intern("strobe"));
63 
64  /*!
65  * Reset the value of the tags being sent.
66  * \param value The value of the tags to send as a PMT.
67  */
68  virtual void set_value(pmt::pmt_t value) = 0;
69 
70  /*!
71  * Change the tag key we are sending
72  */
73  virtual void set_key(pmt::pmt_t key) = 0;
74 
75  /*!
76  * Get the value of the tags being sent.
77  */
78  virtual pmt::pmt_t value() const = 0;
79 
80  /*!
81  * Get the key of the tags being sent.
82  */
83  virtual pmt::pmt_t key() const = 0;
84 
85  /*!
86  * Reset the sending interval.
87  * \param nsamps the number of samples between each tag
88  */
89  virtual void set_nsamps(uint64_t nsamps) = 0;
90 
91  /*!
92  * Get the number of samples between the tag strobe.
93  */
94  virtual uint64_t nsamps() const = 0;
95 };
96 
97 } /* namespace blocks */
98 } /* namespace gr */
99 
100 #endif /* INCLUDED_GR_TAGS_STROBE_H */
boost::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:96
PMT_API pmt_t intern(const std::string &s)
Alias for pmt_string_to_symbol.
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:30
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
boost::shared_ptr< tags_strobe > sptr
Definition: tags_strobe.h:48
Send tags at defined interval.
Definition: tags_strobe.h:44