[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4001 - gnuradio/branches/developers/eb/mb/mblock/src/
From: |
eb |
Subject: |
[Commit-gnuradio] r4001 - gnuradio/branches/developers/eb/mb/mblock/src/lib |
Date: |
Thu, 16 Nov 2006 23:43:22 -0700 (MST) |
Author: eb
Date: 2006-11-16 23:43:22 -0700 (Thu, 16 Nov 2006)
New Revision: 4001
Added:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.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_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.h
Log:
moved send method from mb_mblock into mb_port
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2006-11-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2006-11-17 06:43:22 UTC (rev 4001)
@@ -38,6 +38,7 @@
mb_mblock_impl.cc \
mb_message.cc \
mb_port.cc \
+ mb_port_detail.cc \
mb_protocol_class.cc \
mb_runtime.cc \
mb_runtime_impl.cc \
@@ -67,6 +68,7 @@
mb_connection.h \
mb_endpoint.h \
mb_mblock_impl.h \
+ mb_port_detail.h \
mb_runtime_impl.h \
qa_mblock.h \
qa_mblock_prims.h
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
2006-11-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_common.h
2006-11-17 06:43:22 UTC (rev 4001)
@@ -46,5 +46,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;
+
#endif /* INCLUDED_MB_COMMON_H */
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-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
2006-11-17 06:43:22 UTC (rev 4001)
@@ -28,7 +28,7 @@
mb_mblock::mb_mblock()
- : d_impl(new mb_mblock_impl(this))
+ : d_impl(mb_mblock_impl_sptr(new mb_mblock_impl(this)))
{
}
@@ -37,11 +37,6 @@
disconnect_all();
// FIXME more?
-
- if (d_impl){
- delete d_impl;
- d_impl = 0;
- }
}
@@ -61,14 +56,14 @@
// Forward other methods to implementation class //
////////////////////////////////////////////////////////////////////////
-void
+mb_port_sptr
mb_mblock::define_port(const std::string &port_name_string,
const std::string &protocol_class_name,
bool conjugated,
mb_port::port_type_t port_type)
{
- d_impl->define_port(port_name_string, protocol_class_name,
- conjugated, port_type);
+ return d_impl->define_port(port_name_string, protocol_class_name,
+ conjugated, port_type);
}
void
@@ -112,10 +107,3 @@
{
return d_impl->nconnections();
}
-
-void
-mb_mblock::send(pmt_t port_name, pmt_t signal,
- pmt_t data, pmt_t metadata, mb_pri_t priority)
-{
- d_impl->send(port_name, signal, data, metadata, priority);
-}
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-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
2006-11-17 06:43:22 UTC (rev 4001)
@@ -41,7 +41,7 @@
class mb_mblock : boost::noncopyable
{
private:
- mb_mblock_impl *d_impl; // implementation details
+ mb_mblock_impl_sptr d_impl; // implementation details
friend class mb_runtime;
friend class mb_mblock_impl;
@@ -91,7 +91,7 @@
* \param conjugated Are the incoming and outgoing message sets swapped?
* \param port_type INTERNAL, EXTERNAL or RELAY.
*/
- void
+ mb_port_sptr
define_port(const std::string &port_name,
const std::string &protocol_class_name,
bool conjugated,
@@ -165,30 +165,10 @@
int
nconnections() const;
- /*!
- * \brief send a message
- *
- * \param port_name name of the port via which we send the message
- * \param signal the event name
- * \param data optional data
- * \param metadata optional metadata
- * \param priority the urgency at which the message is sent
- */
- void
- send(pmt_t port_name,
- pmt_t signal,
- pmt_t data = PMT_NIL,
- pmt_t metadata = PMT_NIL,
- mb_pri_t priority = MB_PRI_DEFAULT);
-
public:
virtual ~mb_mblock();
- /*!
- * \brief Return a vector that describes this mblock's peer-interface
- */
- // const std::vector<mb_port_sptr> peer_interface() const;
};
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.cc
2006-11-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.cc
2006-11-17 06:43:22 UTC (rev 4001)
@@ -59,7 +59,7 @@
}
-void
+mb_port_sptr
mb_mblock_impl::define_port(const std::string &port_name,
const std::string &protocol_class_name,
bool conjugated,
@@ -74,6 +74,7 @@
mb_port_sptr p = mb_port_sptr(new mb_port(port_name, protocol_class_name,
conjugated, port_type));
d_port_map[port_name] = p;
+ return p;
}
void
@@ -127,13 +128,6 @@
return d_conn_table.nconnections();
}
-void
-mb_mblock_impl::send(pmt_t port_name, pmt_t signal,
- pmt_t data, pmt_t metadata, mb_pri_t priority)
-{
- // FIXME
-}
-
////////////////////////////////////////////////////////////////////////
mb_endpoint
@@ -173,7 +167,7 @@
if (!comp_is_defined(comp_name))
throw mbe_no_such_component(d_mb, comp_name);
- mb_mblock_impl *c_impl = d_comp_map[comp_name]->d_impl; // childs impl
pointer
+ mb_mblock_impl_sptr c_impl = d_comp_map[comp_name]->d_impl; // childs
impl pointer
if (!c_impl->port_is_defined(port_name))
throw mbe_no_such_port(d_mb, mb_util::join_names(comp_name, port_name));
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.h
2006-11-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock_impl.h
2006-11-17 06:43:22 UTC (rev 4001)
@@ -58,7 +58,7 @@
* \param conjugated Are the incoming and outgoing message sets swapped?
* \param port_type INTERNAL, EXTERNAL or RELAY.
*/
- void
+ mb_port_sptr
define_port(const std::string &port_name,
const std::string &protocol_class_name,
bool conjugated,
@@ -132,22 +132,6 @@
int
nconnections() const;
- /*!
- * \brief send a message
- *
- * \param port_name name of the port via which we send the message
- * \param signal the event name
- * \param data optional data
- * \param metadata optional metadata
- * \param priority the urgency at which the message is sent
- */
- void
- send(pmt_t port_name,
- pmt_t signal,
- pmt_t data,
- pmt_t metadata,
- mb_pri_t priority);
-
/*
* Our implementation methods
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
2006-11-17 06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.cc
2006-11-17 06:43:22 UTC (rev 4001)
@@ -24,23 +24,29 @@
#endif
#include <mb_port.h>
+#include <mb_port_detail.h>
#include <mb_protocol_class.h>
-
mb_port::mb_port(const std::string &port_name,
const std::string &protocol_class_name,
bool conjugated,
mb_port::port_type_t port_type)
- : d_port_name(port_name),
- d_conjugated(conjugated), d_port_type(port_type)
+ : d_detail(mb_port_detail_sptr(new mb_port_detail())),
+ d_port_name(port_name), d_conjugated(conjugated), d_port_type(port_type)
{
pmt_t pc = mb_protocol_class_lookup(pmt_intern(protocol_class_name));
if (pmt_is_null(pc)){
- throw std::runtime_error("mb_port: unknown protocol class '" +
protocol_class_name + "'");
+ throw std::runtime_error("mb_port: unknown protocol class '"
+ + protocol_class_name + "'");
}
d_protocol_class = pc;
}
+mb_port::~mb_port()
+{
+ // nop
+}
+
pmt_t
mb_port::incoming_message_set() const
{
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.h 2006-11-17
06:20:50 UTC (rev 4000)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port.h 2006-11-17
06:43:22 UTC (rev 4001)
@@ -26,7 +26,7 @@
/*!
* \brief Public port characteristics
*/
-class mb_port
+class mb_port : boost::noncopyable
{
public:
@@ -40,6 +40,7 @@
private:
friend class mb_mblock_impl;
+ mb_port_detail_sptr d_detail;
std::string d_port_name;
pmt_t d_protocol_class;
bool d_conjugated;
@@ -60,6 +61,23 @@
pmt_t incoming_message_set() const;
pmt_t outgoing_message_set() const;
+
+ ~mb_port();
+
+ /*!
+ * \brief send a message
+ *
+ * \param signal the event name
+ * \param data optional data
+ * \param metadata optional metadata
+ * \param priority the urgency at which the message is sent
+ */
+ void
+ send(pmt_t signal,
+ pmt_t data = PMT_NIL,
+ pmt_t metadata = PMT_NIL,
+ mb_pri_t priority = MB_PRI_DEFAULT);
+
};
#endif /* INCLUDED_MB_PORT_H */
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.cc
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.cc
2006-11-17 06:43:22 UTC (rev 4001)
@@ -0,0 +1,34 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 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_port_detail.h>
+
+mb_port_detail::mb_port_detail()
+{
+}
+
+mb_port_detail::~mb_port_detail()
+{
+}
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.h
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_port_detail.h
2006-11-17 06:43:22 UTC (rev 4001)
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 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_PORT_DETAIL_H
+#define INCLUDED_MB_PORT_DETAIL_H
+
+#include <mb_port.h>
+
+class mb_port_detail : boost::noncopyable
+{
+public:
+ mb_port_detail();
+ ~mb_port_detail();
+};
+
+
+#endif /* INCLUDED_MB_PORT_DETAIL_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4001 - gnuradio/branches/developers/eb/mb/mblock/src/lib,
eb <=