GNU Radio 3.6.4 C++ API
file_meta_source.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_BLOCKS_FILE_META_SOURCE_H
24
#define INCLUDED_BLOCKS_FILE_META_SOURCE_H
25
26
#include <
blocks/api.h
>
27
#include <
gr_sync_block.h
>
28
29
namespace
gr {
30
namespace
blocks {
31
32
/*!
33
* \brief Reads stream from file with meta-data headers. Headers
34
* are parsed into tags.
35
* \ingroup source_blk
36
*
37
* The information in the metadata headers includes:
38
*
39
* rx_rate (double): sample rate of data.
40
* rx_time (uint64_t, double): time stamp of first sample in segment.
41
* size (uint32_t): item size in bytes.
42
* type (gr_file_types as int32_t): data type.
43
* cplx (bool): Is data complex?
44
* strt (uint64_t): Starting byte of data in this segment.
45
* bytes (uint64_t): Size in bytes of data in this segment.
46
*
47
* Any item inside of the extra header dictionary is ready out and
48
* made into a stream tag.
49
*/
50
class
BLOCKS_API
file_meta_source
:
virtual
public
gr_sync_block
51
{
52
public
:
53
// gr::blocks::file_meta_source::sptr
54
typedef
boost::shared_ptr<file_meta_source>
sptr
;
55
56
/*!
57
* \brief Create a meta-data file source.
58
*
59
* \param filename (string): Name of file to write data to.
60
* \param repeat (bool): Repeats file when EOF is found.
61
* \param detached_header (bool): Set to true if header
62
* info is stored in a separate file (usually named filename.hdr)
63
* \param hdr_filename (string): Name of detached header file if used.
64
* Defaults to 'filename.hdr' if detached_header is true but this
65
* field is an empty string.
66
*/
67
static
sptr
make(
const
std::string &filename,
68
bool
repeat
=
false
,
69
bool
detached_header=
false
,
70
const
std::string &hdr_filename=
""
);
71
72
virtual
bool
open(
const
std::string &filename,
73
const
std::string &hdr_filename=
""
) = 0;
74
virtual
void
close() = 0;
75
virtual
void
do_update() = 0;
76
};
77
78
}
/* namespace blocks */
79
}
/* namespace gr */
80
81
#endif
/* INCLUDED_BLOCKS_FILE_META_SOURCE_H */
gnuradio
gr-blocks
include
blocks
file_meta_source.h
Generated by
1.8.1.1