gr-baz Package
baz_burst_buffer.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2007,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/*
24 * gr-baz by Balint Seeber (http://spench.net/contact)
25 * Information, documentation & samples: http://wiki.spench.net/wiki/gr-baz
26 */
27
28#ifndef INCLUDED_BAZ_BURST_BUFFER_H
29#define INCLUDED_BAZ_BURST_BUFFER_H
30
31#include <gnuradio/block.h>
32#include <boost/thread.hpp>
33
35typedef boost::shared_ptr<baz_burst_buffer> baz_burst_buffer_sptr;
36
37BAZ_API baz_burst_buffer_sptr baz_make_burst_buffer (size_t itemsize, int flush_length = 0, const std::string& length_tag_name = "", bool verbose = false, bool only_burst = false, bool strip_tags = true);
38
39/*!
40 * \brief buffer bursts
41 * \ingroup misc_blk
42 */
43class BAZ_API baz_burst_buffer : public gr::block
44{
45 friend BAZ_API baz_burst_buffer_sptr baz_make_burst_buffer (size_t itemsize, int flush_length, const std::string& length_tag_name, bool verbose, bool only_burst, bool strip_tags);
46
47 baz_burst_buffer (size_t itemsize, int flush_length = 0, const std::string& length_tag_name = "", bool verbose = false, bool only_burst = false, bool strip_tags = true);
48
49 //boost::mutex d_mutex;
50 size_t d_itemsize;
51 size_t d_buffer_size;
52 void* d_buffer;
53 size_t d_sample_count;
54 bool d_in_burst;
55 bool d_add_sob;
56 int d_flush_length;
57 int d_flush_count;
58 bool d_verbose;
59 bool d_use_length_tag;
60 pmt::pmt_t d_length_tag_name;
61 bool d_strip_tags;
62 uint64_t d_sob_offset;
63 bool d_only_burst;
64
65public:
67
68 //int delay () const { return d_delay; }
69 //void set_delay (int delay);
70
72
73 void forecast(int noutput_items, gr_vector_int &ninput_items_required);
74 int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
75};
76
77#endif
#define BAZ_API
Definition api.h:19
BAZ_API baz_burst_buffer_sptr baz_make_burst_buffer(size_t itemsize, int flush_length=0, const std::string &length_tag_name="", bool verbose=false, bool only_burst=false, bool strip_tags=true)
buffer bursts
Definition baz_burst_buffer.h:44
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
friend BAZ_API baz_burst_buffer_sptr baz_make_burst_buffer(size_t itemsize, int flush_length, const std::string &length_tag_name, bool verbose, bool only_burst, bool strip_tags)
void reallocate_buffer(void)