[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3952 - gnuradio/branches/developers/eb/mb/mblock/src/
From: |
eb |
Subject: |
[Commit-gnuradio] r3952 - gnuradio/branches/developers/eb/mb/mblock/src/lib |
Date: |
Tue, 7 Nov 2006 18:57:18 -0700 (MST) |
Author: eb
Date: 2006-11-07 18:57:18 -0700 (Tue, 07 Nov 2006)
New Revision: 3952
Modified:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
Log:
removed runtime argument from mb_mblock ctor
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
2006-11-08 01:46:38 UTC (rev 3951)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
2006-11-08 01:57:18 UTC (rev 3952)
@@ -28,9 +28,8 @@
#include <mb_protocol_class.h>
#include <mb_port.h>
-mb_mblock::mb_mblock(mb_runtime_sptr runtime)
- : d_impl(new mb_mblock_impl()),
- d_runtime(runtime)
+mb_mblock::mb_mblock()
+ : d_impl(new mb_mblock_impl())
{
// FIXME more?
}
@@ -49,13 +48,6 @@
////////////////////////////////////////////////////////////////////////
-bool
-mb_mblock::connect_components()
-{
- // default implementation returns true
- return true;
-}
-
void
mb_mblock::init_fsm()
{
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
2006-11-08 01:46:38 UTC (rev 3951)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
2006-11-08 01:57:18 UTC (rev 3952)
@@ -61,7 +61,6 @@
{
private:
mb_mblock_impl *d_impl; // implementation details
- mb_runtime_sptr d_runtime; // associated runtime
friend class mb_runtime;
@@ -69,46 +68,20 @@
/*!
* \brief mblock constructor.
*
- * This is step 1 of the 3 step start-up procedure.
- *
* Initializing all mblocks in the system is a 3 step procedure.
*
- * Step 1: The top level mblock's constructor is run. That
- * constructor (a) registers all of its ports using define_port
- * and (b) constructs and registers any subcomponents it may have
- * via the define_component method. Thus, all mblocks in the
- * system are recursively constructed and the runtime system is
- * informed of the hierarchy and all ports on all mblocks.
- *
- * Step 2: The runtime system invokes the connect_components method
- * of each mblock. If an mblock has component mblocks, it should
- * issue all connect calls at this time.
- *
- * Step 3: The runtime system fires the initial transition of each
- * mblock by invoking its init_fsm method.
- *
- * At this point the system is live.
- *
- * \param runtime The runtime system to which this mblock belongs.
+ * The top level mblock's constructor is run. That constructor (a)
+ * registers all of its ports using define_port, (b) constructs and
+ * registers any subcomponents it may have via the define_component
+ * method, and then (c) issues connect calls to wire its
+ * subcomponents together.
*/
- mb_mblock(mb_runtime_sptr runtime);
+ mb_mblock();
/*!
- * \brief Called by the runtime system to instruct this mblock to
- * connect up any subcomponents it may have.
- *
- * This is step 2 of the 3 step start-up procedure.
- *
- * Override this to connect your components together.
- */
- virtual bool connect_components();
-
- /*!
* \brief Called by the runtime system to execute the initial
* transition of the finite state machine.
*
- * This is step 3 of the 3 step start-up proceedure.
- *
* Override this to initialize your finite state machine.
*/
virtual void init_fsm();
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
2006-11-08 01:46:38 UTC (rev 3951)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock_prims.cc
2006-11-08 01:57:18 UTC (rev 3952)
@@ -35,12 +35,12 @@
class dp_1 : public mb_mblock
{
public:
- dp_1(mb_runtime_sptr runtime);
+ dp_1();
~dp_1();
};
-dp_1::dp_1(mb_runtime_sptr runtime)
- : mb_mblock(runtime)
+dp_1::dp_1()
+ : mb_mblock()
{
}
@@ -51,12 +51,12 @@
class dp_2 : public mb_mblock
{
public:
- dp_2(mb_runtime_sptr runtime);
+ dp_2();
~dp_2();
};
-dp_2::dp_2(mb_runtime_sptr runtime)
- : mb_mblock(runtime)
+dp_2::dp_2()
+ : mb_mblock()
{
define_port(s_cs, "cs-protocol", false, mb_port_class::EXTERNAL);
}
@@ -68,12 +68,12 @@
class dp_3 : public mb_mblock
{
public:
- dp_3(mb_runtime_sptr runtime);
+ dp_3();
~dp_3();
};
-dp_3::dp_3(mb_runtime_sptr runtime)
- : mb_mblock(runtime)
+dp_3::dp_3()
+ : mb_mblock()
{
define_port(s_cs, "cs-protocol", false, mb_port_class::EXTERNAL);
define_port(s_cs, "cs-protocol", false, mb_port_class::EXTERNAL); //
duplicate def
@@ -89,12 +89,12 @@
mb_runtime_sptr rt = mb_make_runtime();
std::vector<mb_port_class_sptr> intf;
- mb_mblock_sptr mb1 = mb_mblock_sptr(new dp_1(rt));
+ mb_mblock_sptr mb1 = mb_mblock_sptr(new dp_1());
intf = mb1->peer_interface();
CPPUNIT_ASSERT_EQUAL(size_t(0), intf.size());
// raises runtime_error because of unknown protocol "cs-protocol"
- CPPUNIT_ASSERT_THROW(mb_mblock_sptr(new dp_2(rt)), std::runtime_error);
+ CPPUNIT_ASSERT_THROW(mb_mblock_sptr(new dp_2()), std::runtime_error);
// define the protocol class
pmt_t pc = mb_make_protocol_class(pmt_intern("cs-protocol"),
@@ -105,7 +105,7 @@
// std::cout << "pc = " << pc << '\n';
- mb_mblock_sptr mb2 = mb_mblock_sptr(new dp_2(rt));
+ mb_mblock_sptr mb2 = mb_mblock_sptr(new dp_2());
intf = mb2->peer_interface();
CPPUNIT_ASSERT_EQUAL(size_t(1), intf.size());
@@ -113,11 +113,11 @@
// raises pmt_exception because of duplicate port definition of "cs"
- CPPUNIT_ASSERT_THROW(mb_mblock_sptr(new dp_3(rt)), pmt_exception);
+ CPPUNIT_ASSERT_THROW(mb_mblock_sptr(new dp_3()), pmt_exception);
#if 0
try {
- mb_mblock_sptr mb2 = mb_mblock_sptr(new dp_2(rt));
+ mb_mblock_sptr mb2 = mb_mblock_sptr(new dp_2());
}
catch (pmt_exception &e){
std::cerr << e.msg() << ' ' << e.obj() << '\n';
@@ -131,12 +131,12 @@
class dc_0 : public mb_mblock
{
public:
- dc_0(mb_runtime_sptr runtime);
+ dc_0();
~dc_0();
};
-dc_0::dc_0(mb_runtime_sptr runtime)
- : mb_mblock(runtime)
+dc_0::dc_0()
+ : mb_mblock()
{
}
@@ -147,16 +147,16 @@
class dc_ok : public mb_mblock
{
public:
- dc_ok(mb_runtime_sptr runtime);
+ dc_ok();
~dc_ok();
};
-dc_ok::dc_ok(mb_runtime_sptr runtime)
- : mb_mblock(runtime)
+dc_ok::dc_ok()
+ : mb_mblock()
{
- define_component("c0", mb_mblock_sptr(new dc_0(runtime)));
- define_component("c1", mb_mblock_sptr(new dc_0(runtime)));
- define_component("c2", mb_mblock_sptr(new dc_0(runtime)));
+ define_component("c0", mb_mblock_sptr(new dc_0()));
+ define_component("c1", mb_mblock_sptr(new dc_0()));
+ define_component("c2", mb_mblock_sptr(new dc_0()));
}
dc_ok::~dc_ok(){}
@@ -166,15 +166,15 @@
class dc_not_ok : public mb_mblock
{
public:
- dc_not_ok(mb_runtime_sptr runtime);
+ dc_not_ok();
~dc_not_ok();
};
-dc_not_ok::dc_not_ok(mb_runtime_sptr runtime)
- : mb_mblock(runtime)
+dc_not_ok::dc_not_ok()
+ : mb_mblock()
{
- define_component("c0", mb_mblock_sptr(new dc_0(runtime)));
- define_component("c0", mb_mblock_sptr(new dc_0(runtime))); // duplicate
name
+ define_component("c0", mb_mblock_sptr(new dc_0()));
+ define_component("c0", mb_mblock_sptr(new dc_0())); // duplicate name
}
dc_not_ok::~dc_not_ok(){}
@@ -185,9 +185,9 @@
qa_mblock_prims::test_define_components()
{
mb_runtime_sptr rt = mb_make_runtime();
- mb_mblock_sptr mb1 = mb_mblock_sptr(new dc_ok(rt));
+ mb_mblock_sptr mb1 = mb_mblock_sptr(new dc_ok());
// raises pmt_exception because of duplicate component definition of "c0"
- CPPUNIT_ASSERT_THROW(mb_mblock_sptr(new dc_not_ok(rt)), pmt_exception);
+ CPPUNIT_ASSERT_THROW(mb_mblock_sptr(new dc_not_ok()), pmt_exception);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3952 - gnuradio/branches/developers/eb/mb/mblock/src/lib,
eb <=