commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10394 - in gnuradio/branches/developers/michaelld/swi


From: michaelld
Subject: [Commit-gnuradio] r10394 - in gnuradio/branches/developers/michaelld/swig_tweaks: gnuradio-core/src/lib/runtime gnuradio-core/src/lib/swig usrp/host/lib/legacy
Date: Thu, 5 Feb 2009 10:03:27 -0700 (MST)

Author: michaelld
Date: 2009-02-05 10:03:26 -0700 (Thu, 05 Feb 2009)
New Revision: 10394

Added:
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gr_shared_ptr.i
Removed:
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/atsc.i
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/shared_ptr.i
Modified:
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/runtime/Makefile.am
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/Makefile.am
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gnuradio.i
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_filter.i
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_general.i
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_gengen.i
   
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_io.i
   
gnuradio/branches/developers/michaelld/swig_tweaks/usrp/host/lib/legacy/db_base.i
Log:
Initial changes to clean up SWIG files.  Works on OSX 10.5 and Ubuntu
8.10.  WIP: Still needs cleanup and testing.



Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/runtime/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/runtime/Makefile.am
        2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/runtime/Makefile.am
        2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,5 +1,5 @@
 #
-# Copyright 2003,2004,2007,2008 Free Software Foundation, Inc.
+# Copyright 2003,2004,2007,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -152,7 +152,6 @@
        gr_sync_block.i                 \
        gr_sync_decimator.i             \
        gr_sync_interpolator.i          \
-       gr_swig_block_magic.i           \
        gr_top_block.i                  \
        runtime.i
 

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/Makefile.am
   2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/Makefile.am
   2009-02-05 17:03:26 UTC (rev 10394)
@@ -35,11 +35,13 @@
 
 LOCAL_IFILES =                         \
        gnuradio.i                      \
-       shared_ptr.i                    \
+       gr_swig_block_magic.i           \
+       gr_shared_ptr.i                 \
        sw_general.i                    \
        sw_gengen.i                     \
        sw_filter.i                     \
-       sw_io.i
+       sw_io.i                         \
+       sw_runtime.i
 
 ALL_IFILES =                           \
        $(LOCAL_IFILES)
@@ -99,7 +101,7 @@
 
 
 # ----------------------------------------------------------------
-# Part 1: gnuradio.i -> gnuradio_swig_py_runtime
+# Part 1: sw_runtime.i -> gnuradio_swig_py_runtime
 #
 # We continue to call this gnuradio.i to avoid having to touch
 # lots of code in other modules
@@ -123,8 +125,8 @@
 
 gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.h: 
gnuradio_swig_py_runtime.cc
 
-gnuradio_swig_py_runtime.cc : $(srcdir)/gnuradio.i
-       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_runtime.Td 
-module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime.cc 
$(srcdir)/gnuradio.i ;\
+gnuradio_swig_py_runtime.cc : $(srcdir)/sw_runtime.i
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_runtime.Td 
-module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime.cc 
$(srcdir)/sw_runtime.i ;\
        then if test $(host_os) = mingw32; \
             then sed 's,\\\\,/,g' <gnuradio_swig_py_runtime.Td 
>gnuradio_swig_py_runtime.d; rm -f gnuradio_swig_py_runtime.Td; \
             else mv -f gnuradio_swig_py_runtime.Td gnuradio_swig_py_runtime.d; 
fi \

Deleted: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/atsc.i

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gnuradio.i
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gnuradio.i
    2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gnuradio.i
    2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003,2004 Free Software Foundation, Inc.
+ * Copyright 2003,2004,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -25,23 +25,21 @@
 // SWIG interface definition
 ////////////////////////////////////////////////////////////////////////
 
-
-#ifndef SWIGIMPORTED
-%module(directors="1") gnuradio_swig_py_runtime
-#endif
-
 ////////////////////////////////////////////////////////////////////////
 // Headers
 
-
 %{
+#include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
 #include <gr_types.h>
 #include <stddef.h>            // size_t
 %}
 
 %feature("autodoc","1");
 
-%include <shared_ptr.i>
+// local file
+%include <gr_shared_ptr.i>
+
+// non-local SWIG files
 %include <stl.i>
 %include <std_complex.i>
 %include <std_except.i>
@@ -81,11 +79,9 @@
 
 ////////////////////////////////////////////////////////////////////////
 
-%include <runtime.i>
- // %include <general.i>
- // %include <filter.i>
- // %include <io.i>
+#ifndef SW_RUNTIME
+// import runtime.i for all but sw_runtime, since it needs to %include
+%import <runtime.i>
+#endif
 
-// %include <atsc.i>
-
 ////////////////////////////////////////////////////////////////////////

Copied: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gr_shared_ptr.i
 (from rev 10380, gnuradio/trunk/gnuradio-core/src/lib/swig/shared_ptr.i)
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gr_shared_ptr.i
                               (rev 0)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/gr_shared_ptr.i
       2009-02-05 17:03:26 UTC (rev 10394)
@@ -0,0 +1,43 @@
+//
+//  shared_ptr
+//
+//  An enhanced relative of scoped_ptr with reference counted copy semantics.
+//  The object pointed to is deleted when the last shared_ptr pointing to it
+//  is destroyed or reset.
+//
+
+//
+// This is highly hacked up version of boost::shared_ptr
+// We just need enough to get SWIG to "do the right thing" and
+// generate "Smart Pointer" code.
+//
+
+namespace boost {
+
+template<class T> class shared_ptr
+{
+public:
+
+    shared_ptr()
+    {
+    }
+
+    shared_ptr (T * p)
+    {
+    }
+
+
+    T * operator-> () // never throws
+    {
+        return px;
+    }
+    
+
+private:
+
+    T * px;                     // contained pointer
+    int pn;
+
+};  // shared_ptr
+
+};
\ No newline at end of file

Deleted: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/shared_ptr.i

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_filter.i
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_filter.i
   2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_filter.i
   2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -23,13 +23,8 @@
 %module(directors="1") gnuradio_swig_py_filter
 #endif
 
+ //%feature("autodoc", "1");           // generate python docstrings
 
-%feature("autodoc", "1");              // generate python docstrings
+%include "gnuradio.i"                          // the common stuff
 
-%import "gnuradio.i"                           // the common stuff
-
-%{
-#include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
-%}
-
 %include "filter.i"

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_general.i
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_general.i
  2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_general.i
  2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -23,13 +23,8 @@
 %module(directors="1") gnuradio_swig_py_general
 #endif
 
+ //%feature("autodoc", "1");           // generate python docstrings
 
-%feature("autodoc", "1");              // generate python docstrings
+%include "gnuradio.i"                          // the common stuff
 
-%import "gnuradio.i"                           // the common stuff
-
-%{
-#include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
-%}
-
 %include "general.i"

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_gengen.i
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_gengen.i
   2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_gengen.i
   2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -23,13 +23,8 @@
 %module(directors="1") gnuradio_swig_py_gengen
 #endif
 
+ //%feature("autodoc", "1");           // generate python docstrings
 
-%feature("autodoc", "1");              // generate python docstrings
+%include "gnuradio.i"                          // the common stuff
 
-%import "gnuradio.i"                           // the common stuff
-
-%{
-#include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
-%}
-
 %include "gengen.i"

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_io.i
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_io.i
       2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/gnuradio-core/src/lib/swig/sw_io.i
       2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -23,13 +23,8 @@
 %module(directors="1") gnuradio_swig_py_io
 #endif
 
+ //%feature("autodoc", "1");           // generate python docstrings
 
-%feature("autodoc", "1");              // generate python docstrings
+%include "gnuradio.i"                          // the common stuff
 
-%import "gnuradio.i"                           // the common stuff
-
-%{
-#include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
-%}
-
 %include "io.i"

Modified: 
gnuradio/branches/developers/michaelld/swig_tweaks/usrp/host/lib/legacy/db_base.i
===================================================================
--- 
gnuradio/branches/developers/michaelld/swig_tweaks/usrp/host/lib/legacy/db_base.i
   2009-02-04 23:57:12 UTC (rev 10393)
+++ 
gnuradio/branches/developers/michaelld/swig_tweaks/usrp/host/lib/legacy/db_base.i
   2009-02-05 17:03:26 UTC (rev 10394)
@@ -1,12 +1,12 @@
 /* -*- c++ -*- */
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 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 asversion 3, or (at your option)
+// the Free Software Foundation; either version 3, or (at your option)
 // any later version.
 // 
 // GNU Radio is distributed in the hope that it will be useful,
@@ -25,7 +25,7 @@
 #include "db_base.h"
 %}
 
-%include <shared_ptr.i>
+%include <gr_shared_ptr.i>
 
 class usrp_tune_result
 {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]