[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8843 - in gnuradio/branches/developers/jcorgan/ptrfix
From: |
eb |
Subject: |
[Commit-gnuradio] r8843 - in gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib: general runtime |
Date: |
Wed, 9 Jul 2008 12:39:19 -0600 (MDT) |
Author: eb
Date: 2008-07-09 12:39:15 -0600 (Wed, 09 Jul 2008)
New Revision: 8843
Added:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.h
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/general/gr_kludge_copy.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/Makefile.am
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_basic_block.h
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.h
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_top_block.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h
Log:
Fix that allows C++ classes derived from gr_hier_block2 to
use the new self() method to get a magic object that can be passed
to connect or disconnect to refer to their own inputs and outputs.
Note that the constructor wrapper of all classes derived from
gr_hier_block2 (and thus gr_top_block too) MUST USE the new
gnuradio::get_initial_sptr function to get the initial shared pointer.
gnuradio::get_initial_sptr works on all block types, and should be
used in all new code. See qa_gr_hier_block2_derived.{h,cc} for an example.
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/general/gr_kludge_copy.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/general/gr_kludge_copy.cc
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/general/gr_kludge_copy.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -31,7 +31,7 @@
gr_kludge_copy_sptr
gr_make_kludge_copy(size_t itemsize)
{
- return gr_kludge_copy_sptr(new gr_kludge_copy(itemsize));
+ return gnuradio::get_initial_sptr(new gr_kludge_copy(itemsize));
}
gr_kludge_copy::gr_kludge_copy(size_t itemsize)
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/Makefile.am
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/Makefile.am
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/Makefile.am
2008-07-09 18:39:15 UTC (rev 8843)
@@ -50,6 +50,7 @@
gr_realtime.cc \
gr_scheduler_thread.cc \
gr_single_threaded_scheduler.cc \
+ gr_sptr_magic.cc \
gr_sync_block.cc \
gr_sync_decimator.cc \
gr_sync_interpolator.cc \
@@ -99,6 +100,7 @@
gr_scheduler_thread.h \
gr_select_handler.h \
gr_single_threaded_scheduler.h \
+ gr_sptr_magic.h \
gr_sync_block.h \
gr_sync_decimator.h \
gr_sync_interpolator.h \
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_basic_block.h
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_basic_block.h
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_basic_block.h
2008-07-09 18:39:15 UTC (rev 8843)
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2008 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -24,6 +24,7 @@
#define INCLUDED_GR_BASIC_BLOCK_H
#include <gr_runtime_types.h>
+#include <gr_sptr_magic.h>
#include <boost/enable_shared_from_this.hpp>
#include <string>
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2007 Free Software Foundation, Inc.
+ * Copyright 2006,2007,2008 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -31,36 +31,37 @@
#define GR_HIER_BLOCK2_DEBUG 0
+
gr_hier_block2_sptr
gr_make_hier_block2(const std::string &name,
gr_io_signature_sptr input_signature,
gr_io_signature_sptr output_signature)
{
- return gr_hier_block2_sptr(new gr_hier_block2(name, input_signature,
output_signature));
+ return gnuradio::get_initial_sptr(new gr_hier_block2(name, input_signature,
output_signature));
}
gr_hier_block2::gr_hier_block2(const std::string &name,
gr_io_signature_sptr input_signature,
gr_io_signature_sptr output_signature)
: gr_basic_block(name, input_signature, output_signature),
- d_me(gr_hier_block2_sptr(this)), // temporary holder for shared pointer
d_detail(new gr_hier_block2_detail(this))
{
+ // This bit of magic ensures that self() works in the constructors of
derived classes.
+ gnuradio::detail::sptr_magic::create_and_stash_initial_sptr(this);
}
-gr_hier_block2_sptr
-gr_hier_block2::get_initial_sptr()
+gr_hier_block2::~gr_hier_block2()
{
- gr_hier_block2_sptr p(d_me);
- d_me.reset();
- return p;
+ delete d_detail;
}
-gr_hier_block2::~gr_hier_block2()
+gr_hier_block2::opaque_self
+gr_hier_block2::self()
{
- delete d_detail;
+ return shared_from_this();
}
+
void
gr_hier_block2::connect(gr_basic_block_sptr block)
{
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.h
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.h
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2.h
2008-07-09 18:39:15 UTC (rev 8843)
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2007 Free Software Foundation, Inc.
+ * Copyright 2006,2007,2008 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -53,9 +53,6 @@
gr_hier_block2_detail *d_detail;
protected:
- gr_hier_block2_sptr d_me;
- gr_hier_block2_sptr get_initial_sptr();
-
gr_hier_block2(const std::string &name,
gr_io_signature_sptr input_signature,
gr_io_signature_sptr output_signature);
@@ -64,6 +61,22 @@
virtual ~gr_hier_block2();
/*!
+ * \brief typedef for object returned from self().
+ *
+ * This type is only guaranteed to be passable to connect and disconnect.
+ * No other assumptions should be made about it.
+ */
+ typedef gr_basic_block_sptr opaque_self;
+
+ /*!
+ * \brief Return an object, representing the current block, which can be
passed to connect.
+ *
+ * The returned object may only be used as an argument to connect or
disconnect.
+ * Any other use of self() results in unspecified (erroneous) behavior.
+ */
+ opaque_self self();
+
+ /*!
* \brief Add a stand-alone (possibly hierarchical) block to internal graph
*
* This adds a gr-block or hierarchical block to the internal graph
@@ -135,7 +148,7 @@
gr_flat_flowgraph_sptr flatten() const;
};
-inline gr_hier_block2_sptr make_hier_block2_sptr(gr_basic_block_sptr block) {
+inline gr_hier_block2_sptr cast_to_hier_block2_sptr(gr_basic_block_sptr block)
{
return boost::dynamic_pointer_cast<gr_hier_block2, gr_basic_block>(block);
}
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -78,8 +78,8 @@
if (src.get() == dst.get())
throw std::invalid_argument("connect: src and destination blocks cannot be
the same");
- gr_hier_block2_sptr src_block(make_hier_block2_sptr(src));
- gr_hier_block2_sptr dst_block(make_hier_block2_sptr(dst));
+ gr_hier_block2_sptr src_block(cast_to_hier_block2_sptr(src));
+ gr_hier_block2_sptr dst_block(cast_to_hier_block2_sptr(dst));
if (src_block && src.get() != d_owner) {
if (GR_HIER_BLOCK2_DETAIL_DEBUG)
@@ -147,8 +147,8 @@
if (src.get() == dst.get())
throw std::invalid_argument("disconnect: source and destination blocks
cannot be the same");
- gr_hier_block2_sptr src_block(make_hier_block2_sptr(src));
- gr_hier_block2_sptr dst_block(make_hier_block2_sptr(dst));
+ gr_hier_block2_sptr src_block(cast_to_hier_block2_sptr(src));
+ gr_hier_block2_sptr dst_block(cast_to_hier_block2_sptr(dst));
if (src_block && src.get() != d_owner) {
if (GR_HIER_BLOCK2_DETAIL_DEBUG)
@@ -307,7 +307,7 @@
return endp;
// Check if endpoint is a hierarchical block
- gr_hier_block2_sptr hier_block2(make_hier_block2_sptr(endp.block()));
+ gr_hier_block2_sptr hier_block2(cast_to_hier_block2_sptr(endp.block()));
if (hier_block2) {
if (GR_HIER_BLOCK2_DETAIL_DEBUG)
std::cout << "Resolving endpoint " << endp << " as an "
@@ -351,7 +351,7 @@
// Recurse hierarchical children
for (gr_basic_block_viter_t p = blocks.begin(); p != blocks.end(); p++) {
- gr_hier_block2_sptr hier_block2(make_hier_block2_sptr(*p));
+ gr_hier_block2_sptr hier_block2(cast_to_hier_block2_sptr(*p));
if (hier_block2)
hier_block2->d_detail->flatten_aux(sfg);
}
Added:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
(rev 0)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <gr_sptr_magic.h>
+#include <gr_hier_block2.h>
+#include <map>
+#include <stdexcept>
+
+
+#if 0
+ #include <boost/thread.hpp>
+ typedef boost::mutex mutex;
+ typedef boost::mutex::scoped_lock scoped_lock;
+#else
+ #include <omnithread.h>
+ typedef omni_mutex mutex;
+ typedef omni_mutex_lock scoped_lock;
+#endif
+
+namespace gnuradio {
+
+ static mutex s_mutex;
+ typedef std::map<gr_basic_block*, gr_basic_block_sptr> sptr_map;
+ static sptr_map s_map;
+
+ void
+ detail::sptr_magic::create_and_stash_initial_sptr(gr_hier_block2 *p)
+ {
+ gr_basic_block_sptr sptr(p);
+ scoped_lock l();
+ s_map.insert(sptr_map::value_type(static_cast<gr_basic_block *>(p), sptr));
+ }
+
+
+ gr_basic_block_sptr
+ detail::sptr_magic::fetch_initial_sptr(gr_basic_block *p)
+ {
+ /*
+ * If p isn't a subclass of gr_hier_block2, just create the
+ * shared ptr and return it.
+ */
+ gr_hier_block2 *hb2 = dynamic_cast<gr_hier_block2 *>(p);
+ if (!hb2){
+ return gr_basic_block_sptr(p);
+ }
+
+ /*
+ * p is a subclass of gr_hier_block2, thus we've already created the
shared pointer
+ * and stashed it away. Fish it out and return it.
+ */
+ scoped_lock l();
+ sptr_map::iterator pos = s_map.find(static_cast<gr_basic_block *>(p));
+ if (pos == s_map.end())
+ throw std::invalid_argument("gr_sptr_magic: invalid pointer!");
+
+ gr_basic_block_sptr sptr = pos->second;
+ s_map.erase(pos);
+ return sptr;
+ }
+};
+
Property changes on:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.h
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.h
(rev 0)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.h
2008-07-09 18:39:15 UTC (rev 8843)
@@ -0,0 +1,51 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_GR_SPTR_MAGIC_H
+#define INCLUDED_GR_SPTR_MAGIC_H
+
+#include <boost/shared_ptr.hpp>
+
+class gr_basic_block;
+class gr_hier_block2;
+
+namespace gnuradio {
+
+ namespace detail {
+
+ class sptr_magic {
+ public:
+ static boost::shared_ptr<gr_basic_block>
fetch_initial_sptr(gr_basic_block *p);
+ static void create_and_stash_initial_sptr(gr_hier_block2 *p);
+ };
+ };
+
+ /*
+ * \brief New! Improved! Standard method to get/create the
boost::shared_ptr for a block.
+ */
+ template<class T>
+ boost::shared_ptr<T>
+ get_initial_sptr(T *p)
+ {
+ return boost::dynamic_pointer_cast<T,
gr_basic_block>(detail::sptr_magic::fetch_initial_sptr(p));
+ }
+};
+
+#endif /* INCLUDED_GR_SPTR_MAGIC_H */
Property changes on:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_sptr_magic.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_top_block.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_top_block.cc
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/gr_top_block.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -34,7 +34,7 @@
gr_top_block_sptr
gr_make_top_block(const std::string &name)
{
- return gr_top_block_sptr(new gr_top_block(name));
+ return gnuradio::get_initial_sptr(new gr_top_block(name));
}
gr_top_block::gr_top_block(const std::string &name)
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2.cc
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2008 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -33,16 +33,25 @@
void qa_gr_hier_block2::test_make()
{
gr_hier_block2_sptr src1(gr_make_hier_block2("test",
- gr_make_io_signature(1, 1,
sizeof(int)),
- gr_make_io_signature(1, 1,
sizeof(int))));
+ gr_make_io_signature(1, 2, 1 *
sizeof(int)),
+ gr_make_io_signature(3, 4, 2 *
sizeof(int))));
CPPUNIT_ASSERT(src1);
CPPUNIT_ASSERT_EQUAL(std::string("test"), src1->name());
- CPPUNIT_ASSERT_EQUAL(1, src1->input_signature()->max_streams());
- CPPUNIT_ASSERT_EQUAL(1, src1->output_signature()->min_streams());
- CPPUNIT_ASSERT_EQUAL(1, src1->output_signature()->max_streams());
- CPPUNIT_ASSERT_EQUAL((int) sizeof(int),
+
+ CPPUNIT_ASSERT_EQUAL(1 * (int) sizeof(int),
+ src1->input_signature()->sizeof_stream_item(0));
+
+ CPPUNIT_ASSERT_EQUAL(1, src1->input_signature()->min_streams());
+ CPPUNIT_ASSERT_EQUAL(2, src1->input_signature()->max_streams());
+
+
+ CPPUNIT_ASSERT_EQUAL(2 * (int) sizeof(int),
src1->output_signature()->sizeof_stream_item(0));
+
+ CPPUNIT_ASSERT_EQUAL(3, src1->output_signature()->min_streams());
+ CPPUNIT_ASSERT_EQUAL(4, src1->output_signature()->max_streams());
+
}
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc
2008-07-09 18:39:15 UTC (rev 8843)
@@ -32,12 +32,27 @@
#include <gr_head.h>
#include <gr_kludge_copy.h>
+// Declare a test C++ hierarchical block
+
+class gr_derived_block;
+typedef boost::shared_ptr<gr_derived_block> gr_derived_block_sptr;
+gr_derived_block_sptr gr_make_derived_block();
+
+class gr_derived_block : public gr_hier_block2
+{
+private:
+ friend gr_derived_block_sptr gr_make_derived_block();
+ gr_derived_block();
+
+public:
+ ~gr_derived_block();
+};
+
+
gr_derived_block_sptr
gr_make_derived_block()
{
- gr_derived_block *p = new gr_derived_block();
- gr_derived_block_sptr s(p->get_initial_sptr());
- return s;
+ return gnuradio::get_initial_sptr(new gr_derived_block());
}
gr_derived_block::gr_derived_block()
@@ -47,8 +62,8 @@
{
gr_block_sptr copy(gr_make_kludge_copy(sizeof(int)));
- connect(shared_from_this(), 0, copy, 0);
- connect(copy, 0, shared_from_this(), 0);
+ connect(self(), 0, copy, 0);
+ connect(copy, 0, self(), 0);
}
gr_derived_block::~gr_derived_block()
Modified:
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h
===================================================================
---
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h
2008-07-09 18:10:25 UTC (rev 8842)
+++
gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h
2008-07-09 18:39:15 UTC (rev 8843)
@@ -23,35 +23,19 @@
#ifndef INCLUDED_QA_GR_HIER_BLOCK2_DERIVED_H
#define INCLUDED_QA_GR_HIER_BLOCK2_DERIVED_H
-#include <gr_top_block.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>
#include <stdexcept>
-// Declare a test C++ hierarchical block
-class gr_derived_block;
-typedef boost::shared_ptr<gr_derived_block> gr_derived_block_sptr;
-gr_derived_block_sptr gr_make_derived_block();
-
-class gr_derived_block : public gr_hier_block2
-{
-private:
- friend gr_derived_block_sptr gr_make_derived_block();
- gr_derived_block();
-
-public:
- ~gr_derived_block();
-};
-
// Declare a QA test case
class qa_gr_hier_block2_derived : public CppUnit::TestCase
{
- CPPUNIT_TEST_SUITE(qa_gr_hier_block2_derived);
- CPPUNIT_TEST(test_1);
- CPPUNIT_TEST_SUITE_END();
+ CPPUNIT_TEST_SUITE(qa_gr_hier_block2_derived);
+ CPPUNIT_TEST(test_1);
+ CPPUNIT_TEST_SUITE_END();
private:
- void test_1();
+ void test_1();
};
#endif /* INCLUDED_QA_GR_HIER_BLOCK2_DERIVED_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8843 - in gnuradio/branches/developers/jcorgan/ptrfix/gnuradio-core/src/lib: general runtime,
eb <=