Merged r5241:5242 from jcorgan/reconf into trunk. Trunk passes distcheck.
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_runtime.cc
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006,2007 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 2, 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 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26
27 #include <gr_runtime.h>
28 #include <gr_runtime_impl.h>
29 #include <iostream>
30
31 gr_runtime_sptr 
32 gr_make_runtime(gr_hier_block2_sptr top_block)
33 {
34   return gr_runtime_sptr(new gr_runtime(top_block));
35 }
36
37 gr_runtime::gr_runtime(gr_hier_block2_sptr top_block)
38 {
39   d_impl = new gr_runtime_impl(top_block, this);
40 }
41   
42 gr_runtime::~gr_runtime()
43 {
44   delete d_impl;
45 }
46
47 void 
48 gr_runtime::start()
49 {
50   d_impl->start();
51 }
52
53 void 
54 gr_runtime::stop()
55 {
56   d_impl->stop();
57 }
58
59 void 
60 gr_runtime::wait()
61 {
62   d_impl->wait();
63 }
64
65 void 
66 gr_runtime::run()
67 {
68   start();
69   wait();
70 }
71
72 void
73 gr_runtime::restart()
74 {
75   d_impl->restart();
76 }
77
78 void
79 gr_runtime::lock()
80 {
81   d_impl->lock();
82 }
83
84 void
85 gr_runtime::unlock()
86 {
87   d_impl->unlock();
88 }
89