diff options
author | jcorgan | 2007-04-28 02:20:28 +0000 |
---|---|---|
committer | jcorgan | 2007-04-28 02:20:28 +0000 |
commit | b26ea69676c09f5366a9e2f33b11ae5a7521ffe5 (patch) | |
tree | 0641c1c25d6e827f70941e07f4611d0a2b6b83cd /gnuradio-core/src/lib/runtime/gr_runtime.cc | |
parent | 00696b9f754338de9362932c1ecfb1e144a38786 (diff) | |
download | gnuradio-b26ea69676c09f5366a9e2f33b11ae5a7521ffe5.tar.gz gnuradio-b26ea69676c09f5366a9e2f33b11ae5a7521ffe5.tar.bz2 gnuradio-b26ea69676c09f5366a9e2f33b11ae5a7521ffe5.zip |
Merged -r 5137:5174 from developer branch jcorgan/hb. Trunk passes distcheck. Converts gr.hier_block2 API to not use 'define_component' methodology anymore.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5177 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_runtime.cc')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_runtime.cc | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_runtime.cc b/gnuradio-core/src/lib/runtime/gr_runtime.cc index aab8ea5ab..a8b932f21 100644 --- a/gnuradio-core/src/lib/runtime/gr_runtime.cc +++ b/gnuradio-core/src/lib/runtime/gr_runtime.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2007 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -34,57 +34,64 @@ static gr_runtime *s_runtime = 0; gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block) { - return gr_runtime_sptr(new gr_runtime(top_block)); + return gr_runtime_sptr(new gr_runtime(top_block)); } gr_runtime::gr_runtime(gr_hier_block2_sptr top_block) { - d_impl = new gr_runtime_impl(top_block); - s_runtime = this; + d_impl = new gr_runtime_impl(top_block); + s_runtime = this; } gr_runtime::~gr_runtime() { - s_runtime = 0; // we don't own this - delete d_impl; + s_runtime = 0; // we don't own this + delete d_impl; } // FIXME: This prevents using more than one gr_runtime instance static void runtime_sigint_handler(int signum) { - - if (s_runtime) - s_runtime->stop(); + if (s_runtime) + s_runtime->stop(); } void gr_runtime::start() { - gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); + gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); - d_impl->start(); + d_impl->start(); } void gr_runtime::stop() { - d_impl->stop(); + d_impl->stop(); } void gr_runtime::wait() { - gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); + gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); - d_impl->wait(); + d_impl->wait(); } void gr_runtime::run() { - gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); + gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); + + d_impl->start(); + d_impl->wait(); +} + +void +gr_runtime::restart() +{ + gr_local_sighandler sigint(SIGINT, runtime_sigint_handler); - d_impl->start(); - d_impl->wait(); + d_impl->restart(); } |