GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tagged_file_sink.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2010,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_TAGGED_FILE_SINK_H
24 #define INCLUDED_GR_TAGGED_FILE_SINK_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 A file sink that uses tags to save files.
34  * \ingroup file_operators_blk
35  * \ingroup stream_tag_tools_blk
36  *
37  * \details
38  * The sink uses a tag with the key 'burst' to trigger the saving
39  * of the burst data to a new file. If the value of this tag is
40  * True, it will open a new file and start writing all incoming
41  * data to it. If the tag is False, it will close the file (if
42  * already opened). The file names are based on the time when the
43  * burst tag was seen. If there is an 'rx_time' tag (standard with
44  * UHD sources), that is used as the time. If no 'rx_time' tag is
45  * found, the new time is calculated based off the sample rate of
46  * the block.
47  */
48  class BLOCKS_API tagged_file_sink : virtual public sync_block
49  {
50  public:
51  // gr::blocks::tagged_file_sink::sptr
52  typedef boost::shared_ptr<tagged_file_sink> sptr;
53 
54  /*!
55  * \brief Build a tagged_file_sink block.
56  *
57  * \param itemsize The item size of the input data stream.
58  * \param samp_rate The sample rate used to determine the time
59  * difference between bursts
60  */
61  static sptr make(size_t itemsize, double samp_rate);
62  };
63 
64  } /* namespace blocks */
65 } /* namespace gr */
66 
67 #endif /* INCLUDED_GR_TAGGED_FILE_SINK_H */
Include this header to use the message passing features.
Definition: logger.h:131
#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
A file sink that uses tags to save files.
Definition: tagged_file_sink.h:48
boost::shared_ptr< tagged_file_sink > sptr
Definition: tagged_file_sink.h:52
BLOCKS_API size_t itemsize(vector_type type)