diff options
Diffstat (limited to 'include/gnuradio')
-rw-r--r-- | include/gnuradio/element.hpp | 7 | ||||
-rw-r--r-- | include/gnuradio/runtime_api.h | 1 | ||||
-rw-r--r-- | include/gnuradio/top_block.hpp | 7 |
3 files changed, 9 insertions, 6 deletions
diff --git a/include/gnuradio/element.hpp b/include/gnuradio/element.hpp index 71dc359..ad2e1e8 100644 --- a/include/gnuradio/element.hpp +++ b/include/gnuradio/element.hpp @@ -30,6 +30,7 @@ struct GR_RUNTIME_API Element : boost::shared_ptr<ElementImpl> //! Create an empty element Element(void); + //! Creates a new element given the name Element(const std::string &name); /*! @@ -40,10 +41,16 @@ struct GR_RUNTIME_API Element : boost::shared_ptr<ElementImpl> Element(const boost::shared_ptr<T> &elem) { *this = *elem; + weak_self = elem; } + //! for internal use only + boost::weak_ptr<Element> weak_self; + + //! An integer ID that is unique across the process long unique_id(void) const; + //! Get the name of this element std::string name(void) const; void set_output_signature(const gnuradio::IOSignature &sig); diff --git a/include/gnuradio/runtime_api.h b/include/gnuradio/runtime_api.h index 1f0cc44..bc359cc 100644 --- a/include/gnuradio/runtime_api.h +++ b/include/gnuradio/runtime_api.h @@ -27,6 +27,7 @@ #define GR_RUNTIME_API GR_CORE_API #include <boost/shared_ptr.hpp> +#include <boost/weak_ptr.hpp> namespace gnuradio { diff --git a/include/gnuradio/top_block.hpp b/include/gnuradio/top_block.hpp index 2981b04..09da0a5 100644 --- a/include/gnuradio/top_block.hpp +++ b/include/gnuradio/top_block.hpp @@ -60,12 +60,7 @@ struct GR_RUNTIME_API TopBlock : HierBlock * Run is for finite flow graph executions. * Mostly for testing purposes only. */ - void run(void) - { - this->start(); - this->stop(); - this->wait(); - } + void run(void); //! Start a flow graph execution (does not block) void start(void); |