GNU Radio's CCS Package
random_periodic_msg_source_impl.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
3 * Copyright (C) 2016 Paul Garver <garverp@gatech.edu>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_IMPL_H
19#define INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_IMPL_H
20
22#include <boost/random.hpp>
23#include <boost/generator_iterator.hpp>
24
25namespace gr {
26namespace foo {
27
29 private:
30 void run(random_periodic_msg_source_impl *instance);
31 int d_msg_len;
32 int d_nmsg_total;
33 int d_nmsg_left;
34 unsigned int d_seed;
35 bool d_debug;
36 bool d_quit;
37 bool d_finished;
38 long d_interval;
39 boost::thread *d_thread;
40 gr::thread::mutex d_mutex;
41 boost::mt19937 d_rng;
42 boost::uniform_int<> d_brange;
43 boost::variate_generator< boost::mt19937, boost::uniform_int<> > d_randbytes;
44
45 public:
47 long interval, int num_msg,
48 bool quit, bool debug, int seed);
50
51 void set_nmsg(int nmsg);
52 int get_nmsg();
53
54 void set_delay(long delay);
55 long get_delay();
56
57 void start_tx();
58 void stop_tx();
59 pmt::pmt_t generate_msg();
60 bool is_running();
61
62 };
63
64} // namespace foo
65} // namespace gr
66
67#endif /* INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_IMPL_H */
Definition: random_periodic_msg_source_impl.h:28
random_periodic_msg_source_impl(int msg_len, long interval, int num_msg, bool quit, bool debug, int seed)
Definition: random_periodic_msg_source.h:28
Definition: burst_tagger.h:27