Merged jcorgan/ptrfix -r8827:8843 into the trunk.
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 9 Jul 2008 18:59:37 +0000 (18:59 +0000)
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 9 Jul 2008 18:59:37 +0000 (18:59 +0000)
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.

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8844 221aa14e-8319-0410-a670-987f0aec2ac5

14 files changed:
gnuradio-core/src/lib/general/gr_kludge_copy.cc
gnuradio-core/src/lib/runtime/Makefile.am
gnuradio-core/src/lib/runtime/gr_basic_block.h
gnuradio-core/src/lib/runtime/gr_hier_block2.cc
gnuradio-core/src/lib/runtime/gr_hier_block2.h
gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
gnuradio-core/src/lib/runtime/gr_sptr_magic.cc [new file with mode: 0644]
gnuradio-core/src/lib/runtime/gr_sptr_magic.h [new file with mode: 0644]
gnuradio-core/src/lib/runtime/gr_top_block.cc
gnuradio-core/src/lib/runtime/qa_gr_hier_block2.cc
gnuradio-core/src/lib/runtime/qa_gr_hier_block2.h
gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc [new file with mode: 0644]
gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h [new file with mode: 0644]
gnuradio-core/src/lib/runtime/qa_runtime.cc

index 2589322febef0e803d600401e6c86f13471b1e37..142c444ca9f35f2f14a59227a26829eeaf75c7a8 100644 (file)
@@ -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)
index 0463581c72da269803d0b731f502126ef4411779..550031b944c32aba1d5dd9fe40d5125260dd5efe 100644 (file)
@@ -50,6 +50,7 @@ libruntime_la_SOURCES =                       \
        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                 \
@@ -67,6 +68,7 @@ libruntime_la_SOURCES =                       \
 libruntime_qa_la_SOURCES =                     \
        qa_gr_block.cc                          \
        qa_gr_hier_block2.cc                    \
+       qa_gr_hier_block2_derived.cc            \
        qa_gr_buffer.cc                         \
        qa_gr_flowgraph.cc                      \
        qa_gr_top_block.cc                      \
@@ -98,6 +100,7 @@ grinclude_HEADERS =                          \
        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                  \
@@ -117,6 +120,7 @@ noinst_HEADERS =                            \
        qa_gr_block.h                           \
        qa_gr_flowgraph.h                       \
        qa_gr_hier_block2.h                     \
+       qa_gr_hier_block2_derived.h             \
        qa_gr_buffer.h                          \
        qa_gr_io_signature.h                    \
        qa_gr_top_block.h                       \
index 8dc965da737594efa892333e634c71b87bf101d7..7dda1201fda2b24b52bd1c15dd4264b1cfe6b1b0 100644 (file)
@@ -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>
 
index 23f274da7d9231eec13c0a82ab0488ff5b79155e..e3a25e1a86ff58e927311b2adeef3b3a21164d44 100644 (file)
@@ -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
  * 
 
 #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)
+
+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,
@@ -44,6 +46,8 @@ gr_hier_block2::gr_hier_block2(const std::string &name,
   : gr_basic_block(name, input_signature, output_signature),
     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::~gr_hier_block2()
@@ -51,6 +55,13 @@ gr_hier_block2::~gr_hier_block2()
   delete d_detail;
 }
 
+gr_hier_block2::opaque_self
+gr_hier_block2::self()
+{
+  return shared_from_this();
+}
+
+
 void 
 gr_hier_block2::connect(gr_basic_block_sptr block)
 {
index 5e67a9010b21b2e23f6624d4181d0a2c69d91f7e..ece8b21ca57fdcbffa441ea729e542b3530b9c67 100644 (file)
@@ -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
  * 
@@ -51,7 +51,7 @@ private:
    * \brief Private implementation details of gr_hier_block2
    */
   gr_hier_block2_detail *d_detail;
-  
+    
 protected: 
   gr_hier_block2(const std::string &name,
                 gr_io_signature_sptr input_signature,
@@ -60,6 +60,22 @@ protected:
 public:
   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
    *
@@ -132,7 +148,7 @@ public:
   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);
 }
 
index 26a28fabd742ba83a5be867fd9765e80212c99eb..32cac2ea8c537e741cfab99938036e831c63d5c2 100644 (file)
@@ -78,8 +78,8 @@ gr_hier_block2_detail::connect(gr_basic_block_sptr src, int src_port,
   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 @@ gr_hier_block2_detail::disconnect(gr_basic_block_sptr src, int src_port,
   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 @@ gr_hier_block2_detail::resolve_endpoint(const gr_endpoint &endp, bool is_input)
     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 @@ gr_hier_block2_detail::flatten_aux(gr_flat_flowgraph_sptr sfg) const
 
   // 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);
   }
diff --git a/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc b/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
new file mode 100644 (file)
index 0000000..dc0b232
--- /dev/null
@@ -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;
+  }
+};
+
diff --git a/gnuradio-core/src/lib/runtime/gr_sptr_magic.h b/gnuradio-core/src/lib/runtime/gr_sptr_magic.h
new file mode 100644 (file)
index 0000000..872374a
--- /dev/null
@@ -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 */
index 339f3cb89e1ef0c853e992cec5204257a7447b57..3c8e28f70136d54ebd55e3a0da5417285e01345d 100644 (file)
@@ -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)
index 07b9d5ecf89ae9704edadd19a1593ac96a84b01c..2cf1a8d10eec73f3ce1ff103e195d61433c4ef0a 100644 (file)
@@ -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
  * 
 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());
+
 }
+
+
index a07ed7bf81fe62d88c74e12bd7a7dc536c58c642..3870b9f0f6a33b7e1e1ca13c43e6a9503f476f23 100644 (file)
@@ -32,12 +32,11 @@ class qa_gr_hier_block2 : public CppUnit::TestCase
     CPPUNIT_TEST_SUITE(qa_gr_hier_block2);
 
     CPPUNIT_TEST(test_make);
-    
+        
     CPPUNIT_TEST_SUITE_END();
 
 private:
     void test_make();
-    void test_derived();
 };
 
 #endif /* INCLUDED_QA_GR_HIER_BLOCK2_H */
diff --git a/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc b/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.cc
new file mode 100644 (file)
index 0000000..fe5f3a7
--- /dev/null
@@ -0,0 +1,87 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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 GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qa_gr_hier_block2_derived.h>
+#include <gr_top_block.h>
+#include <gr_io_signature.h>
+#include <gr_null_source.h>
+#include <gr_null_sink.h>
+#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()
+{
+  return gnuradio::get_initial_sptr(new gr_derived_block());
+}
+
+gr_derived_block::gr_derived_block()
+  : gr_hier_block2("gr_derived_block",
+                  gr_make_io_signature(1, 1, sizeof(int)), // Input signature
+                  gr_make_io_signature(1, 1, sizeof(int))) // Output signature
+{
+  gr_block_sptr copy(gr_make_kludge_copy(sizeof(int)));
+
+  connect(self(), 0, copy, 0);
+  connect(copy, 0, self(), 0);
+}
+
+gr_derived_block::~gr_derived_block()
+{
+}
+
+void qa_gr_hier_block2_derived::test_1()
+{
+  gr_top_block_sptr     tb(gr_make_top_block("test"));
+
+  gr_block_sptr         src(gr_make_null_source(sizeof(int)));
+  gr_block_sptr         head(gr_make_head(sizeof(int), 1000));
+  gr_derived_block_sptr blk(gr_make_derived_block());
+  gr_block_sptr         dst(gr_make_null_sink(sizeof(int)));
+  
+  tb->connect(src,  0, head, 0);
+  tb->connect(head, 0, blk,  0);
+  tb->connect(blk,  0, dst,  0);
+
+  tb->run();
+}
diff --git a/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h b/gnuradio-core/src/lib/runtime/qa_gr_hier_block2_derived.h
new file mode 100644 (file)
index 0000000..5a27b1b
--- /dev/null
@@ -0,0 +1,41 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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 GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_QA_GR_HIER_BLOCK2_DERIVED_H
+#define INCLUDED_QA_GR_HIER_BLOCK2_DERIVED_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+#include <stdexcept>
+
+// 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();
+
+private:
+  void test_1();
+};
+
+#endif /* INCLUDED_QA_GR_HIER_BLOCK2_DERIVED_H */
index ba0f14b93c0922b187d1e014e78bbb16e432bd19..31e3a82d671109cf129acc70691eb6676e338993 100644 (file)
@@ -36,6 +36,7 @@
 #include <qa_gr_flowgraph.h>
 #include <qa_gr_top_block.h>
 #include <qa_gr_hier_block2.h>
+#include <qa_gr_hier_block2_derived.h>
 #include <qa_gr_buffer.h>
 
 CppUnit::TestSuite *
@@ -49,6 +50,7 @@ qa_runtime::suite ()
   s->addTest (qa_gr_flowgraph::suite ());
   s->addTest (qa_gr_top_block::suite ());
   s->addTest (qa_gr_hier_block2::suite ());
+  s->addTest (qa_gr_hier_block2_derived::suite ());
   s->addTest (qa_gr_buffer::suite ());
   
   return s;