[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4805 - gnuradio/branches/developers/eb/mb/mblock/src/
From: |
eb |
Subject: |
[Commit-gnuradio] r4805 - gnuradio/branches/developers/eb/mb/mblock/src/lib |
Date: |
Tue, 27 Mar 2007 18:02:35 -0600 (MDT) |
Author: eb
Date: 2007-03-27 18:02:35 -0600 (Tue, 27 Mar 2007)
New Revision: 4805
Added:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.h
Removed:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.h
Modified:
gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
Log:
Renamed existing mb_runtime_single_threaded to mb_runtime_nop. This
will be used only during early QA tests. Created skeletons for
mb_runtime_thread_per_mblock.{h,cc}
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2007-03-27 23:31:45 UTC (rev 4804)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2007-03-28 00:02:35 UTC (rev 4805)
@@ -45,7 +45,8 @@
mb_port_simple.cc \
mb_protocol_class.cc \
mb_runtime.cc \
- mb_runtime_single_threaded.cc \
+ mb_runtime_nop.cc \
+ mb_runtime_thread_per_mblock.cc \
mb_util.cc
@@ -69,7 +70,8 @@
mb_port_simple.h \
mb_protocol_class.h \
mb_runtime.h \
- mb_runtime_single_threaded.h \
+ mb_runtime_nop.h \
+ mb_runtime_thread_per_mblock.h \
mb_util.h
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
2007-03-27 23:31:45 UTC (rev 4804)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime.cc
2007-03-28 00:02:35 UTC (rev 4805)
@@ -24,12 +24,12 @@
#endif
#include <mb_runtime.h>
-#include <mb_runtime_single_threaded.h>
+#include <mb_runtime_thread_per_mblock.h>
mb_runtime_sptr
mb_make_runtime()
{
- return mb_runtime_sptr(new mb_runtime_single_threaded());
+ return mb_runtime_sptr(new mb_runtime_thread_per_mblock());
}
mb_runtime::~mb_runtime()
Copied: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.cc
(from rev 4799,
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.cc)
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.cc
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.cc
2007-03-28 00:02:35 UTC (rev 4805)
@@ -0,0 +1,66 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 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 <mb_runtime_nop.h>
+#include <mb_mblock.h>
+
+mb_runtime_sptr
+mb_make_runtime_nop()
+{
+ return mb_runtime_sptr(new mb_runtime_nop());
+}
+
+
+mb_runtime_nop::mb_runtime_nop()
+{
+ // nop for now
+}
+
+mb_runtime_nop::~mb_runtime_nop()
+{
+ // nop for now
+}
+
+bool
+mb_runtime_nop::run(mb_mblock_sptr top)
+{
+ class initial_visitor : public mb_visitor
+ {
+ public:
+ bool operator()(mb_mblock *mblock, const std::string &path)
+ {
+ mblock->set_instance_name(path);
+ mblock->init_fsm();
+ return true;
+ }
+ };
+
+ initial_visitor visitor;
+
+ d_top = top; // remember top of tree
+
+ d_top->walk_tree(&visitor);
+
+ return true;
+}
Copied: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.h
(from rev 4798,
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.h)
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.h
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_nop.h
2007-03-28 00:02:35 UTC (rev 4805)
@@ -0,0 +1,45 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_MB_RUNTIME_NOP_H
+#define INCLUDED_MB_RUNTIME_NOP_H
+
+#include <mb_runtime.h>
+
+/*!
+ * \brief Public constructor (factory) for mb_runtime_nop objects.
+ */
+mb_runtime_sptr mb_make_runtime_nop();
+
+/*!
+ * \brief Concrete runtime that does nothing. Used only during early QA tests.
+ */
+class mb_runtime_nop : public mb_runtime
+{
+ mb_mblock_sptr d_top; // top mblock
+
+public:
+ mb_runtime_nop();
+ ~mb_runtime_nop();
+
+ bool run(mb_mblock_sptr top);
+};
+
+#endif /* INCLUDED_MB_RUNTIME_NOP_H */
Deleted:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.cc
Deleted:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.h
Copied:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.cc
(from rev 4799,
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.cc)
===================================================================
---
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.cc
(rev 0)
+++
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.cc
2007-03-28 00:02:35 UTC (rev 4805)
@@ -0,0 +1,60 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 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 <mb_runtime_thread_per_mblock.h>
+#include <mb_mblock.h>
+
+
+mb_runtime_thread_per_mblock::mb_runtime_thread_per_mblock()
+{
+ // nop for now
+}
+
+mb_runtime_thread_per_mblock::~mb_runtime_thread_per_mblock()
+{
+ // nop for now
+}
+
+bool
+mb_runtime_thread_per_mblock::run(mb_mblock_sptr top)
+{
+ class initial_visitor : public mb_visitor
+ {
+ public:
+ bool operator()(mb_mblock *mblock, const std::string &path)
+ {
+ mblock->set_instance_name(path);
+ mblock->init_fsm();
+ return true;
+ }
+ };
+
+ initial_visitor visitor;
+
+ d_top = top; // remember top of tree
+
+ d_top->walk_tree(&visitor);
+
+ return true;
+}
Copied:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.h
(from rev 4798,
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_single_threaded.h)
===================================================================
---
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.h
(rev 0)
+++
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_runtime_thread_per_mblock.h
2007-03-28 00:02:35 UTC (rev 4805)
@@ -0,0 +1,40 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_MB_RUNTIME_THREAD_PER_MBLOCK_H
+#define INCLUDED_MB_RUNTIME_THREAD_PER_MBLOCK_H
+
+#include <mb_runtime.h>
+
+/*!
+ * \brief Concrete runtime that uses a single thread for all work.
+ */
+class mb_runtime_thread_per_mblock : public mb_runtime
+{
+ mb_mblock_sptr d_top; // top mblock
+
+public:
+ mb_runtime_thread_per_mblock();
+ ~mb_runtime_thread_per_mblock();
+
+ bool run(mb_mblock_sptr top);
+};
+
+#endif /* INCLUDED_MB_RUNTIME_THREAD_PER_MBLOCK_H */
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-03-27 23:31:45 UTC (rev 4804)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
2007-03-28 00:02:35 UTC (rev 4805)
@@ -95,7 +95,6 @@
void
qa_mblock_prims::test_define_ports()
{
- mb_runtime_sptr rt = mb_make_runtime();
// std::vector<mb_port_sptr> intf;
mb_mblock_sptr mb1 = mb_mblock_sptr(new dp_1());
@@ -175,7 +174,6 @@
void
qa_mblock_prims::test_define_components()
{
- mb_runtime_sptr rt = mb_make_runtime();
mb_mblock_sptr mb1 = mb_mblock_sptr(new dc_ok()); // OK
// raises pmt_exception because of duplicate component definition of "c0"
@@ -317,8 +315,6 @@
pmt_list1(pmt_intern("in")), // in
pmt_list1(pmt_intern("out"))); // out
-
- mb_runtime_sptr rt = mb_make_runtime();
mb_mblock_sptr mb0 = mb_mblock_sptr(new tc_0());
}
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
2007-03-27 23:31:45 UTC (rev 4804)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_send.cc
2007-03-28 00:02:35 UTC (rev 4805)
@@ -28,6 +28,7 @@
#include <cppunit/TestAssert.h>
#include <mb_mblock.h>
#include <mb_runtime.h>
+#include <mb_runtime_nop.h> // QA only
#include <mb_protocol_class.h>
#include <mb_exception.h>
#include <mb_msg_queue.h>
@@ -149,7 +150,7 @@
mb_message_sptr msg;
- mb_runtime_sptr rt = mb_make_runtime();
+ mb_runtime_sptr rt = mb_make_runtime_nop();
mb_mblock_sptr mb0 = mb_mblock_sptr(new sr0());
rt->run(mb0);
@@ -321,7 +322,7 @@
{
mb_message_sptr msg;
- mb_runtime_sptr rt = mb_make_runtime();
+ mb_runtime_sptr rt = mb_make_runtime_nop();
mb_mblock_sptr top = mb_mblock_sptr(new rr0_a());
rt->run(top);
@@ -402,7 +403,7 @@
{
mb_message_sptr msg;
- mb_runtime_sptr rt = mb_make_runtime();
+ mb_runtime_sptr rt = mb_make_runtime_nop();
mb_mblock_sptr top = mb_mblock_sptr(new rr0_b());
rt->run(top);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4805 - gnuradio/branches/developers/eb/mb/mblock/src/lib,
eb <=