[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4349 - gnuradio/branches/developers/eb/mb/mblock/src/
From: |
eb |
Subject: |
[Commit-gnuradio] r4349 - gnuradio/branches/developers/eb/mb/mblock/src/lib |
Date: |
Wed, 31 Jan 2007 16:13:58 -0700 (MST) |
Author: eb
Date: 2007-01-31 16:13:57 -0700 (Wed, 31 Jan 2007)
New Revision: 4349
Added:
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.h
Modified:
gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
Log:
work-in-progress on mblocks
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2007-01-31 23:13:57 UTC (rev 4349)
@@ -76,14 +76,16 @@
mb_mblock_impl.h \
mb_msg_accepter_smp.h \
qa_mblock.h \
- qa_mblock_prims.h
+ qa_mblock_prims.h \
+ qa_mblock_send.h
# Build the qa code into its own library
libmblock_qa_la_SOURCES = \
qa_mblock.cc \
- qa_mblock_prims.cc
+ qa_mblock_prims.cc \
+ qa_mblock_send.cc
# magic flags
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
2007-01-31 23:13:57 UTC (rev 4349)
@@ -67,8 +67,8 @@
class mb_runtime;
typedef boost::shared_ptr<mb_runtime> mb_runtime_sptr;
-class mb_runtime_impl;
-typedef boost::shared_ptr<mb_runtime_impl> mb_runtime_impl_sptr;
+//class mb_runtime_impl;
+//typedef boost::shared_ptr<mb_runtime_impl> mb_runtime_impl_sptr;
class mb_mblock;
typedef boost::shared_ptr<mb_mblock> mb_mblock_sptr;
@@ -79,8 +79,8 @@
class mb_port;
typedef boost::shared_ptr<mb_port> mb_port_sptr;
-class mb_port_detail;
-typedef boost::shared_ptr<mb_port_detail> mb_port_detail_sptr;
+//class mb_port_detail;
+//typedef boost::shared_ptr<mb_port_detail> mb_port_detail_sptr;
class mb_msg_accepter;
typedef boost::shared_ptr<mb_msg_accepter> mb_msg_accepter_sptr;
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
2007-01-31 23:13:57 UTC (rev 4349)
@@ -24,7 +24,6 @@
#endif
#include <mb_port.h>
-#include <mb_port_detail.h>
#include <mb_protocol_class.h>
mb_port::mb_port(mb_mblock *mblock,
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
2007-01-31 23:13:57 UTC (rev 4349)
@@ -24,7 +24,6 @@
#endif
#include <mb_runtime.h>
-#include <mb_runtime_impl.h>
mb_runtime_sptr
mb_make_runtime()
@@ -33,7 +32,6 @@
}
mb_runtime::mb_runtime()
- : d_impl(mb_runtime_impl_sptr(new mb_runtime_impl()))
{
// FIXME
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.h
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.h
2007-01-31 23:13:57 UTC (rev 4349)
@@ -40,8 +40,6 @@
class mb_runtime : boost::noncopyable
{
private:
- mb_runtime_impl_sptr d_impl; // implementation details
-
mb_runtime();
friend mb_runtime_sptr mb_make_runtime();
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
2007-01-31 23:13:57 UTC (rev 4349)
@@ -26,6 +26,7 @@
#include <qa_mblock.h>
#include <qa_mblock_prims.h>
+#include <qa_mblock_send.h>
CppUnit::TestSuite *
qa_mblock::suite()
@@ -33,6 +34,7 @@
CppUnit::TestSuite *s = new CppUnit::TestSuite("mblock");
s->addTest (qa_mblock_prims::suite());
+ s->addTest (qa_mblock_send::suite());
return s;
}
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
2007-01-31 21:52:16 UTC (rev 4348)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
2007-01-31 23:13:57 UTC (rev 4349)
@@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <qa_mblock_prims.h>
#include <cppunit/TestAssert.h>
#include <mb_mblock.h>
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
2007-01-31 23:13:57 UTC (rev 4349)
@@ -0,0 +1,128 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,2007 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 2, 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qa_mblock_send.h>
+#include <cppunit/TestAssert.h>
+#include <mb_mblock.h>
+#include <mb_runtime.h>
+#include <mb_protocol_class.h>
+#include <mb_exception.h>
+#include <mb_msg_queue.h>
+#include <mb_message.h>
+#include <mb_mblock_impl.h>
+#include <mb_msg_accepter.h>
+#include <stdio.h>
+
+static pmt_t s_data = pmt_intern("data");
+
+
+static void
+define_protocol_classes()
+{
+ mb_make_protocol_class(pmt_intern("simple-send"), // name
+ pmt_cons(s_data, PMT_NIL), // incoming
+ pmt_cons(s_data, PMT_NIL)); // outgoing
+}
+
+// ----------------------------------------------------------------
+
+// sub-block for test_simple_routing
+
+class sr1 : public mb_mblock
+{
+ mb_port_sptr d_p1;
+ mb_port_sptr d_p2;
+
+public:
+ sr1();
+ ~sr1();
+ void init_fsm();
+};
+
+sr1::sr1()
+{
+ d_p1 = define_port("p1", "simple-send", false, mb_port::EXTERNAL);
+ d_p2 = define_port("p2", "simple-send", false, mb_port::EXTERNAL);
+}
+
+sr1::~sr1(){}
+
+void
+sr1::init_fsm()
+{
+ // FIXME send two messages to each port
+}
+
+// ----------------------------------------------------------------
+
+// top-level container block for test_simple_routing
+class sr0 : public mb_mblock
+{
+ mb_port_sptr d_p0;
+
+public:
+ sr0();
+ ~sr0();
+ void init_fsm();
+};
+
+sr0::sr0()
+{
+ d_p0 = define_port("p0", "simple-send", false, mb_port::INTERNAL);
+
+ define_component("mb1", mb_mblock_sptr(new sr1()));
+ define_component("mb2", mb_mblock_sptr(new sr1()));
+
+ connect("self", "p0", "mb1", "p1");
+ connect("mb1", "p2", "mb2", "p2");
+}
+
+sr0::~sr0(){}
+
+void
+sr0::init_fsm()
+{
+ // FIXME send two messages to p0
+}
+
+// ----------------------------------------------------------------
+
+/*
+ * This tests basic message routing using INTERNAL and EXTERNAL ports.
+ * It does not rely on the guts of the runtime being complete,
+ * which is good, because at the time this is being written, the runtime
+ * is still a dream ;)
+ */
+void
+qa_mblock_send::test_simple_routing()
+{
+ define_protocol_classes();
+
+ mb_mblock_sptr mb0 = mb_mblock_sptr(new sr0());
+
+ // FIXME create runtime, have it fire the initial transitions
+}
+
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.h
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.h
2007-01-31 23:13:57 UTC (rev 4349)
@@ -0,0 +1,39 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,2007 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 2, 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef INCLUDED_QA_MBLOCK_SEND_H
+#define INCLUDED_QA_MBLOCK_SEND_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_mblock_send : public CppUnit::TestCase {
+
+ CPPUNIT_TEST_SUITE(qa_mblock_send);
+ CPPUNIT_TEST(test_simple_routing);
+ CPPUNIT_TEST_SUITE_END();
+
+ private:
+ void test_simple_routing();
+};
+
+#endif /* INCLUDED_QA_MBLOCK_SEND_H */
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4349 - gnuradio/branches/developers/eb/mb/mblock/src/lib,
eb <=