GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
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  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_GR_TAGGED_FILE_SINK_H
12 #define INCLUDED_GR_TAGGED_FILE_SINK_H
13 
14 #include <gnuradio/blocks/api.h>
15 #include <gnuradio/sync_block.h>
16 
17 namespace gr {
18 namespace blocks {
19 
20 /*!
21  * \brief A file sink that uses tags to save files.
22  * \ingroup file_operators_blk
23  * \ingroup stream_tag_tools_blk
24  *
25  * \details
26  * The sink uses a tag with the key 'burst' to trigger the saving
27  * of the burst data to a new file. If the value of this tag is
28  * True, it will open a new file and start writing all incoming
29  * data to it. If the tag is False, it will close the file (if
30  * already opened). The file names are based on the time when the
31  * burst tag was seen. If there is an 'rx_time' tag (standard with
32  * UHD sources), that is used as the time. If no 'rx_time' tag is
33  * found, the new time is calculated based off the sample rate of
34  * the block.
35  */
36 class BLOCKS_API tagged_file_sink : virtual public sync_block
37 {
38 public:
39  // gr::blocks::tagged_file_sink::sptr
40  typedef std::shared_ptr<tagged_file_sink> sptr;
41 
42  /*!
43  * \brief Build a tagged_file_sink block.
44  *
45  * \param itemsize The item size of the input data stream.
46  * \param samp_rate The sample rate used to determine the time
47  * difference between bursts
48  */
49  static sptr make(size_t itemsize, double samp_rate);
50 };
51 
52 } /* namespace blocks */
53 } /* namespace gr */
54 
55 #endif /* INCLUDED_GR_TAGGED_FILE_SINK_H */
A file sink that uses tags to save files.
Definition: tagged_file_sink.h:37
std::shared_ptr< tagged_file_sink > sptr
Definition: tagged_file_sink.h:40
static sptr make(size_t itemsize, double samp_rate)
Build a tagged_file_sink block.
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GR_RUNTIME_API size_t itemsize(types::vector_type type)
GNU Radio logging wrapper.
Definition: basic_block.h:29