* image2d.ixx,
* neighb2d.i,
* window2d.i:
Give names to wrapped base classes, so that recent version of SWIG
actually considers them and allows upcasts.
---
swilena/ChangeLog | 10 ++++++++++
swilena/image2d.ixx | 16 +++++++---------
swilena/neighb2d.i | 23 ++++++++++++-----------
swilena/window2d.i | 9 ++++-----
4 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index aeb9f6b..e183332 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,3 +1,13 @@
+2014-05-23 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Make Swilena compatible with SWIG 2.0.9+.
+
+ * image2d.ixx,
+ * neighb2d.i,
+ * window2d.i:
+ Give names to wrapped base classes, so that recent version of SWIG
+ actually considers them and allows upcasts.
+
2014-05-22 Roland Levillain <roland(a)lrde.epita.fr>
Address Clang warnings in Swilena.
diff --git a/swilena/image2d.ixx b/swilena/image2d.ixx
index 963fcfc..3972cff 100644
--- a/swilena/image2d.ixx
+++ b/swilena/image2d.ixx
@@ -1,6 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2010, 2014 EPITA Research and Development
+// Laboratory (LRDE).
//
// This file is part of Olena.
//
@@ -82,12 +82,10 @@
}
}
- // Instantiate base classes of mln::image2d<T> so that Swig knows it
- // derives from mln::Image.
- %template() mln::Image< mln::image2d< int > >;
- %template() mln::internal::image_checked_< mln::image2d< T > >;
- %template() mln::internal::image_base< T, mln::box2d, mln::image2d< T > >;
- %template() mln::internal::image_primary< T, mln::box2d, mln::image2d< T >
>;
- // Instantiate mln::image2d<T>
+ // Instantiate mln::image2d<T> and its (directly useful) base classes.
+ %template(Image_ ## I) mln::Image< mln::image2d< T > >;
+ %template(image_checked_ ## I) mln::internal::image_checked_< mln::image2d< T
> >;
+ %template(image_base_ ## I) mln::internal::image_base< T, mln::box2d,
mln::image2d< T > >;
+ %template(image_primary_ ## I) mln::internal::image_primary< T, mln::box2d,
mln::image2d< T > >;
%template(I) mln::image2d< T >;
%enddef // !instantiate_image2d
diff --git a/swilena/neighb2d.i b/swilena/neighb2d.i
index 1dba3dd..4f644ab 100644
--- a/swilena/neighb2d.i
+++ b/swilena/neighb2d.i
@@ -1,5 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2014 EPITA Research and Development
+// Laboratory (LRDE).
//
// This file is part of Olena.
//
@@ -57,37 +58,37 @@
const typename mln::dpoint<mln::grid::square,mln::def::coord>::coord&,
const typename mln::dpoint<mln::grid::square,mln::def::coord>::coord&);
-// Instantiate base classes of mln::neighb2d so that Swig knows it
-// derives from mln::Neighborhood.
-%template() mln::Neighborhood<
+// Instantiate mln::neighb2d and its (directly useful) base classes.
+%template(Neighborhood_neighb2d) mln::Neighborhood<
mln::neighb<
- mln::window< mln::dpoint< mln::grid::square,mln::def::coord > >
+ mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >
;
-%template() mln::internal::neighborhood_extra_impl<
+%template(neighborhood_extra_impl_neighb2d) mln::internal::neighborhood_extra_impl<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >,
mln::neighb<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >
;
-%template() mln::internal::neighborhood_impl<
+%template(neighborhood_impl_neighb2d) mln::internal::neighborhood_impl<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >,
mln::neighb<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >
;
-%template() mln::internal::neighborhood_base<
+%template(neighborhood_base_neighb2d) mln::internal::neighborhood_base<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >,
mln::neighb<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >
;
-%template() mln::internal::neighb_base<
+%template(neighb_base_neighb2d) mln::internal::neighb_base<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >,
mln::neighb<
mln::window< mln::dpoint< mln::grid::square, mln::def::coord > >
;
-// Instantiate mln::neighb2d.
%template(neighb2d)
-mln::neighb< mln::window < mln::dpoint< mln::grid::square, mln::def::coord >
> >;
+mln::neighb<
+ mln::window < mln::dpoint< mln::grid::square, mln::def::coord > >
+>;
diff --git a/swilena/window2d.i b/swilena/window2d.i
index bf2247d..5ffd12c 100644
--- a/swilena/window2d.i
+++ b/swilena/window2d.i
@@ -1,5 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2014 EPITA Research and Development
+// Laboratory (LRDE).
//
// This file is part of Olena.
//
@@ -68,12 +69,10 @@ insert(const typename mln::dpoint<mln::grid::square,
mln::def::coord>::coord&,
}
}
-// Instantiate base classes of mln::window2d so that Swig knows it
-// derives from mln::Window.
-%template() mln::internal::window_base<
+ // Instantiate mln::window2d and its base class.
+%template(Window_window2d) mln::internal::window_base<
mln::dpoint<mln::grid::square, mln::def::coord >,
mln::window< mln::dpoint<mln::grid::square, mln::def::coord > >
;
- // Instantiate mln::window2d.
%template(window2d)
mln::window< mln::dpoint<mln::grid::square,mln::def::coord > >;
--
1.7.10.4