diff options
author | Josh Blum | 2012-08-19 14:27:11 -0700 |
---|---|---|
committer | Josh Blum | 2012-08-26 16:03:51 -0700 |
commit | fa25d15ed1a7b85869229055ef32166ef1d8bef2 (patch) | |
tree | 0f39ab553dce30e9c8c11ab20f820d5753d5bf47 /lib/element.cpp | |
parent | 87be8242fd5855a8e8f6a76fddf40275b711c784 (diff) | |
download | sandhi-fa25d15ed1a7b85869229055ef32166ef1d8bef2.tar.gz sandhi-fa25d15ed1a7b85869229055ef32166ef1d8bef2.tar.bz2 sandhi-fa25d15ed1a7b85869229055ef32166ef1d8bef2.zip |
runtime: work on unit tests
Diffstat (limited to 'lib/element.cpp')
-rw-r--r-- | lib/element.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/element.cpp b/lib/element.cpp index 3c97675..d73d68b 100644 --- a/lib/element.cpp +++ b/lib/element.cpp @@ -14,7 +14,11 @@ // You should have received a copy of the GNU Lesser General Public License // along with io_sig program. If not, see <http://www.gnu.org/licenses/>. +#include "element_impl.hpp" #include <gnuradio/element.hpp> +#include <boost/detail/atomic_count.hpp> + +static boost::detail::atomic_count unique_id_pool(0); using namespace gnuradio; @@ -22,3 +26,41 @@ Element::Element(void) { //NOP } + +Element::Element(const std::string &name) +{ + this->reset(new ElementImpl()); + (*this)->name = name; + (*this)->unique_id = ++unique_id_pool; +} + +long Element::unique_id(void) const +{ + return (*this)->unique_id; +} + +std::string Element::name(void) const +{ + return (*this)->name; +} + + +void Element::set_output_signature(gr_io_signature_sptr sig) +{ + (*this)->output_signature= sig; +} + +void Element::set_input_signature(gr_io_signature_sptr sig) +{ + (*this)->input_signature = sig; +} + +gr_io_signature_sptr Element::input_signature(void) const +{ + return (*this)->input_signature; +} + +gr_io_signature_sptr Element::output_signature(void) const +{ + return (*this)->output_signature; +} |