[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3361 - gnuradio/branches/developers/eb/mb/mblock/src/
From: |
eb |
Subject: |
[Commit-gnuradio] r3361 - gnuradio/branches/developers/eb/mb/mblock/src/lib |
Date: |
Sun, 20 Aug 2006 19:02:37 -0600 (MDT) |
Author: eb
Date: 2006-08-20 19:02:37 -0600 (Sun, 20 Aug 2006)
New Revision: 3361
Modified:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
Log:
work in progress
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
2006-08-21 00:16:37 UTC (rev 3360)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
2006-08-21 01:02:37 UTC (rev 3361)
@@ -74,12 +74,19 @@
}
bool
-mb_mblock::connect(const std::string &endpoint_1, const std::string
&endpoint_2)
+mb_mblock::connect(const mb_endpoint &endpoint_1, const mb_endpoint
&endpoint_2)
{
// FIXME
return true;
}
+bool
+mb_mblock::disconnect(const mb_endpoint &endpoint_1, const mb_endpoint
&endpoint_2)
+{
+ // FIXME
+ return true;
+}
+
const std::vector<mb_port_class>
mb_mblock::peer_interface() const
{
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
2006-08-21 00:16:37 UTC (rev 3360)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
2006-08-21 01:02:37 UTC (rev 3361)
@@ -24,11 +24,7 @@
#include <mb_common.h>
#include <mb_message.h>
#include <mb_port_class.h>
-#include <mb_port.h>
-// ----------------------------------------------------------------------
-// forward declarations...
-// ----------------------------------------------------------------------
class mb_runtime;
@@ -36,13 +32,31 @@
typedef boost::shared_ptr<mb_mblock> mb_mblock_sptr;
// ----------------------------------------------------------------------
-// mb_mblock -- subclass this to define your mblocks.
+
+/*!
+ * \brief Endpoint specification for connection
+ */
+class mb_endpoint
+{
+ std::string d_component_name;
+ std::string d_port_name;
+
+public:
+ mb_endpoint(const std::string &component_name,
+ const std::string &port_name)
+ : d_component_name(component_name), d_port_name(port_name) {}
+
+ const std::string &component_name() const { return d_component_name; }
+ const std::string &port_name() const { return d_port_name; }
+};
+
// ----------------------------------------------------------------------
/*!
- * \brief Parent class for all message passing blocks (mblock)
+ * \brief Parent class for all message passing blocks
+ *
+ * Subclass this to define your mblocks.
*/
-
class mb_mblock
{
private:
@@ -56,22 +70,23 @@
/*!
* \brief mblock constructor.
*
- * This is step 1 of the 3 step start up procedure.
+ * 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 constructs any subcomponents it may have and
- * registers them using the register_component method. Thus, all
- * mblocks in the system are recursively constructed and the runtime
- * system is informed of the hierarchy.
+ * constructor (a) registers all of its ports using register_port
+ * and (b) constructs and registers any subcomponents it may have
+ * via the register_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: After step 1 is complete, the runtime system invokes the
- * connect_components method of each mblock. If an mblock has
- * component mblocks, it must issue all connect calls at this time.
+ * 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: After step 2 is complete, the runtime system fires the initial
- * transition of each mblock by invoking it's init_fsm method.
+ * 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.
*/
@@ -81,15 +96,19 @@
* \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.
+ * 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.
+ * \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.
+ * This is step 3 of the 3 step start-up proceedure.
+ *
+ * Override this to initialize your finite state machine.
*/
virtual void init_fsm();
@@ -137,22 +156,33 @@
/*!
* \brief connect endpoint_1 to endpoint_2
- * \param endpoint_1 "component_name/port_name"
- * \param endpoint_2 "component_name/port_name"
+ * \param endpoint_1 one end of the connection
+ * \param endpoint_2 the other end of the connection
*
- * An endpoint is specified by a string composed of the component's
- * local name (given as component_name in the call to
- * register_component) a "/" and the name of the port on that component.
+ * An endpoint is specified by the component's local name (given as
+ * component_name in the call to register_component) and the name of
+ * the port on that component.
*
- * E.g., "my_subcomponent/control" would refer to the port called
- * "control" on the nested mblock called "my_subcomponent". To
- * connect to an internal or relay port, use "self" for the
- * component name.
+ * To connect an internal or relay port, use "self" as the component name.
*/
bool
- connect(const std::string &endpoint_1, const std::string &endpoint_2);
+ connect(const mb_endpoint &endpoint_1, const mb_endpoint &endpoint_2);
+ /*!
+ * \brief disconnect endpoint_1 from endpoint_2
+ * \param endpoint_1 one end of the connection
+ * \param endpoint_2 the other end of the connection
+ *
+ * An endpoint is specified by the component's local name (given as
+ * component_name in the call to register_component) and the name of
+ * the port on that component.
+ *
+ * To disconnect an internal or relay port, use "self" as the component name.
+ */
+ bool
+ disconnect(const mb_endpoint &endpoint_1, const mb_endpoint &endpoint_2);
+
public:
virtual ~mb_mblock();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3361 - gnuradio/branches/developers/eb/mb/mblock/src/lib,
eb <=