[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3353 - in gnuradio/branches/developers/eb/mb: . mbloc
From: |
eb |
Subject: |
[Commit-gnuradio] r3353 - in gnuradio/branches/developers/eb/mb: . mblock mblock/src/lib pmt/src/lib |
Date: |
Sat, 19 Aug 2006 01:23:30 -0600 (MDT) |
Author: eb
Date: 2006-08-19 01:23:30 -0600 (Sat, 19 Aug 2006)
New Revision: 3353
Added:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/test_mblock.cc
Modified:
gnuradio/branches/developers/eb/mb/configure.ac
gnuradio/branches/developers/eb/mb/mblock/README
gnuradio/branches/developers/eb/mb/mblock/src/lib/
gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.cc
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.h
gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.cc
gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.h
Log:
work-in-progress: doesn't compile
Modified: gnuradio/branches/developers/eb/mb/configure.ac
===================================================================
--- gnuradio/branches/developers/eb/mb/configure.ac 2006-08-19 00:45:20 UTC
(rev 3352)
+++ gnuradio/branches/developers/eb/mb/configure.ac 2006-08-19 07:23:30 UTC
(rev 3353)
@@ -152,25 +152,25 @@
subdirs="config"
GRC_GNURADIO_CORE
GRC_GNURADIO_EXAMPLES
-GRC_USRP
-GRC_GR_USRP dnl this must come after GRC_USRP
-GRC_GR_AUDIO_ALSA
-GRC_GR_AUDIO_JACK
-GRC_GR_AUDIO_OSS
-GRC_GR_AUDIO_OSX dnl ***NOT TESTED***
-GRC_GR_AUDIO_PORTAUDIO dnl ***NOT TESTED***
-GRC_GR_AUDIO_WINDOWS dnl ***NOT TESTED***
-GRC_GR_ATSC
-GRC_GR_COMEDI
+dnl GRC_USRP
+dnl GRC_GR_USRP dnl this must come after GRC_USRP
+dnl GRC_GR_AUDIO_ALSA
+dnl GRC_GR_AUDIO_JACK
+dnl GRC_GR_AUDIO_OSS
+dnl GRC_GR_AUDIO_OSX dnl ***NOT TESTED***
+dnl GRC_GR_AUDIO_PORTAUDIO dnl ***NOT TESTED***
+dnl GRC_GR_AUDIO_WINDOWS dnl ***NOT TESTED***
+dnl GRC_GR_ATSC
+dnl GRC_GR_COMEDI
dnl GRC_GR_ERROR_CORRECTING_CODES dnl disabled until fix for ticket:36
-GRC_GR_GSM_FR_VOCODER
-GRC_GR_RADAR
-GRC_GR_RADIO_ASTRONOMY
-GRC_GR_VIDEO_SDL
-GRC_GR_WXGUI
+dnl GRC_GR_GSM_FR_VOCODER
+dnl GRC_GR_RADAR
+dnl GRC_GR_RADIO_ASTRONOMY
+dnl GRC_GR_VIDEO_SDL
+dnl GRC_GR_WXGUI
GRC_PMT
GRC_MBLOCK dnl this must come after GRC_PMT
-GRC_GR_TRELLIS
+dnl GRC_GR_TRELLIS
dnl GRC_EZDOP dnl disable until grc_ezdop.m4 fixed
dnl GRC_GR_EZDOP dnl this must come after GRC_EZDOP
Modified: gnuradio/branches/developers/eb/mb/mblock/README
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/README 2006-08-19 00:45:20 UTC
(rev 3352)
+++ gnuradio/branches/developers/eb/mb/mblock/README 2006-08-19 07:23:30 UTC
(rev 3353)
@@ -19,4 +19,4 @@
# Boston, MA 02111-1307, USA.
#
-The "Message block" implementation.
+The "Message block" implementation, a work in progress...
Property changes on: gnuradio/branches/developers/eb/mb/mblock/src/lib
___________________________________________________________________
Name: svn:ignore
- Makefile
Makefile.in
.la
.lo
.deps
.libs
*.la
*.lo
howto.cc
howto.py
test_pmt
+ Makefile
Makefile.in
.la
.lo
.deps
.libs
*.la
*.lo
test_mblock
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2006-08-19 00:45:20 UTC (rev 3352)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/Makefile.am
2006-08-19 07:23:30 UTC (rev 3353)
@@ -23,7 +23,7 @@
INCLUDES = $(PMT_INCLUDES) $(BOOST_CFLAGS) $(CPPUNIT_INCLUDES)
-# TESTS = test_mblock
+TESTS = test_mblock
lib_LTLIBRARIES = libmblock.la libmblock-qa.la
@@ -50,33 +50,36 @@
mb_message.h \
mb_protocol_class.h
-noinst_HEADERS =
+noinst_HEADERS = \
+ qa_mblock.h
# Build the qa code into its own library
-libmblock_qa_la_SOURCES =
+libmblock_qa_la_SOURCES = \
+ qa_mblock.cc
# magic flags
libmblock_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid-version
# link the library against the c++ standard library
-libmblock_qa_la_LIBADD = \
- libmblock.la \
- $(CPPUNIT_LIBS) \
+libmblock_qa_la_LIBADD = \
+ qa_mblock.cc \
+ libmblock.la \
+ $(CPPUNIT_LIBS) \
-lstdc++
-#noinst_PROGRAMS = \
-# test_mblock
+noinst_PROGRAMS = \
+ test_mblock
LIBMBLOCK = libmblock.la
LIBMBLOCKQA = libmblock-qa.la $(LIBMBLOCK)
-#test_mblock_SOURCES = test_mblock.cc
-#test_mblock_LDADD = $(LIBMBLOCKQA)
+test_mblock_SOURCES = test_mblock.cc
+test_mblock_LDADD = $(LIBMBLOCKQA)
CLEANFILES = $(BUILT_SOURCES) *.pyc
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
2006-08-19 07:23:30 UTC (rev 3353)
@@ -0,0 +1,70 @@
+/* -*- 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_mblock.h>
+
+// ----------------------------------------------------------------------
+// mb_port_class
+// ----------------------------------------------------------------------
+
+mb_port_class_sptr
+mb_make_port_class(const std::string &port_name,
+ const std::string &protocol_class_name,
+ bool conjugated,
+ mb_port::port_type_t port_type,
+ int min_replic, int max_replic)
+{
+ return mb_port_class_sptr(new mb_port_class(port_name,
+ protocol_class_name,
+ conjugated,
+ port_type,
+ min_replic,
+ max_replic));
+}
+
+mb_port_class::mb_port_class(const std::string &port_name,
+ const std::string &protocol_class_name,
+ bool conjugated,
+ mb_port::port_type_t port_type,
+ int min_replic, int max_replic)
+ : d_port_name(port_name),
+ d_conjugated(conjugated), d_port_type(port_type),
+{
+ mb_protocol_class_sptr pc =
+ mb_protocol_class::lookup(pmt_intern(protocol_class_name));
+ if (!pc){
+ throw FIXME;
+ }
+ d_protocol_class = pc;
+ if (min_replic < 0 || min_replic > max_replic){
+ throw FIXME;
+ }
+ if (max_replic < 1){
+ throw FIXME;
+ }
+ d_min_replic = min_replic;
+ d_max_replic = max_replic;
+}
+
Property changes on:
gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.cc
___________________________________________________________________
Name: svn:eol-style
+ native
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-19 00:45:20 UTC (rev 3352)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_mblock.h
2006-08-19 07:23:30 UTC (rev 3353)
@@ -23,4 +23,167 @@
#include <mb_common.h>
+// ----------------------------------------------------------------------
+// forward declarations...
+// ----------------------------------------------------------------------
+
+class mb_mblock;
+typedef boost::shared_ptr<mb_mblock> mb_mblock_sptr;
+
+class mb_port_class;
+typedef boost::shared_ptr<mb_port_class> mb_port_class_sptr;
+
+class mb_port;
+typedef boost::shared_ptr<mb_port> mb_port_sptr;
+
+// ----------------------------------------------------------------------
+// mb_port_class
+// ----------------------------------------------------------------------
+
+/*!
+ * \brief public constructor for mb_port_class
+ *
+ * \param port_name the port's name
+ * \param protocol_class_name the name of the associated protocol class
+ * \param conjugated true if incoming and outgoing mesages sets are swapped
+ * \param port_type EXTERNAL, RELAY or INTERNAL
+ * \param min_replic minimum number of replications of this port
+ * \param max_replic maximum number of replications of this port
+ */
+mb_port_class_sptr
+mb_make_port_class(const std::string &port_name,
+ const std::string &protocol_class_name,
+ bool conjugated,
+ mb_port::port_type_t port_type,
+ int min_replic = 1, int max_replic = 1);
+
+/*!
+ * \brief Public port characteristics
+ */
+class mb_port_class
+{
+public:
+ //! port classification
+ enum { EXTERNAL, //< Externally visible
+ RELAY, //< Externally visible but really connected to a
sub-component
+ INTERNAL //< Visible to self only
+ } port_type_t;
+
+private:
+ const std::string d_port_name;
+ mb_protocol_class_sptr d_protocol_class;
+ bool d_conjugated;
+ port_type_t d_port_type;
+ int d_min_replic;
+ int d_max_replic;
+
+ // private constructor
+ mb_port_class(const std::string &port_name,
+ const std::string &protocol_class_name,
+ bool conjugated,
+ mb_port::port_type_t port_type,
+ int min_replic, int max_replic);
+
+ // public constructor
+ friend mb_port_class_sptr
+ mb_make_port_class(const std::string &port_name,
+ const std::string &protocol_class_name,
+ bool conjugated,
+ mb_port::port_type_t port_type,
+ int min_replic, int max_replic);
+
+public:
+ const std::string& port_name() const { return d_port_name; }
+ mb_portocol_class_sptr protocol_class() const { return d_protocol_class; }
+ bool conjugated() const { return d_conjugated; }
+ port_type_t port_type() const { return d_port_type; }
+ int min_replic() const { return d_min_replic; }
+ int max_replic() const { return d_max_replic; }
+};
+
+// ----------------------------------------------------------------------
+// mb_port and friends
+// ----------------------------------------------------------------------
+
+class mb_port
+{
+ mb_port_class_sptr d_port_class;
+ // FIXME add internals...
+
+public:
+
+ // delegations to d_port_class
+
+ const std::string& port_name() const { return d_port_class->port_name();
}
+ mb_portocol_class_sptr protocol_class() const { return
d_port_class->protocol_class(); }
+ bool conjugated() const { return
d_port_class->conjugated(); }
+ port_type_t port_type() const { return d_port_class->port_type();
}
+ int min_replic() const { return
d_port_class->min_replic(); }
+ int max_replic() const { return
d_port_class->max_replic(); }
+
+ // our functionality
+
+ //! build message and send
+ void send(pmt_t signal,
+ pmt_t data = PMT_NIL,
+ pmt_t metadata = PMT_NIL,
+ mb_pri_t priority = MB_PRI_DEFAULT);
+
+ //! Send pre-built message
+ virtual void send(mb_message_sptr message) = 0;
+};
+
+class mb_simple_port : public mb_port
+{
+public:
+ //! Send pre-built message to connected port.
+ virtual void send(mb_message_sptr message);
+};
+
+class mb_replicated_port : public mb_port
+{
+public:
+ //! Send pre-built message to all connected ports.
+ virtual void send(mb_message_sptr message);
+};
+
+// ----------------------------------------------------------------------
+// mb_mblock
+// ----------------------------------------------------------------------
+class mb_mblock
+{
+private:
+ // NOT IMPLEMENTED
+ mb_mblock (const mb_mblock &rhs); // no copy constructor
+ mb_mblock &operator= (const mb_mblock &rhs); // no assignment operator
+
+protected:
+ mb_mblock();
+
+ mb_port_sptr
+ register_port(const std::string &port_name,
+ const std::string &protocol_class_name,
+ bool conjugated,
+ mb_port::port_type_t port_type,
+ int min_replic = 1, int max_replic = 1);
+
+ void
+ register_component(const std::string &component_name,
+ mb_block_sptr component);
+
+ bool
+ connect(const std::string &c1_comp_name, const std::string &c1_port_name,
+ const std::string &c2_comp_name, const std::string &c2_port_name);
+
+
+ virtual bool connect_components();
+ virtual bool start_fsm(pmt_t data, pmt_t metadata) = 0;
+
+public:
+ virtual ~mb_mblock();
+
+ const std::vector<mb_port_class> &peer_interface() const;
+};
+
+
#endif /* INCLUDED_MB_MBLOCK_H */
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.cc
2006-08-19 00:45:20 UTC (rev 3352)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.cc
2006-08-19 07:23:30 UTC (rev 3353)
@@ -37,8 +37,13 @@
{
}
+mb_protocol_class::~mb_protocol_class()
+{
+ // NOP
+}
+
mb_protocol_class_sptr
-mb_protocol_class::conj() const
+mb_protocol_class::lookup(pmt_t name)
{
- return mb_make_protocol_class(name(), outgoing(), incoming());
+ return 0; // FIXME
}
Modified: gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.h
2006-08-19 00:45:20 UTC (rev 3352)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/mb_protocol_class.h
2006-08-19 07:23:30 UTC (rev 3353)
@@ -56,7 +56,8 @@
pmt_t incoming() const { return d_incoming; }
pmt_t outgoing() const { return d_outgoing; }
- mb_protocol_class_sptr conj() const; // return the conjugate of this
protocol class
+ //! look for a protocol class by name
+ static mb_protocol_class_sptr lookup(pmt_t name);
};
#endif /* INCLUDED_MB_PROTOCOL_CLASS_H */
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
2006-08-19 07:23:30 UTC (rev 3353)
@@ -0,0 +1,38 @@
+/*
+ * 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 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.
+ */
+
+/*
+ * This class gathers together all the test cases for mblock into
+ * a single test suite. As you create new test cases, add them here.
+ */
+
+#include <qa_mblock.h>
+// #include <qa_mblock_prims.h>
+
+CppUnit::TestSuite *
+qa_mblock::suite()
+{
+ CppUnit::TestSuite *s = new CppUnit::TestSuite("mblock");
+
+ // s->addTest (qa_mblock_prims::suite());
+
+ return s;
+}
Property changes on:
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.cc
___________________________________________________________________
Name: svn:eol-style
+ native
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.h
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.h
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.h
2006-08-19 07:23:30 UTC (rev 3353)
@@ -0,0 +1,36 @@
+/* -*- 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 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_H
+#define INCLUDED_QA_MBLOCK_H
+
+#include <cppunit/TestSuite.h>
+
+//! collect all the tests for mblock
+
+class qa_mblock {
+ public:
+ //! return suite of tests for all of mblock
+ static CppUnit::TestSuite *suite();
+};
+
+#endif /* INCLUDED_QA_MBLOCK_H */
Property changes on:
gnuradio/branches/developers/eb/mb/mblock/src/lib/qa_mblock.h
___________________________________________________________________
Name: svn:eol-style
+ native
Added: gnuradio/branches/developers/eb/mb/mblock/src/lib/test_mblock.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/mblock/src/lib/test_mblock.cc
(rev 0)
+++ gnuradio/branches/developers/eb/mb/mblock/src/lib/test_mblock.cc
2006-08-19 07:23:30 UTC (rev 3353)
@@ -0,0 +1,37 @@
+/* -*- 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 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.
+ */
+
+#include <cppunit/TextTestRunner.h>
+#include <qa_mblock.h>
+
+int
+main(int argc, char **argv)
+{
+
+ CppUnit::TextTestRunner runner;
+
+ runner.addTest(qa_mblock::suite ());
+
+ bool was_successful = runner.run("", false);
+
+ return was_successful ? 0 : 1;
+}
Property changes on:
gnuradio/branches/developers/eb/mb/mblock/src/lib/test_mblock.cc
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.cc
===================================================================
--- gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.cc 2006-08-19
00:45:20 UTC (rev 3352)
+++ gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.cc 2006-08-19
07:23:30 UTC (rev 3353)
@@ -197,6 +197,13 @@
return sym;
}
+// alias...
+pmt_t
+pmt_intern(const std::string &name)
+{
+ return pmt_string_to_symbol(name);
+}
+
const std::string
pmt_symbol_to_string(pmt_t sym)
{
@@ -206,6 +213,8 @@
return _symbol(sym)->name();
}
+
+
////////////////////////////////////////////////////////////////////////////
// Number
////////////////////////////////////////////////////////////////////////////
Modified: gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.h
===================================================================
--- gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.h 2006-08-19
00:45:20 UTC (rev 3352)
+++ gnuradio/branches/developers/eb/mb/pmt/src/lib/pmt.h 2006-08-19
07:23:30 UTC (rev 3353)
@@ -111,6 +111,10 @@
//! Return the symbol whose name is \p s.
pmt_t pmt_string_to_symbol(const std::string &s);
+//! Alias for pmt_string_to_symbol
+pmt_t pmt_intern(const std::string &s);
+
+
/*!
* If \p is a symbol, return the name of the symbol as a string.
* Otherwise, raise the wrong_type exception.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3353 - in gnuradio/branches/developers/eb/mb: . mblock mblock/src/lib pmt/src/lib,
eb <=