Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* mlc/tracked_ptr.hh: Add copyright.
* mlc/types.hh: Likewise.
* mlc/traits.hh: Likewise.
* mlc/any.hh: Likewise.
* mlc/box.hh: Likewise.
* mlc/bool.hh: Likewise.
* mlc/contract.hh: Likewise.
* mlc/cmp.hh: Likewise.
any.hh | 27 +++++++++++++++++++++++++++
bool.hh | 27 +++++++++++++++++++++++++++
box.hh | 27 +++++++++++++++++++++++++++
cmp.hh | 27 +++++++++++++++++++++++++++
contract.hh | 27 +++++++++++++++++++++++++++
tracked_ptr.hh | 27 +++++++++++++++++++++++++++
traits.hh | 27 +++++++++++++++++++++++++++
types.hh | 27 +++++++++++++++++++++++++++
8 files changed, 216 insertions(+)
Index: mlc/tracked_ptr.hh
--- mlc/tracked_ptr.hh (revision 25)
+++ mlc/tracked_ptr.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_TRACKED_PTR_HH
# define METALIC_TRACKED_PTR_HH
Index: mlc/types.hh
--- mlc/types.hh (revision 25)
+++ mlc/types.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_TYPES_HH
# define METALIC_TYPES_HH
Index: mlc/traits.hh
--- mlc/traits.hh (revision 25)
+++ mlc/traits.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_TRAITS_HH
# define METALIC_TRAITS_HH
Index: mlc/any.hh
--- mlc/any.hh (revision 25)
+++ mlc/any.hh (working copy)
@@ -1,4 +1,31 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_ANY_HH
# define METALIC_ANY_HH
Index: mlc/box.hh
--- mlc/box.hh (revision 25)
+++ mlc/box.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_BOX_HH
# define METALIC_BOX_HH
Index: mlc/bool.hh
--- mlc/bool.hh (revision 25)
+++ mlc/bool.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_BOOL_HH
# define METALIC_BOOL_HH
Index: mlc/contract.hh
--- mlc/contract.hh (revision 25)
+++ mlc/contract.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_CONTRACT_HH
# define METALIC_CONTRACT_HH
Index: mlc/cmp.hh
--- mlc/cmp.hh (revision 25)
+++ mlc/cmp.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef METALIC_CMP_HH
# define METALIC_CMP_HH
1
0
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* ntg/real/int_u8.hh: Add copyright.
* ntg/real/bin.hh: Likewise.
* ntg/color/rgb_8.hh: Likewise.
color/rgb_8.hh | 27 +++++++++++++++++++++++++++
real/bin.hh | 27 +++++++++++++++++++++++++++
real/int_u8.hh | 27 +++++++++++++++++++++++++++
3 files changed, 81 insertions(+)
Index: ntg/real/int_u8.hh
--- ntg/real/int_u8.hh (revision 25)
+++ ntg/real/int_u8.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef INTEGRE_REAL_INT_U8_HH
# define INTEGRE_REAL_INT_U8_HH
Index: ntg/real/bin.hh
--- ntg/real/bin.hh (revision 25)
+++ ntg/real/bin.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef INTEGRE_REAL_BIN_HH
# define INTEGRE_REAL_BIN_HH
Index: ntg/color/rgb_8.hh
--- ntg/color/rgb_8.hh (revision 25)
+++ ntg/color/rgb_8.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
#ifndef INTEGRE_COLOR_RGB_8_HH
# define INTEGRE_COLOR_RGB_8_HH
1
0
26 Jan '05
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* configure.ac: Add documentation generation support (from Olena).
configure.ac | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
Index: configure.ac
--- configure.ac (revision 22)
+++ configure.ac (working copy)
@@ -39,7 +39,10 @@
metalic/mlc/Makefile
olena/Makefile
olena/oln/Makefile
- olena/oln/config/pconf.hh:olena/oln/config/pconf-hh.in])
+ olena/oln/config/pconf.hh:olena/oln/config/pconf-hh.in
+ doc/ref/out/exdoc.config:doc/ref/out/exdoc.config.in
+ doc/ref/exdoc.mk:doc/ref/exdoc.mk.in
+ doc/ref/doxygen.config:doc/ref/doxygen.config.in])
### Olena components.
@@ -191,10 +194,9 @@
AC_ARG_WITH([doc],
[Doxygen is needed to build the doc],
- [],
[AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
- AC_CHECK_DOXYGEN_VERSION
- ])
+ AC_CHECK_DOXYGEN_VERSION],
+ [])
## if test -z "$DOXYGEN"; then
## AC_MSG_WARN([`doxygen' not found -- `doxygen' must be installed to generate the documentation])
@@ -214,12 +216,12 @@
### The reference manuals directory is a component.
- OLN_NON_COMPONENT([doc/ref],
+ OLN_COMPONENT([doc/ref],
[doc-ref],
[oln_cv_build_ref],
[the Olena reference manuals],
[OLN_DOC],
- [doc/ref/Makefile],
+ [doc/ref/Makefile],
[dnl Configuration for the manuals directory.
AC_ARG_VAR([TAR], [the tape archiver program])
3
4
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* ref/doxygen.config.in: New. Doxygen configuration file (from
Olena).
* ref/out: New.
* ref/out/exdoc.config.in: New. Exdoc configuration (from Olena).
* ref/Makefile.am: Use exdoc to generate documentation.
* ref/img_conv.pl: New. Image conversion script (from Olena).
* ref/exdoc.pl: New. Exdoc to write examples in documentation (from
Olena).
* ref/exdoc.mk.in: New. Makefile for exdoc (from Olena).
* vcs: New. Add vcs support for this ChangeLog.
* vcs/oln.rb: New. Likewise.
ref/Makefile.am | 19 +-
ref/doxygen.config.in | 210 ++++++++++++++++++++++
ref/exdoc.mk.in | 56 +++++
ref/exdoc.pl | 450 ++++++++++++++++++++++++++++++++++++++++++++++++
ref/img_conv.pl | 61 ++++++
ref/out/exdoc.config.in | 13 +
vcs/oln.rb | 13 +
7 files changed, 819 insertions(+), 3 deletions(-)
Index: ChangeLog
Index: vcs/oln.rb
--- vcs/oln.rb (revision 0)
+++ vcs/oln.rb (revision 0)
@@ -0,0 +1,13 @@
+class Vcs
+
+ def oln_commit! ( s, *args )
+
+ common_commit!(*args) do |rev|
+ news!(:groups => ['lrde.olena.patches'],
+ :subject => "proto-1.0 #{rev}: #{s}")
+ end
+
+ end
+ alias_command :olnci, :oln_commit
+
+end # class Vcs
Index: ref/doxygen.config.in
--- ref/doxygen.config.in (revision 0)
+++ ref/doxygen.config.in (revision 0)
@@ -0,0 +1,210 @@
+# Doxyfile 1.3.2
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = @PACKAGE_NAME@
+PROJECT_NUMBER = @PACKAGE_VERSION@
+OUTPUT_DIRECTORY = .
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = NO
+SHORT_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ALIASES = pouetcaption=
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = @top_srcdir@/olena \
+ @top_srcdir@/integre \
+ @top_srcdir@/metalic
+FILE_PATTERNS = *.hh \
+ *.hxx \
+ *.cc
+RECURSIVE = YES
+EXCLUDE = @top_srcdir@/doc \
+ @top_srcdir@/olena/tests \
+ @top_srcdir@/integre/tests \
+ @top_srcdir@/metalic/tests
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH = @top_builddir@/doc/ref/img/
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = YES
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = YES
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = YES
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH = @top_srcdir@/olena/ \
+ @top_srcdir@/integre/ \
+ @top_srcdir@/metalic/
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = NO
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = YES
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = YES
Index: ref/out/exdoc.config.in
--- ref/out/exdoc.config.in (revision 0)
+++ ref/out/exdoc.config.in (revision 0)
@@ -0,0 +1,13 @@
+[ENTRY]
+ COMMAND_PREFIX = \\ # In Doxygen, commands begin with a `\'
+ TAG_OPEN = code
+ TAG_CLOSE = endcode
+ CAPTIONS = cxx # We want to run cxx on the extracted files (see line below)
+ ALIAS cxx = @CXX@ # Here, cxx means g++ but you can choose other compilers
+ # FIXME: we should write the compilation line in the source file (for libs).
+ OPTIONS = @DOC_CPPFLAGS@ @CXXFLAGS_OPTIMIZE@ @CXXFLAGS_STRICT_ERRORS@ -I@top_srcdir@/integre -I@top_builddir@/olena -I@top_srcdir@/olena -I@top_srcdir@/metalic -I@top_builddir@ $1 -o $2 -DIMG_OUT=\"../img/\" -DIMG_IN=\"@top_srcdir@/olena/img/\" -DHAVE_CONFIG_H @TOOLS_LDFLAGS@ # tell how to use the soft, i.e. where to put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME: $* should have explicit name, chek flags
+ OUT = out # FIXME: should be obsolete
+ EXT = cc # Extension of generated file
+ STD_OUT_EXT = std # Extension of generated file standard output
+ ERR_OUT_EXT = err # Extension of generated file error output
+ COMMENT_STYLE = \*\* # begining of comment line
Index: ref/Makefile.am
--- ref/Makefile.am (revision 21)
+++ ref/Makefile.am (working copy)
@@ -6,14 +6,18 @@
include $(top_srcdir)/integre/ntg/makefile.src
olnsrc = $(top_srcdir)/olena/oln
-OUT_DIR = "out"
+EXDOC = $(srcdir)/exdoc.pl
+OUT_DIR = out
+EXTRA_DIST = $(OUT_DIR)/exdoc.config.in
+IMG_CONV = $(srcdir)/img_conv.pl
CLEANFILES = html.tar.gz \
oln-ref.pdf \
- out/out* out/makefile out/all.mk
+ $(OUT_DIR)/out* $(OUT_DIR)/makefile $(OUT_DIR)/all.mk
clean-local:
rm -rf img html latex
+DISTCLEANFILES = $(OUT_DIR)/exdoc.config
MAINTAINERCLEANFILES = $(dist_noinst_DATA) \
./html/* ./img/*
@@ -25,7 +29,16 @@
doc: html.tar.gz oln-ref.pdf
-html.tar.gz: $(HDRS_DEP)
+html.tar.gz: $(HDRS_DEP) $(EXDOC) $(OUT_DIR)/exdoc.config $(IMG_CONV) doxygen.config
+ mkdir -p img
+ $(EXDOC) --config=$(OUT_DIR)/exdoc.config --output-dir=$(OUT_DIR) --input-dir=$(top_srcdir)/olena
+ cd $(OUT_DIR) && $(MAKE) -f makefile
+ $(EXDOC) --config=$(OUT_DIR)/exdoc.config --output-dir=$(OUT_DIR) --input-dir=$(top_srcdir)/integre
+ cd $(OUT_DIR) && $(MAKE) -f makefile
+ $(EXDOC) --config=$(OUT_DIR)/exdoc.config --output-dir=$(OUT_DIR) --input-dir=$(top_srcdir)/metalic
+ cd $(OUT_DIR) && $(MAKE) -f makefile
+ $(IMG_CONV) $(top_srcdir)/olena/img img preserve
+ $(IMG_CONV) img img nopreserve
$(DOXYGEN) doxygen.config
$(TAR) -czf $@ html
Index: ref/img_conv.pl
--- ref/img_conv.pl (revision 0)
+++ ref/img_conv.pl (revision 0)
@@ -0,0 +1,61 @@
+#! /usr/bin/perl -w
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA
+
+
+use strict;
+use IO::File;
+use Text::Wrap;
+use File::Basename;
+use Getopt::Long qw(GetOptions);
+use Pod::Usage qw(pod2usage);
+
+
+sub conv($ $ $)
+{
+ my $file;
+ my $d = $_[0];
+ my $o = $_[1];
+ my $preserve_name = 0;
+ if ($_[2] =~ /^preserve$/)
+ {
+ $preserve_name = 1;
+ }
+
+ opendir DIR, "$d" or die "Unable to open $d.\n";
+ foreach $file(readdir DIR)
+ {
+ if ($file =~ /(.*)\.(pgm|ppm|ppgm|pppgm|pbm)$/)
+ {
+ if ($preserve_name == 1)
+ {
+ print "convert $d/$file to $o/$1_$2.png\n";
+ system "convert $d/$file $o/$1_$2.png";
+ }
+ else
+ {
+ print "convert $d/$file to $o/$1.png\n";
+ system "convert $d/$file $o/$1.png";
+ }
+ }
+ }
+ closedir DIR or die "unable to close $d.";
+}
+my $argc=@ARGV;
+if ($argc != 3)
+{
+ die "usage: img_conv.pl input-dir output-dir preserve|nopreserve\n";
+}
+conv $ARGV[0], $ARGV[1], $ARGV[2];
Property changes on: ref/img_conv.pl
___________________________________________________________________
Name: svn:executable
+ *
Index: ref/exdoc.pl
--- ref/exdoc.pl (revision 0)
+++ ref/exdoc.pl (revision 0)
@@ -0,0 +1,450 @@
+#! /usr/bin/perl -w
+# Extract all examples from the manual source.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA
+
+use strict;
+use IO::File;
+use Text::Wrap;
+use File::Basename;
+use Getopt::Long qw(GetOptions);
+use Pod::Usage qw(pod2usage);
+
+## WARNING SOME PIECE OF CODE WORKING ON TEXI FILES SHOULD BE REMOVED
+## BOFORE DOING THIS, MAKE SURE THE SAME JOB IS PERFORMED BY THE
+## CONFIGURATION DEPENDANT WAY
+
+my $me = basename ($0);
+
+# Array of hash tables holding the information from the config file
+my @config;
+
+# Print the usage method
+sub print_usage()
+{
+ print "Usage:\n";
+ print "$me --configfile=[cfg] --default-name=[default name] --srcdir=[dir to find includes file] --output-dir=[dir to put result]\n";
+ exit(1);
+}
+
+# &parse_config ($FILE)
+# ---------------------
+# Parse the config file.
+sub parse_config($)
+{
+ open (CONFIGFILE, $_[0]) or die "$me: Can't open $_[0]: $!";
+
+ # Number of entries
+ my $entries = -1;
+
+ while (<CONFIGFILE>)
+ {
+ if (/\[ENTRY\]/) { $entries++ }
+ else
+ {
+ SWITCH:
+ {
+ last SWITCH if (/^\s*(\#+.*)*$/);
+ $config[$entries]{"command_prefix"} = $1 and last SWITCH if (/\s*COMMAND_PREFIX\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"tag_open"} = $1 and last SWITCH if (/\s*TAG_OPEN\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"tag_close"} = $1 and last SWITCH if (/\s*TAG_CLOSE\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"captions"} = $1 and last SWITCH if (/\s*CAPTIONS\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"options"} = $1 and last SWITCH if (/\s*OPTIONS\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"out"} = $1 and last SWITCH if (/\s*OUT\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"std_out"} = $1 and last SWITCH if (/\s*STD_OUT_EXT\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"err_out"} = $1 and last SWITCH if (/\s*ERR_OUT_EXT\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"ext"} = $1 and last SWITCH if (/\s*EXT\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"$1"} = $2 and last SWITCH if (/\s*ALIAS\s*([^\s]*)\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ $config[$entries]{"comment_style"} = $1 and last SWITCH if (/\s*COMMENT_STYLE\s*=\s*([^\#]*[^\s])\s*(\#+.*)*$/);
+ die "$0: Error: Unmatching entry: $_";
+ }
+ }
+ }
+ close CONFIGFILE;
+ die "$me: Invalid config file `$_[0]'" if ($entries == -1); # FIXME: not strict enough.
+
+ for (my $i = 0; $i < @config; $i++)
+ {
+ $config[$i]{"tag_open"} = $config[$i]{"command_prefix"} . $config[$i]{"tag_open"};
+ $config[$i]{"tag_close"} = $config[$i]{"command_prefix"} . $config[$i]{"tag_close"};
+ }
+
+ for my $i ( 0 .. $#config )
+ {
+ for my $role ( keys %{ $config[$i] } )
+ {
+ print "elt $i $role is $config[$i]{$role}\n";
+ }
+ }
+}
+
+# get the real value of a field
+# $i: the current entry number
+# $name: the alias name
+sub get_alias($ $)
+{
+ my ($i, $name) = @_;
+ while (defined($config[$i]{$name}))
+ {
+ $name = $config[$i]{$name};
+ }
+ return $name;
+}
+
+# create the cmd line to be executed
+# $i: the current entry number
+sub gen_cmd($ $)
+{
+ my ($i, $prog) = @_;
+ my $cmd = get_alias $i, $config[$i]{"captions"};
+ $cmd = "$cmd ".$config[$i]{"options"};
+ $cmd = $cmd." && ./$prog > $prog.".$config[$i]{"std_out"}." 2> $prog.";
+ $cmd = $cmd.$config[$i]{"err_out"}."\nret=\$?\n";
+ $cmd = $cmd. "if [ \$ret -ne 0 ]\n then\n rm \$2\nfi\nexit \$ret\n";
+ return $cmd;
+}
+
+# Dependencies of KEY as a simple string.
+my %dependency;
+# Set to 1 if KEY is not to keep as a dependency.
+my %ignore;
+
+# &DEPEND ($TARGET, @DEPENDENCY)
+# ------------------------------
+sub depend ($@)
+{
+ my ($target, @dependency) = @_;
+ @dependency = (grep { !exists $ignore{$_} } @dependency);
+ push @{$dependency{$target}}, @dependency
+ if @dependency;
+}
+
+# List of files already opened. $FILE{FILE} is where FILE was
+# first defined.
+my %file;
+
+# ®ister ($FILE)
+# -----------------
+# Make sure the $FILE name is used only once (as input or output), to
+# avoid clashes.
+sub register ($)
+{
+ my ($file2) = @_;
+ if (defined $file{$file2})
+ {
+ die "$file2 already in use\n";
+ }
+ $file{$file2} = $file2;
+}
+
+
+# example_to_verbatim(CODE)
+# -------------------------
+# content: txt
+# style: comment style
+sub example_to_verbatim ($ $)
+{
+ my ($contents, $style) = @_;
+
+ $contents =~ s/^\@(c |comment|dots|end (ignore|group)|ignore|group).*$//gm;
+ # Remove the Texinfo tags.
+ $contents =~ s/^\@(error|result)\{\}//gsm;
+ $contents =~ s/\@([{@}])/$1/gsm;
+ $contents =~ s/^\(a)comment.*//gm;
+ # remove the comment style sequence
+ $contents =~ s/^\s*$style//gm;
+
+ return $contents;
+}
+
+
+# &REPORT (@MESSAGE)
+# ------------------
+# Report some @MESSAGE to the user.
+sub message (@)
+{
+ print STDERR "$me: ", @_, "\n";
+}
+
+
+# &STORE ($FILE, $CONTENTS)
+# -------------------------
+# Save the $CONTENTS in the $FILE, unless it already contains $WHAT.
+sub store ($$)
+{
+ my ($file, $contents) = @_;
+ if (-f $file)
+ {
+ local $/; # Turn on slurp-mode.
+ my $f = new IO::File "< $file"
+ or die "$me: cannot open $file for reading: $!\n";
+ my $old_contents = $f->getline;
+ if ($old_contents eq $contents)
+ {
+ message "$file: unchanged";
+ return ;
+ }
+ }
+ my $out = new IO::File (">$file")
+ or die "$me: cannot create $file: $!\n";
+ print $out $contents;
+ message "$file: new";
+}
+
+# The directory where to store the extracted results.
+# Parse our options, trying to retain backwards compatibility with pod2man but
+# allowing short forms as well. --lax is currently ignored.
+my %option;
+Getopt::Long::config ('bundling_override');
+
+my $odir = "extract";
+my $idir = ".";
+my $srcdir = ".";
+my $default_name;
+GetOptions (\%option,
+ 'configfile|c=s',
+# 'default-name|n=s' => \$default_name,
+ 'srcdir|s=s' => \$srcdir,
+ 'input-dir|I=s' => \$idir,
+ 'output-dir|O=s' => \$odir,
+ 'help|h') or exit 1;
+pod2usage (0) if $option{help};
+
+#print_usage() unless (defined($default_name));
+
+##my $default_name = $option{"default-name"}; ## | for auto generated file name
+my $current_file_no;
+
+
+if (! -d $odir)
+{
+ mkdir $odir or die "$me: cannot create $odir: $!\n";
+}
+my $makefile = new IO::File "> $odir/makefile"
+ or die "$me: cannot create $odir/makefile: $!\n";
+my $all_mk = new IO::File "> $odir/all.mk"
+ or die "$me: cannot create $odir/all.mk: $!\n";
+print $makefile "include $srcdir/../exdoc.mk\n";
+print $makefile ".PHONY: all dvi eps html pdf txt\n";
+# print $makefile "all: txt\n";
+my $example;
+my $last_file;
+
+parse_config ($option{"configfile"});
+print $all_mk "all:";
+print $makefile "include all.mk\n";
+for (my $i = 0; $i < @config; $i++)
+{
+ print $makefile ".";
+ print $makefile $config[$i]{"ext"};
+ print $makefile ":\n\t";
+ print $makefile "chmod 700 ./\$<.cmd ";
+ print $makefile "&& eval ./\$@.";
+ print $makefile $config[$i]{"ext"};
+ print $makefile ".cmd \$< \$@";
+ print $makefile "\n\n";
+}
+
+sub parse($)
+{
+ $current_file_no = 0;
+ open (FILE, $_[0]) or die "$me: Can't open $_[0]: $!";
+ while (<FILE>)
+ {
+ ## @dotcaption{ord, file}
+ ## ======================
+ if (/^\(a)dotcaption{([-.\w]+),\s*([^\}]+)}/)
+ {
+ my $ord = $1;
+ my $file = $2;
+ register $ord;
+ register $file;
+ store "$odir/$ord.file", "$file.dot";
+ depend "html", "$ord.jpg";
+ depend "pdf", "$ord.pdf";
+ depend "txt", "$ord.txt";
+ depend "dvi", "$ord.eps";
+ }
+
+ ## @example/@end example
+ ## =====================
+ ## Memoize the contents.
+ else
+ {
+ my $i = 0;
+
+ for ($i = 0; ($i < @config)
+ && not ((/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_open"}\s*$/ .. /^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_close"}\s*$/)); $i++)
+ {
+ }
+
+ if ($i < @config)
+ {
+ if (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_open"}\s*$/)
+ {
+ # Nothing.
+ undef $example;
+ }
+ elsif (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_close"}\s*$/)
+ {
+ my $fname;
+ my $cmdname;
+ my $ext = $config[$i]{"ext"};
+
+ $ext = ".$ext";
+ if (not defined $last_file)
+ {
+ $last_file = "$default_name$current_file_no";
+ $current_file_no = $current_file_no + 1;
+ }
+ # Output as a verbatim file.
+ $fname = "$odir/$last_file$ext";
+ $cmdname = "$odir/$last_file$ext.cmd";
+ register $fname;
+ register $cmdname;
+ store $fname, example_to_verbatim ($example, $config[$i]{"comment_style"});
+ store $cmdname, gen_cmd ($i, $last_file);
+ depend $last_file, "$last_file$ext", "$last_file$ext.cmd";
+ print $all_mk "$last_file ";
+ undef $last_file;
+ }
+ ## @filecaption{ord, filename}
+ ## Outputting the previous @example as a file.
+ elsif (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"command_prefix"}filecaption{([-.\w]+),\s*([^\}]+)}/)
+ {
+ my ($ord, $file) = ($1, "$2");
+# register $file;
+ $last_file = $file;
+ }
+ else
+ {
+ $example = $example . $_;
+ }
+ }
+
+
+ ## @c extdoc-ignore: file
+ ## ## A file that we should not depend upon (e.g., it does not exist).
+ elsif (/^\@c extdoc-ignore: (.*)$/)
+ {
+ message "ignoring $1";
+ $ignore{$1} = 1;
+ }
+
+
+ ## @havmcaption{ord, args}
+ ## @mipsycaption{ord, args}
+ ## @tccaption{ord, args}
+ ## @sedcaption{ord, args}
+ ## ## Running `havm', `mipsy', `tc', or `sed' on the ARGS.
+ else
+ {
+ my $i = 0;
+ for ($i = 0; ($i < @config) &&
+ not (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"command_prefix"}($config[$i]{"captions"})caption{([-.\w]+),\s*([^\}]+)}/); $i++)
+ {}
+ if ($i < @config && /^\s*$config[$i]{"comment_style"}\s*$config[$i]{"command_prefix"}($config[$i]{"captions"})caption{([-.\w]+),\s*([^\}]+)}/)
+ {
+ my $prog;
+
+
+ if (defined $config[$i]{$1})
+ {
+ $prog = $config[$i]{$1};
+
+ print $prog;
+ }
+ else
+ {
+ $prog = $1;
+ }
+ my $ord = $2;
+ my $args = $3;
+ my $out = "$ord.$config[$i]{out}";
+# register $out;
+ store "$odir/$ord.cmd", "$prog $args";
+ depend "pdf", $out;
+ depend "html", $out;
+ depend "txt", $out;
+ depend "dvi", $out;
+
+ # Dependencies: args except options and output redirections.
+ depend $out, grep { !/^[->]/ } split (' ', $args);
+ }
+ }
+ }
+ }
+ close FILE;
+}
+# go through all rep and sub rep and make stuff on matching file
+sub scanDir
+{
+ my $file;
+ my ($d, $name) = @_;#$_[0];
+ opendir DIR, "$d" or print <STDERR>, "unable to open $d: skipping\n";
+ foreach $file(readdir DIR)
+ {
+ if ((-d "$d/$file") && ($file ne ".") && ($file ne ".."))
+ {
+ &scanDir("$d/$file", "$name"."_$file");
+ }
+ else
+ {
+ if ($file =~ /(.*)\.(h(h|xx)|cc|inc)$/)
+ {
+ $file = "$file";
+# compileAndExecute("$d/$file");
+ print "parsing $d/$file as ";
+ print "$name"."_$1_$2\n";
+ $default_name = "$name"."_$1_$2";
+
+ parse "$d/$file";
+ }
+ }
+ }
+ # closedir DIR or print("unable to close $d: skipping\n"); # to be fixed
+}
+
+scanDir $idir, "out";
+
+for my $target (sort keys %dependency)
+{
+ print $makefile "$target: ";
+ my @dep = @{$dependency{$target}};
+ for (my $k=0; $k != $#dep; $k++)
+ {
+ print $makefile " ".$dep[$k];
+ }
+ print $makefile "\n";
+}
+print $all_mk "\n";
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
+
Property changes on: ref/exdoc.pl
___________________________________________________________________
Name: svn:executable
+ *
Index: ref/exdoc.mk.in
--- ref/exdoc.mk.in (revision 0)
+++ ref/exdoc.mk.in (revision 0)
@@ -0,0 +1,56 @@
+%.dot: %.file
+ cp $$(cat $<) $@
+
+%.texi: %.cmd
+## Eval the cmd to preserve embedded redirections.
+ eval $$(cat $<) >$*.out 2>$*.err; \
+ echo $$? >$*.sta
+ rm -f $@
+ echo '@example' >> $@
+ echo "$$ @kbd{$$(cat $<)}" >> $@
+ if test -s $*.err; then \
+ sed -n -e 's/\([{@}]\)/@\1/g' \
+ -e '/./s/.*/@error{}&/p' $*.err >> $@;\
+ fi
+ if test -s $*.out; then \
+ expand $*.out | \
+ sed -e 's/\([{@}]\)/@\1/g' \
+ -e "s/é/@'e/g" \
+ -e 's/è/@`e/g' \
+ -e 's/ê/@^e/g' \
+ -e 's/ë/@"e/g' \
+ -e 's/î/@^i/g' \
+ -e 's/ï/@"i/g' \
+ -e 's/ô/@^o/g' \
+ >>$@;\
+ fi
+## Display the exit status only if not 0, as it confuses the
+## students to see so many `=> 0'. But, if there is nothing output
+## at all, it is even more confusing, so output `=> 0' only when
+## needed.
+ if test ! -e $@ \
+ || test $$(cat $*.sta) -ne 0; then \
+ sed 's/.*/@result{}&/' $*.sta >> $@; \
+ fi
+ echo "@strong{Example $*}: @kbd{$$(cat $<)}" >> $@
+ echo '@end example' >> $@
+
+## Once for PDF.
+## ratio = 2 makes it wider.
+## size (in Inches) makes it fit into A4.
+%.eps: %.dot
+ dot -Gratio=2 -Gsize=8,8 -Tps2 $*.dot -o $*.ps
+ ps2epsi $*.ps $*.eps
+
+%.pdf: %.eps
+ epstopdf $*.eps -o $*.pdf
+
+## Another for HTML (JPG), using natural size.
+%.jpg: %.dot
+ dot -Tps2 $*.dot -o $*.j.ps
+ ps2epsi $*.j.ps $*.j.eps
+ convert $*.j.eps $*.jpg
+
+## And the text...
+%.txt: %.dot
+ cp $< $@
2
2
proto-1.0 25: Add perl check in configure.ac and doxygen is checked for doc-ref not doc
by Simon Odou 26 Jan '05
by Simon Odou 26 Jan '05
26 Jan '05
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* configure.ac: Perl is needed by Doxygen.
Doxygen is needed for reference manual, not for documentation.
* doc/ref/doxygen.config.in: Autoconf sets the perl path.
configure.ac | 24 +++++++++++-------------
doc/ref/doxygen.config.in | 4 ++--
2 files changed, 13 insertions(+), 15 deletions(-)
Index: configure.ac
--- configure.ac (revision 24)
+++ configure.ac (working copy)
@@ -189,20 +189,7 @@
### Stuff pertaining to the documentation
###
-### The reference manual uses Doxygen
-### FIXME: could be much better.
- AC_ARG_WITH([doc],
- [Doxygen is needed to build the doc],
- [AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
- AC_CHECK_DOXYGEN_VERSION],
- [])
-
-## if test -z "$DOXYGEN"; then
-## AC_MSG_WARN([`doxygen' not found -- `doxygen' must be installed to generate the documentation])
-
-## fi
-
### The documentation tree is both a component...
OLN_NON_COMPONENT([doc],
@@ -224,6 +211,17 @@
[doc/ref/Makefile],
[dnl Configuration for the manuals directory.
+ ### The reference manual uses Doxygen
+ ### FIXME: could be much better.
+
+ AC_ARG_WITH([doc-ref],
+ [Doxygen is needed to build the doc],
+ [AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
+ AC_CHECK_DOXYGEN_VERSION],
+ [])
+
+ AC_ARG_VAR([PERL], [Practical Extraction and Report Language])
+ AC_CHECK_PROGS([PERL], [perl], [$am_aux_dir/missing perl])
AC_ARG_VAR([TAR], [the tape archiver program])
AC_CHECK_PROGS([TAR], [tar], [$am_aux_dir/missing tar])
AC_ARG_VAR([DVIPS], [program to make Postscript from TeX DVI files])
Index: doc/ref/doxygen.config.in
--- doc/ref/doxygen.config.in (revision 24)
+++ doc/ref/doxygen.config.in (working copy)
@@ -39,7 +39,7 @@
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
-ALIASES = pouetcaption=
+ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
@@ -181,7 +181,7 @@
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
+PERL_PATH = @PERL@
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
1
0
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* configure.ac: Set the documentation as a component.
configure.ac | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
Index: configure.ac
--- configure.ac (revision 23)
+++ configure.ac (working copy)
@@ -216,12 +216,12 @@
### The reference manuals directory is a component.
- OLN_COMPONENT([doc/ref],
- [doc-ref],
- [oln_cv_build_ref],
- [the Olena reference manuals],
- [OLN_DOC],
- [doc/ref/Makefile],
+ OLN_NON_COMPONENT([doc/ref],
+ [doc-ref],
+ [oln_cv_build_ref],
+ [the Olena reference manuals],
+ [OLN_DOC],
+ [doc/ref/Makefile],
[dnl Configuration for the manuals directory.
AC_ARG_VAR([TAR], [the tape archiver program])
1
0
Index: olena/oln/fancy/print.hh
===================================================================
--- olena/oln/fancy/print.hh (revision 20)
+++ olena/oln/fancy/print.hh (working copy)
@@ -8,9 +8,7 @@
# include <ntg/real/int_u8.hh> // FIXME: no coupling like that!
-# include <oln/core/1d/image1d.hh>
-# include <oln/core/2d/image2d.hh>
-# include <oln/core/3d/image3d.hh>
+# include <oln/core/abstract/image_dimension.hh>
namespace oln {
Index: olena/oln/fancy/iota.hh
===================================================================
--- olena/oln/fancy/iota.hh (revision 20)
+++ olena/oln/fancy/iota.hh (working copy)
@@ -1,79 +1,28 @@
#ifndef OLENA_FANCY_IOTA_HH
# define OLENA_FANCY_IOTA_HH
-# include <oln/core/1d/image1d.hh>
-# include <oln/core/2d/image2d.hh>
-# include <oln/core/3d/image3d.hh>
+# include <oln/core/macros.hh>
+# include <oln/core/abstract/image.hh>
namespace oln {
namespace fancy {
- namespace impl {
- template <typename T>
- void iota(abstract::image1d<T>& inout);
- template <typename T>
- void iota(abstract::image2d<T>& inout);
- template <typename T>
- void iota(abstract::image3d<T>& inout);
- } // end of namespace impl
+ // facade == impl
-
-
- // facade
-
template <typename I>
void iota(abstract::image<I>& inout)
{
- impl::iota(inout.exact());
+ unsigned counter = 0;
+ oln_piter_type(I) p(inout.size());
+ for_all(p)
+ inout[p] = ++counter;
}
+ } // end of namespace oln::fancy
- // impl
-
- namespace impl {
-
- // FIXME: must be generic, of course ! But for now, we have not yet
- // iterators and we just want to test.
-
- template <typename T>
- void iota(abstract::image2d<T>& inout)
- {
- unsigned counter = 0;
- // FIXME: lacks cleaning
- for (coord_t row = 0; row < inout.size().nrows(); ++row)
- for (coord_t col = 0; col < inout.size().ncols(); ++col)
- inout[point2d(row,col)] = ++counter;
- }
-
- template <typename T>
- void iota(abstract::image1d<T>& inout)
- {
- unsigned counter = 0;
- // FIXME: lacks cleaning
- for (coord_t index = 0; index < inout.size().nindices(); ++index)
- inout[point1d(index)] = ++counter;
- }
-
- template <typename T>
- void iota(abstract::image3d<T>& inout)
- {
- unsigned counter = 0;
- // FIXME: lacks cleaning
- for (coord_t slice = 0; slice < inout.size().nslices(); ++slice)
- for (coord_t row = 0; row < inout.size().nrows(); ++row)
- for (coord_t col = 0; col < inout.size().ncols(); ++col)
- inout[point3d(slice,row,col)] = ++counter;
- }
-
- } // end of namespace impl
-
-
- } // end of namespace fancy
-
-
} // end of namespace oln
Index: olena/oln/config/pconf.hh
===================================================================
--- olena/oln/config/pconf.hh (revision 0)
+++ olena/oln/config/pconf.hh (revision 0)
@@ -0,0 +1,11 @@
+/*! Define to the address where bug reports for this package should be
sent. */
+#define OLN_PACKAGE_BUGREPORT "olena-bugs(a)lrde.epita.fr"
+
+/*! Define to the full name of this package. */
+#define OLN_PACKAGE_NAME "Olena"
+
+/*! Define to the full name and version of this package. */
+#define OLN_PACKAGE_STRING "Olena 0.10"
+
+/*! Define to the version of this package. */
+#define OLN_PACKAGE_VERSION "0.10"
Index: olena/oln/core/macros.hh
===================================================================
--- olena/oln/core/macros.hh (revision 20)
+++ olena/oln/core/macros.hh (working copy)
@@ -28,6 +28,7 @@
# define oln_size_type(T) typename
oln::props<oln_category_type(T),T>::size_type
# define oln_point_type(T) typename
oln::props<oln_category_type(T),T>::point_type
+# define oln_dpoint_type(T) typename
oln::props<oln_category_type(T),T>::dpoint_type
# define oln_value_type(T) typename
oln::props<oln_category_type(T),T>::value_type
# define oln_iter_type(T) typename
oln::props<oln_category_type(T),T>::iter_type
Index: olena/oln/core/abstract/piter.hh
===================================================================
--- olena/oln/core/abstract/piter.hh (revision 20)
+++ olena/oln/core/abstract/piter.hh (working copy)
@@ -11,6 +11,10 @@
# include <oln/core/macros.hh>
+
+# define for_all(P) for(p.start(); p.is_valid(); p.next())
+
+
namespace oln {
namespace abstract {
@@ -48,25 +52,25 @@
void next()
{
- precondition(this->is_ok());
+ precondition(this->is_valid());
this->exact().impl_next();
}
- bool is_ok() const
+ bool is_valid() const
{
- return this->exact().impl_is_ok();
+ return this->exact().impl_is_valid();
}
operator point_type() const
{
- precondition(this->is_ok());
+ precondition(this->is_valid());
return this->p_;
}
void invalidate()
{
this->exact().impl_invalidate();
- postcondition(not this->is_ok());
+ postcondition(not this->is_valid());
}
protected:
@@ -75,7 +79,6 @@
s_(s),
p_()
{
- this->invalidate();
}
const size_type s_;
Index: olena/oln/core/abstract/point.hh
===================================================================
--- olena/oln/core/abstract/point.hh (revision 20)
+++ olena/oln/core/abstract/point.hh (working copy)
@@ -3,29 +3,86 @@
# include <mlc/any.hh>
+# include <oln/core/cats.hh>
+# include <oln/core/props.hh>
+# include <oln/core/macros.hh>
+
+
+/*! \namespace oln
+** \brief oln namespace.
+*/
namespace oln {
+
+ /// fwd decl
namespace abstract {
+ template <typename E> struct point;
+ }
+
+ /*! \class default_props< cat::point >
+ **
+ ** Default properties for points. Specialization of
+ ** default_props<category>.
+ */
+ template <>
+ struct default_props < cat::point >
+ {
+ typedef mlc::undefined_type dpoint_type;
+ };
+
+
+ /*! \namespace oln::abstract
+ ** \brief oln::abstract namespace.
+ */
+ namespace abstract {
+
+ /*! \class abstract::point<E>
+ **
+ ** The abstract::point class is the base class from whom derives
+ ** every concrete point.
+ **
+ ** Parameter E is the exact type of point.
+ */
template <typename E>
struct point : public mlc::any__best_memory<E>
{
+
+ /*! \brief Test equality of two points. Nota bene: this method
+ ** is abstract-like.
+ **
+ ** \return True if both points are the same, false otherwise.
+ */
bool operator==(const point& rhs) const
{
return this->exact().impl_eq(rhs.exact());
}
+ /*! \brief Test difference of two points. Nota bene: this method
+ ** is concrete (and based on abstract::point::operator==).
+ **
+ ** \return True if both points are different, false otherwise.
+ */
bool operator!=(const point& rhs) const
{
return not this->operator==(rhs);
}
- bool operator<(const point& rhs) const
+ typedef oln_dpoint_type(E) dpoint_type;
+
+ // FIXME: doc
+ const point operator+(const dpoint_type& dp) const
{
- return this->exact().impl_less(rhs.exact());
+ return this->exact().impl_plus(dp);
}
+ const dpoint_type operator-(const point& rhs) const
+ {
+ return this->exact().impl_minus(rhs);
+ }
+
protected:
+
point() {}
};
@@ -35,4 +92,4 @@
-#endif // ndef PROTO_OLN_CORE_ABSTRACT_POINT_HH
+#endif // ! PROTO_OLN_CORE_ABSTRACT_POINT_HH
Index: olena/oln/core/abstract/dpoint.hh
===================================================================
--- olena/oln/core/abstract/dpoint.hh (revision 0)
+++ olena/oln/core/abstract/dpoint.hh (revision 0)
@@ -0,0 +1,52 @@
+#ifndef PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
+# define PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
+
+# include <mlc/any.hh>
+
+/*! \namespace oln
+** \brief oln namespace.
+*/
+namespace oln {
+
+ /*! \namespace oln::abstract
+ ** \brief oln::abstract namespace.
+ */
+ namespace abstract {
+
+ /*! \class abstract::dpoint<E>
+ **
+ ** The abstract::dpoint class is the base class from whom derives
+ ** every concrete dpoint. A dpoint is a difference between a couple
+ ** of points.
+ **
+ ** Parameter E is the exact type of dpoint.
+ */
+ template <typename E>
+ struct dpoint : public mlc::any__best_memory<E>
+ {
+
+ /// Test equality of two dpoints.
+ // FIXME: doc...
+ bool operator==(const dpoint& rhs) const
+ {
+ return this->exact().impl_eq(rhs.exact());
+ }
+
+ /// Test difference between two dpoints.
+ bool operator!=(const dpoint& rhs) const
+ {
+ return not this->operator==(rhs);
+ }
+
+ protected:
+
+ dpoint() {}
+ };
+
+ } // end of namespace abstract
+
+} // end of namespace oln
+
+
+
+#endif // ! PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
Index: olena/oln/core/coord.hh
===================================================================
--- olena/oln/core/coord.hh (revision 20)
+++ olena/oln/core/coord.hh (working copy)
@@ -1,16 +1,151 @@
#ifndef OLENA_CORE_COORD_HH
# define OLENA_CORE_COORD_HH
+# include <iostream>
+# include <limits.h>
+# include <mlc/contract.hh>
+
+// FIXME: doc
+
+
namespace oln {
- typedef int coord_t; // FIXME: define a struct to get stronger typing
+ class coord_t
+ {
+ public:
+
+ typedef int value_type;
+
+ coord_t() :
+ value_(undef_())
+ {
+ }
+
+ coord_t(value_type value) :
+ value_(value)
+ {
+ }
+
+ coord_t& operator=(value_type rhs)
+ {
+ this->value_ = rhs;
+ return *this;
+ }
+
+ operator value_type() const
+ {
+ precondition(this->is_defined());
+ return value_;
+ }
+
+ bool operator==(value_type rhs) const
+ {
+ precondition(this->is_defined());
+ return value_ == rhs;
+ }
+
+ bool operator!=(value_type rhs) const
+ {
+ precondition(this->is_defined());
+ return value_ != rhs;
+ }
+
+ const coord_t operator+(value_type rhs) const
+ {
+ precondition(this->is_defined());
+ coord_t tmp(value_ + rhs); return tmp;
+ }
+
+ coord_t& operator++()
+ {
+ precondition(this->is_defined());
+ ++value_;
+ return *this;
+ }
+
+ const coord_t operator++(int)
+ {
+ precondition(this->is_defined());
+ coord_t tmp = *this;
+ ++value_;
+ return tmp;
+ }
+
+ const coord_t operator-(value_type rhs) const
+ {
+ precondition(this->is_defined());
+ coord_t tmp(value_ - rhs);
+ return tmp;
+ }
+
+ const coord_t operator-() const
+ {
+ precondition(this->is_defined());
+ coord_t tmp(-value_); return tmp;
+ }
+
+ coord_t& operator--()
+ {
+ precondition(this->is_defined());
+ --value_;
+ return *this;
+ }
+
+ const coord_t operator--(int)
+ {
+ precondition(this->is_defined());
+ coord_t tmp = *this;
+ --value_;
+ return tmp;
+ }
+
+ bool is_defined() const
+ {
+ return value_ != undef_();
+ }
+
+ bool is_undefined() const
+ {
+ return value_ == undef_();
+ }
+
+ static const coord_t& infty()
+ {
+ static coord_t infty_ = INT_MAX;
+ return infty_;
+ }
+
+ static const coord_t& _infty()
+ {
+ static coord_t _infty_ = INT_MIN + 1;
+ return _infty_;
+ }
+
+ // FIXME: to be continued
+
+ private:
+
+ value_type value_;
+
+ static const value_type undef_()
+ {
+ return INT_MIN;
+ }
+
+ };
+
+
} // end of namespace oln
-// CHANGE: specialization internal::default_less is removed
-// what was the point? and why was it an 'internal' feature?!
+
+std::ostream& operator<<(std::ostream& ostr, const oln::coord_t& c)
+{
+ precondition(c.is_defined());
+ return ostr << oln::coord_t::value_type(c);
+}
#endif // ! OLENA_CORE_COORD_HH
Index: olena/oln/core/1d/dpoint1d.hh
===================================================================
--- olena/oln/core/1d/dpoint1d.hh (revision 0)
+++ olena/oln/core/1d/dpoint1d.hh (revision 0)
@@ -0,0 +1,87 @@
+#ifndef OLENA_CORE_1D_DPOINT1D_HH
+# define OLENA_CORE_1D_DPOINT1D_HH
+
+# include <ostream>
+
+# include <oln/core/coord.hh>
+# include <oln/core/1d/point1d.hh>
+
+// FIXME: there's an assumption here: we do not need inheritance for
+// dpoints. so abstract::dpoint does not exist...
+
+// FIXME: doc!
+
+// FIXME: test that coords are defined
+
+
+namespace oln {
+
+ struct dpoint1d
+ {
+ dpoint1d()
+ {
+ }
+
+ dpoint1d(coord_t index_) :
+ index_(index_)
+ {
+ }
+
+ dpoint1d(const dpoint1d& rhs) :
+ index_(rhs.index_)
+ {
+ }
+
+ dpoint1d& operator=(const dpoint1d& rhs)
+ {
+ if (&rhs == this)
+ return *this;
+ this->index_ = rhs.index_;
+ return *this;
+ }
+
+ bool operator==(const dpoint1d& rhs) const
+ {
+ return this->index_ == rhs.index_;
+ }
+
+ bool operator!=(const dpoint1d& rhs) const
+ {
+ return this->index_ != rhs.index_;
+ }
+
+ const dpoint1d operator+(const dpoint1d& rhs) const
+ {
+ dpoint1d tmp(this->index() + rhs.index());
+ return tmp;
+ }
+
+ const point1d operator+(const point1d& rhs) const
+ {
+ point1d tmp(this->index() + rhs.index());
+ return tmp;
+ }
+
+ const dpoint1d operator-() const
+ {
+ dpoint1d tmp(-this->index());
+ return tmp;
+ }
+
+ const coord_t index() const { return index_; }
+ coord_t& index() { return index_; }
+
+ protected:
+ coord_t index_;
+ };
+
+} // end of namespace oln
+
+
+std::ostream& operator<<(std::ostream& ostr, const oln::dpoint1d& dp)
+{
+ return ostr << '(' << dp.index() << ')';
+}
+
+
+#endif // ! OLENA_CORE_1D_DPOINT1D_HH
Index: olena/oln/core/1d/fwd_piter1d.hh
===================================================================
--- olena/oln/core/1d/fwd_piter1d.hh (revision 0)
+++ olena/oln/core/1d/fwd_piter1d.hh (revision 0)
@@ -0,0 +1,74 @@
+#ifndef PROTO_OLN_CORE_1D_FWD_PITER1D_HH
+# define PROTO_OLN_CORE_1D_FWD_PITER1D_HH
+
+# include <mlc/contract.hh>
+
+# include <oln/core/abstract/piter.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/1d/size1d.hh>
+# include <oln/core/props.hh>
+
+
+namespace oln {
+
+ struct fwd_piter1d;
+
+ template <> struct category_type< fwd_piter1d > { typedef cat::piter
ret; };
+
+ template <>
+ struct props < cat::piter, fwd_piter1d > : public default_props<
cat::piter >
+ {
+ typedef point1d point_type;
+ typedef size1d size_type;
+ };
+
+ struct fwd_piter1d : public abstract::piter< fwd_piter1d >
+ {
+
+ typedef abstract::piter<fwd_piter1d> super_type;
+
+ fwd_piter1d(const size1d& size) :
+ super_type(size)
+ {
+ this->exact_ptr = this;
+ this->invalidate();
+ }
+
+# if defined __GNUC__ && __GNUC__ >= 3
+ friend class abstract::piter< fwd_piter1d >;
+ protected:
+# endif
+
+ void impl_start()
+ {
+ this->p_.index() = 0;
+ postcondition(this->p_.index().is_defined());
+ }
+
+ bool impl_is_valid() const
+ {
+ precondition(this->p_.index().is_defined());
+ return this->p_.index() < this->s_.nindices();
+ }
+
+ void impl_next()
+ {
+ precondition(this->p_.index().is_defined());
+ precondition(this->p_.index() >= 0 and this->p_.index() <=
this->s_.nindices());
+ if (this->p_.index() == this->s_.nindices())
+ return;
+ ++this->p_.index();
+ postcondition(this->p_.index().is_defined());
+ }
+
+ void impl_invalidate()
+ {
+ this->p_.index() = this->s_.nindices();
+ postcondition(this->p_.index().is_defined());
+ }
+
+ };
+}
+
+
+#endif // ndef PROTO_OLN_CORE_1D_FWD_PITER1D_HH
Index: olena/oln/core/1d/point1d.hh
===================================================================
--- olena/oln/core/1d/point1d.hh (revision 20)
+++ olena/oln/core/1d/point1d.hh (working copy)
@@ -5,13 +5,30 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/coord.hh>
+# include <oln/core/cats.hh>
+# include <oln/core/props.hh>
+// FIXME: doc
+
+// FIXME: test that coords are defined
+
namespace oln {
+ struct point1d;
+ struct dpoint1d;
+
+ template <>
+ struct category_type< point1d > { typedef cat::point ret; };
+
+ template <>
+ struct props < cat::point, point1d >
+ {
+ typedef dpoint1d dpoint_type;
+ };
+
struct point1d : public abstract::point< point1d >
{
- point1d() :
- index_(0)
+ point1d()
{
}
@@ -33,16 +50,25 @@
return *this;
}
+ const coord_t index() const { return index_; }
+ coord_t& index() { return index_; }
+
+# if defined __GNUC__ && __GNUC__ >= 3
+ friend class abstract::point< point1d >;
+ protected:
+# endif
+
+ const point1d impl_plus(const dpoint1d& rhs) const;
+
+ const dpoint1d impl_minus(const point1d& rhs) const;
+
bool impl_eq(const point1d& rhs) const
{
return this->index_ == rhs.index_;
}
- const coord_t index() const { return index_; }
-
- coord_t& index() { return index_; }
-
protected:
+
coord_t index_;
};
@@ -55,4 +81,25 @@
}
+# include <oln/core/1d/dpoint1d.hh>
+
+
+namespace oln {
+
+ const point1d point1d::impl_plus(const dpoint1d& rhs) const
+ {
+ point1d tmp(this->index() + rhs.index());
+ return tmp;
+ }
+
+ const dpoint1d point1d::impl_minus(const point1d& rhs) const
+ {
+ dpoint1d tmp(this->index() - rhs.index());
+ return tmp;
+ }
+
+} // end of namespace oln
+
+
+
#endif // ! OLENA_CORE_1D_POINT1D_HH
Index: olena/oln/core/1d/size1d.hh
===================================================================
--- olena/oln/core/1d/size1d.hh (revision 20)
+++ olena/oln/core/1d/size1d.hh (working copy)
@@ -11,9 +11,7 @@
struct size1d : public abstract::size< size1d >
{
- size1d() :
- nindices_(0),
- border_(0)
+ size1d()
{}
size1d(coord_t nindices_) :
Index: olena/oln/core/2d/dpoint2d.hh
===================================================================
--- olena/oln/core/2d/dpoint2d.hh (revision 0)
+++ olena/oln/core/2d/dpoint2d.hh (revision 0)
@@ -0,0 +1,90 @@
+#ifndef OLENA_CORE_2D_DPOINT2D_HH
+# define OLENA_CORE_2D_DPOINT2D_HH
+
+# include <ostream>
+
+# include <oln/core/coord.hh>
+# include <oln/core/2d/point2d.hh>
+
+// FIXME: there's an assumption here: we do not need inheritance for
+// dpoints. so abstract::dpoint does not exist...
+
+// FIXME: doc!
+
+namespace oln {
+
+ struct dpoint2d
+ {
+ dpoint2d()
+ {
+ }
+
+ dpoint2d(coord_t row_, coord_t col_) :
+ row_(row_),
+ col_(col_)
+ {
+ }
+
+ dpoint2d(const dpoint2d& rhs) :
+ row_(rhs.row_),
+ col_(rhs.col_)
+ {
+ }
+
+ dpoint2d& operator=(const dpoint2d& rhs)
+ {
+ if (&rhs == this)
+ return *this;
+ this->row_ = rhs.row_;
+ this->col_ = rhs.col_;
+ return *this;
+ }
+
+ bool operator==(const dpoint2d& rhs) const
+ {
+ return this->row_ == rhs.row_ and this->col_ == rhs.col_;
+ }
+
+ bool operator!=(const dpoint2d& rhs) const
+ {
+ return not this->operator==(rhs);
+ }
+
+ const dpoint2d operator+(const dpoint2d& rhs) const
+ {
+ dpoint2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
+ return tmp;
+ }
+
+ const point2d operator+(const point2d& rhs) const
+ {
+ point2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
+ return tmp;
+ }
+
+ const dpoint2d operator-() const
+ {
+ dpoint2d tmp(-this->row(), -this->col());
+ return tmp;
+ }
+
+ const coord_t row() const { return row_; }
+ const coord_t col() const { return col_; }
+
+ coord_t& row() { return row_; }
+ coord_t& col() { return col_; }
+
+ protected:
+ coord_t row_, col_;
+ };
+
+} // end of namespace oln
+
+
+std::ostream& operator<<(std::ostream& ostr, const oln::dpoint2d& dp)
+{
+ return ostr << '(' << dp.row() << ',' << dp.col() << ')';
+}
+
+
+#endif // ! OLENA_CORE_2D_DPOINT2D_HH
Index: olena/oln/core/2d/array2d.hh
===================================================================
--- olena/oln/core/2d/array2d.hh (revision 20)
+++ olena/oln/core/2d/array2d.hh (working copy)
@@ -174,9 +174,9 @@
or
(buffer_ == 0 and
array_ == 0 and
- size_.nrows() == 0 and
- size_.ncols() == 0 and
- size_.border() == 0));
+ size_.nrows().is_undefined() and
+ size_.ncols().is_undefined() and
+ size_.border().is_undefined()));
}
};
Index: olena/oln/core/2d/fwd_piter2d.hh
===================================================================
--- olena/oln/core/2d/fwd_piter2d.hh (revision 20)
+++ olena/oln/core/2d/fwd_piter2d.hh (working copy)
@@ -27,38 +27,51 @@
typedef abstract::piter<fwd_piter2d> super_type;
- friend class abstract::piter<fwd_piter2d>;
-
fwd_piter2d(const size2d& size) :
super_type(size)
{
this->exact_ptr = this;
+ this->invalidate();
}
+# if defined __GNUC__ && __GNUC__ >= 3
+ friend class abstract::piter< fwd_piter2d >;
+ protected:
+# endif
+
void impl_start()
{
this->p_.row() = 0;
this->p_.col() = 0;
+ postcondition(this->p_.row().is_defined() and
this->p_.col().is_defined());
}
- bool impl_is_ok() const
+ bool impl_is_valid() const
{
+ precondition(this->p_.row().is_defined() and
this->p_.col().is_defined());
return this->p_.row() < this->s_.nrows();
}
void impl_next()
{
+ precondition(this->p_.row().is_defined() and
this->p_.col().is_defined());
+ precondition(this->p_.row() >= 0 and this->p_.row() <=
this->s_.nrows()
+ and
+ this->p_.col() >= 0 and this->p_.col() <= this->s_.ncols());
++this->p_.col();
if (this->p_.col() != this->s_.ncols())
return;
this->p_.col() = 0;
+ precondition(this->p_.row() != this->s_.nrows());
++this->p_.row();
+ postcondition(this->p_.row().is_defined() and
this->p_.col().is_defined());
}
void impl_invalidate()
{
this->p_.row() = this->s_.nrows();
this->p_.col() = this->s_.ncols();
+ postcondition(this->p_.row().is_defined() and
this->p_.col().is_defined());
}
};
Index: olena/oln/core/2d/point2d.hh
===================================================================
--- olena/oln/core/2d/point2d.hh (revision 20)
+++ olena/oln/core/2d/point2d.hh (working copy)
@@ -5,14 +5,28 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/coord.hh>
+# include <oln/core/cats.hh>
+# include <oln/core/props.hh>
+// FIXME: doc!
+
namespace oln {
+ struct point2d;
+ struct dpoint2d;
+
+ template <>
+ struct category_type< point2d > { typedef cat::point ret; };
+
+ template <>
+ struct props < cat::point, point2d >
+ {
+ typedef dpoint2d dpoint_type;
+ };
+
struct point2d : public abstract::point< point2d >
{
- point2d() :
- row_(0),
- col_(0)
+ point2d()
{
}
@@ -37,18 +51,28 @@
return *this;
}
- bool impl_eq(const point2d& rhs) const
- {
- return this->row_ == rhs.row_ and this->col_ == rhs.col_;
- }
-
const coord_t row() const { return row_; }
const coord_t col() const { return col_; }
coord_t& row() { return row_; }
coord_t& col() { return col_; }
+# if defined __GNUC__ && __GNUC__ >= 3
+ friend class abstract::point< point2d >;
protected:
+# endif
+
+ const point2d impl_plus(const dpoint2d& rhs) const;
+
+ const dpoint2d impl_minus(const point2d& rhs) const;
+
+ bool impl_eq(const point2d& rhs) const
+ {
+ return this->row_ == rhs.row_ and this->col_ == rhs.col_;
+ }
+
+ protected:
+
coord_t row_, col_;
};
@@ -61,4 +85,24 @@
}
+# include <oln/core/2d/dpoint2d.hh>
+
+
+namespace oln {
+
+ const point2d point2d::impl_plus(const dpoint2d& rhs) const
+ {
+ point2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
+ return tmp;
+ }
+
+ const dpoint2d point2d::impl_minus(const point2d& rhs) const
+ {
+ dpoint2d tmp(this->row() - rhs.row(), this->col() - rhs.col());
+ return tmp;
+ }
+
+} // end of namespace oln
+
+
#endif // ! OLENA_CORE_2D_POINT2D_HH
Index: olena/oln/core/2d/size2d.hh
===================================================================
--- olena/oln/core/2d/size2d.hh (revision 20)
+++ olena/oln/core/2d/size2d.hh (working copy)
@@ -11,10 +11,7 @@
struct size2d : public abstract::size< size2d >
{
- size2d() :
- nrows_(0),
- ncols_(0),
- border_(0)
+ size2d()
{}
size2d(coord_t nrows_, coord_t ncols_) :
1
0
Index: ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* oln/makefile.src: Add new files to distribution and remove old one.
* oln/core/macros.hh: Add oln_iter_type macro.
* oln/core/abstract/piter.hh: Fix compilation errors.
* oln/core/2d/image2d.hh: Fix incorrect file inclusion.
* oln/core/2d/fwd_piter2d.hh: Fix compilation errors.
core/2d/fwd_piter2d.hh | 25 ++++++++++++++-----------
core/2d/image2d.hh | 3 ++-
core/abstract/piter.hh | 24 +++++++++++++++++-------
core/macros.hh | 2 ++
makefile.src | 11 ++---------
5 files changed, 37 insertions(+), 28 deletions(-)
Index: oln/makefile.src
--- oln/makefile.src (revision 19)
+++ oln/makefile.src (working copy)
@@ -4,19 +4,13 @@
##
OLN_DEP = \
- basics.hh \
- basics1d.hh \
- basics2d.hh \
- basics3d.hh \
- config/pconf.hh \
- config/system.hh \
core/1d/array1d.hh \
core/1d/image1d.hh \
core/1d/point1d.hh \
core/1d/size1d.hh \
core/2d/array2d.hh \
core/2d/image2d.hh \
- core/2d/iter2d.hh \
+ core/2d/fwd_piter2d.hh \
core/2d/point2d.hh \
core/2d/size2d.hh \
core/3d/array3d.hh \
@@ -26,11 +20,10 @@
core/abstract/data_storage.hh \
core/abstract/image.hh \
core/abstract/image_constness.hh \
- core/abstract/image_dimension.hh \
core/abstract/image_with_data.hh \
core/abstract/images.hh \
core/abstract/internal/image_impl.hh \
- core/abstract/iter.hh \
+ core/abstract/piter.hh \
core/abstract/point.hh \
core/abstract/size.hh \
core/cats.hh \
Index: oln/core/macros.hh
--- oln/core/macros.hh (revision 19)
+++ oln/core/macros.hh (working copy)
@@ -30,6 +30,8 @@
# define oln_point_type(T) typename oln::props<oln_category_type(T),T>::point_type
# define oln_value_type(T) typename oln::props<oln_category_type(T),T>::value_type
+# define oln_iter_type(T) typename oln::props<oln_category_type(T),T>::iter_type
+
# define oln_value_storage_type(T) typename oln::props<oln_category_type(T),T>::value_storage_type
# define oln_value_container_type(T) typename oln::props<oln_category_type(T),T>::value_container_type
Index: oln/core/abstract/piter.hh
--- oln/core/abstract/piter.hh (revision 19)
+++ oln/core/abstract/piter.hh (working copy)
@@ -8,11 +8,22 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/cats.hh>
# include <oln/core/props.hh>
+# include <oln/core/macros.hh>
namespace oln {
+ namespace abstract {
+ template <typename E> struct piter;
+
+ }
+
+
+ template <typename E>
+ struct category_type<abstract::piter<E> > { typedef cat::piter ret; };
+
+
template <>
struct default_props < cat::piter >
{
@@ -24,9 +35,12 @@
namespace abstract {
template <typename E>
- struct piter : public mlc::any__best_memory<E>
+ struct piter : public mlc::any__best_speed<E>
{
-
+ typedef piter<E> self_type;
+ typedef oln_point_type(E) point_type;
+ typedef oln_size_type(E) size_type;
+
void start()
{
this->exact().impl_start();
@@ -34,7 +48,7 @@
void next()
{
- precondition(this->is_ok());
+ precondition(this->is_ok());
this->exact().impl_next();
}
@@ -57,10 +71,6 @@
protected:
- typedef piter<E> self_type;
- typedef oln_point_type(self_type) point_type;
- typedef oln_size_type(self_type) size_type;
-
piter(const size_type& s) :
s_(s),
p_()
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 19)
+++ oln/core/2d/image2d.hh (working copy)
@@ -5,6 +5,7 @@
# include <oln/core/abstract/image_with_data.hh>
# include <oln/core/2d/array2d.hh>
+# include <oln/core/2d/fwd_piter2d.hh>
/*! \namespace oln
** \brief oln namespace.
@@ -16,7 +17,7 @@
template <typename T> class image2d;
// category decl
- template <typename T>
+ template <typename T>
struct category_type< image2d<T> > { typedef cat::image ret; };
Index: oln/core/2d/fwd_piter2d.hh
--- oln/core/2d/fwd_piter2d.hh (revision 19)
+++ oln/core/2d/fwd_piter2d.hh (working copy)
@@ -1,9 +1,9 @@
-#ifndef PROTO_OLN_CORE_2D_FWD_ITER2D_HH
-# define PROTO_OLN_CORE_2D_FWD_ITER2D_HH
+#ifndef PROTO_OLN_CORE_2D_FWD_PITER2D_HH
+# define PROTO_OLN_CORE_2D_FWD_PITER2D_HH
# include <mlc/contract.hh>
-# include <oln/core/abstract/iter.hh>
+# include <oln/core/abstract/piter.hh>
# include <oln/core/2d/point2d.hh>
# include <oln/core/2d/size2d.hh>
# include <oln/core/props.hh>
@@ -11,25 +11,28 @@
namespace oln {
- struct fwd_iter2d;
+ struct fwd_piter2d;
+ template <> struct category_type<fwd_piter2d> { typedef cat::piter ret; };
+
template <>
- struct props < cat::piter, fwd_iter2d >
+ struct props < cat::piter, fwd_piter2d > : public default_props<cat::piter>
{
typedef point2d point_type;
typedef size2d size_type;
};
- struct fwd_iter2d : public abstract::piter<fwd_iter2d>
+ struct fwd_piter2d : public abstract::piter< fwd_piter2d >
{
- typedef abstract::iter<fwd_iter2d> super_type;
+ typedef abstract::piter<fwd_piter2d> super_type;
- friend class abstract::iter<fwd_iter2d>;
+ friend class abstract::piter<fwd_piter2d>;
- fwd_iter2d(const size2d& size) :
+ fwd_piter2d(const size2d& size) :
super_type(size)
{
+ this->exact_ptr = this;
}
void impl_start()
@@ -43,7 +46,7 @@
return this->p_.row() < this->s_.nrows();
}
- void impl_next() const
+ void impl_next()
{
++this->p_.col();
if (this->p_.col() != this->s_.ncols())
@@ -62,4 +65,4 @@
}
-#endif // ndef PROTO_OLN_CORE_2D_FWD_ITER2D_HH
+#endif // ndef PROTO_OLN_CORE_2D_FWD_PITER2D_HH
1
0
Index: ChangeLog
===================================================================
--- ChangeLog (revision 18)
+++ ChangeLog (working copy)
@@ -1,3 +1,15 @@
+2005-01-24 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
+
+ * oln/core/props.hh: Move image defaults into abstract/image.hh.
+ * oln/core/macros.hh: Add piter related macros.
+ * oln/core/abstract/image.hh: Add image defaults and piter typedefs.
+ * oln/core/abstract/iter.hh: Move to piter.hh.
+ * oln/core/abstract/piter.hh: Change interface.
+ * oln/core/2d/image2d.hh: Add piter typedefs in props.
+ * oln/core/2d/iter2d.hh: Move to fwd_piter2d.hh.
+ * oln/core/2d/fwd_piter2d.hh: Conform to new interface.
+ * oln/core/cats.hh: Add cat::piter.
+
2005-01-21 Simon Odou <simon(a)lrde.epita.fr>
* tests/core/tests/readonly_image: New.
Index: oln/core/props.hh
===================================================================
--- oln/core/props.hh (revision 18)
+++ oln/core/props.hh (working copy)
@@ -29,32 +29,6 @@
struct default_props;
- // FIXME: doc
- template <>
- struct default_props < cat::image >
- {
- typedef mlc::undefined_type delegated_type;
-
- typedef mlc::undefined_type size_type;
- typedef mlc::undefined_type point_type;
- typedef mlc::undefined_type value_type;
-
- typedef mlc::undefined_type value_storage_type;
- typedef mlc::undefined_type value_container_type;
-
- // FIXME: etc.
-
- template <typename T>
- struct ch_value_type
- {
- typedef mlc::undefined_type ret;
- };
-
- protected:
- default_props() {}
- };
-
-
/*! \class props<E>
**
** Declaration of the trait class for properties.
Index: oln/core/macros.hh
===================================================================
--- oln/core/macros.hh (revision 18)
+++ oln/core/macros.hh (working copy)
@@ -33,6 +33,9 @@
# define oln_value_storage_type(T) typename
oln::props<oln_category_type(T),T>::value_storage_type
# define oln_value_container_type(T) typename
oln::props<oln_category_type(T),T>::value_container_type
+# define oln_piter_type(T) typename
oln::props<oln_category_type(T),T>::piter_type
+# define oln_fwd_piter_type(T) typename
oln::props<oln_category_type(T),T>::fwd_piter_type
+
// binary macros
# define oln_ch_value_type(I,V) typename
oln::props<oln_category_type(I),I>::ch_value_type<V>::ret
Index: oln/core/abstract/image.hh
===================================================================
--- oln/core/abstract/image.hh (revision 18)
+++ oln/core/abstract/image.hh (working copy)
@@ -2,9 +2,12 @@
# define OLENA_CORE_ABSTRACT_IMAGE_HH
# include <oln/core/abstract/internal/image_impl.hh>
+# include <oln/core/cats.hh>
+# include <oln/core/props.hh>
# include <oln/core/macros.hh>
# include <oln/core/value_box.hh>
+
/*! \namespace oln
** \brief oln namespace.
*/
@@ -12,6 +15,36 @@
+ // FIXME: doc
+ template <>
+ struct default_props < cat::image >
+ {
+ typedef mlc::undefined_type delegated_type;
+
+ typedef mlc::undefined_type size_type;
+ typedef mlc::undefined_type point_type;
+ typedef mlc::undefined_type value_type;
+
+ typedef mlc::undefined_type piter_type;
+ typedef mlc::undefined_type fwd_piter_type;
+
+ typedef mlc::undefined_type value_storage_type;
+ typedef mlc::undefined_type value_container_type;
+
+ // FIXME: etc.
+
+ template <typename T>
+ struct ch_value_type
+ {
+ typedef mlc::undefined_type ret;
+ };
+
+ protected:
+ default_props() {}
+ };
+
+
+
/*! \namespace oln::abstract
** \brief oln::abstract namespace.
*/
Index: oln/core/abstract/iter.hh
===================================================================
--- oln/core/abstract/iter.hh (revision 18)
+++ oln/core/abstract/iter.hh (working copy)
@@ -1,72 +0,0 @@
-#ifndef PROTO_OLN_CORE_ABSTRACT_ITER_HH
-# define PROTO_OLN_CORE_ABSTRACT_ITER_HH
-
-# include <mlc/any.hh>
-
-# include <oln/core/abstract/point.hh>
-# include <oln/core/abstract/size.hh>
-
-namespace oln {
-
- namespace abstract {
-
- template <typename E>
- struct iter : mlc::any__best_memory<E>
- {
-
- void
- operator++()
- {
- this->exact().next_impl();
- }
-
- void
- begin()
- {
- this->exact().begin_impl();
- }
-
- bool
- end()
- {
- return this->exact().end_impl();
- }
-
-
- template <typename P>
- bool
- operator!=(const point<P> &p) const
- {
- return this->exact().noteq_impl(p.exact());
- }
-
- template <typename P>
- bool
- operator==(const point<P> &p) const
- {
- return this->exact().eq_impl(p.exact());
- }
-
- template <typename P>
- operator point<P>() const
- {
- return this->exact().to_point();
- }
-
- template <typename S>
- void operator() (const size<S> &s)
- {
- this->exact().op_par_impl(s.exact());
- }
-
- protected:
-
- iter()
- {}
-
- };
- }
-}
-
-
-#endif // ndef PROTO_OLN_CORE_ABSTRACT_ITER_HH
Index: oln/core/abstract/piter.hh
===================================================================
--- oln/core/abstract/piter.hh (revision 18)
+++ oln/core/abstract/piter.hh (working copy)
@@ -1,72 +1,79 @@
-#ifndef PROTO_OLN_CORE_ABSTRACT_ITER_HH
-# define PROTO_OLN_CORE_ABSTRACT_ITER_HH
+#ifndef PROTO_OLN_CORE_ABSTRACT_PITER_HH
+# define PROTO_OLN_CORE_ABSTRACT_PITER_HH
# include <mlc/any.hh>
+# include <mlc/types.hh>
+# include <mlc/contract.hh>
# include <oln/core/abstract/point.hh>
-# include <oln/core/abstract/size.hh>
+# include <oln/core/cats.hh>
+# include <oln/core/props.hh>
+
namespace oln {
+
+ template <>
+ struct default_props < cat::piter >
+ {
+ typedef mlc::undefined_type point_type;
+ typedef mlc::undefined_type size_type;
+ };
+
+
namespace abstract {
template <typename E>
- struct iter : mlc::any__best_memory<E>
+ struct piter : public mlc::any__best_memory<E>
{
-
- void
- operator++()
+
+ void start()
{
- this->exact().next_impl();
+ this->exact().impl_start();
}
- void
- begin()
+ void next()
{
- this->exact().begin_impl();
+ precondition(this->is_ok());
+ this->exact().impl_next();
}
- bool
- end()
+ bool is_ok() const
{
- return this->exact().end_impl();
+ return this->exact().impl_is_ok();
}
-
- template <typename P>
- bool
- operator!=(const point<P> &p) const
+ operator point_type() const
{
- return this->exact().noteq_impl(p.exact());
+ precondition(this->is_ok());
+ return this->p_;
}
- template <typename P>
- bool
- operator==(const point<P> &p) const
+ void invalidate()
{
- return this->exact().eq_impl(p.exact());
+ this->exact().impl_invalidate();
+ postcondition(not this->is_ok());
}
- template <typename P>
- operator point<P>() const
- {
- return this->exact().to_point();
- }
+ protected:
- template <typename S>
- void operator() (const size<S> &s)
+ typedef piter<E> self_type;
+ typedef oln_point_type(self_type) point_type;
+ typedef oln_size_type(self_type) size_type;
+
+ piter(const size_type& s) :
+ s_(s),
+ p_()
{
- this->exact().op_par_impl(s.exact());
+ this->invalidate();
}
- protected:
+ const size_type s_;
+ point_type p_;
- iter()
- {}
-
};
}
}
-#endif // ndef PROTO_OLN_CORE_ABSTRACT_ITER_HH
+#endif // ndef PROTO_OLN_CORE_ABSTRACT_PITER_HH
Index: oln/core/2d/image2d.hh
===================================================================
--- oln/core/2d/image2d.hh (revision 18)
+++ oln/core/2d/image2d.hh (working copy)
@@ -37,6 +37,9 @@
typedef point2d point_type;
typedef T value_type;
+ typedef fwd_piter2d piter_type;
+ typedef fwd_piter2d fwd_piter_type;
+
// please note that value_storage_type means data_type
// since image2d is an image_with_data
typedef mlc_encoding_type(T) value_storage_type;
Index: oln/core/2d/iter2d.hh
===================================================================
--- oln/core/2d/iter2d.hh (revision 18)
+++ oln/core/2d/iter2d.hh (working copy)
@@ -1,98 +0,0 @@
-#ifndef PROTO_OLN_CORE_2D_ITER2D_HH
-# define PROTO_OLN_CORE_2D_ITER2D_HH
-
-# include <mlc/contract.hh>
-
-# include <oln/core/abstract/iter.hh>
-# include <oln/core/2d/point2d.hh>
-# include <oln/core/2d/size2d.hh>
-# include <oln/core/props.hh>
-
-
-namespace oln {
-
- struct iter2d;
-
- struct iter2d : abstract::iter<iter2d>
- {
-
- typedef abstract::iter<iter2d> super_type;
-
- friend class abstract::iter<iter2d>;
-
- iter2d() : super_type(), nrows_(0), ncols_(0)
- {}
-
- iter2d(const size2d& size) :
- super_type(),
- nrows_(size.nrows()),
- ncols_(size.ncols())
- {}
-
-
- protected:
-
- coord_t nrows_;
- coord_t ncols_;
- point2d p_;
-
- point2d
- to_point() const
- {
- precondition(!end_impl());
- invariant(this->p_.row() >= 0 &&
- (this->p_.row() < nrows_ || this->p_.row() == nrows_) &&
- this->p_.col() >= 0 &&
- this->p_.col() < ncols_);
- return this->p_;
- }
-
-
- void op_par_impl(const size2d& size)
- {
- ncols_ = size.ncols();
- nrows_ = size.nrows();
- }
-
- void
- next_impl()
- {
- this->p_.col()++;
- if (this->p_.col() != this->ncols_)
- return;
- this->p_.col() = 0;
- this->p_.row()++;
- }
-
- void
- begin_impl()
- {
- this->p_.row() = 0;
- this->p_.col() = 0;
- }
-
- bool
- end_impl() const
- {
- return this->p_.row() == this->nrows_;
- }
-
-
- bool
- noteq_impl(const point2d &p) const
- {
- return p_ != p.exact();
- }
-
- bool
- eq_impl(const point2d &p) const
- {
- return p_ == p.exact();
- }
-
-
- };
-}
-
-
-#endif // ndef PROTO_OLN_CORE_2D_ITER2D_HH
Index: oln/core/2d/fwd_piter2d.hh
===================================================================
--- oln/core/2d/fwd_piter2d.hh (revision 18)
+++ oln/core/2d/fwd_piter2d.hh (working copy)
@@ -1,5 +1,5 @@
-#ifndef PROTO_OLN_CORE_2D_ITER2D_HH
-# define PROTO_OLN_CORE_2D_ITER2D_HH
+#ifndef PROTO_OLN_CORE_2D_FWD_ITER2D_HH
+# define PROTO_OLN_CORE_2D_FWD_ITER2D_HH
# include <mlc/contract.hh>
@@ -11,88 +11,55 @@
namespace oln {
- struct iter2d;
+ struct fwd_iter2d;
- struct iter2d : abstract::iter<iter2d>
+ template <>
+ struct props < cat::piter, fwd_iter2d >
{
+ typedef point2d point_type;
+ typedef size2d size_type;
+ };
- typedef abstract::iter<iter2d> super_type;
+ struct fwd_iter2d : public abstract::piter<fwd_iter2d>
+ {
- friend class abstract::iter<iter2d>;
+ typedef abstract::iter<fwd_iter2d> super_type;
- iter2d() : super_type(), nrows_(0), ncols_(0)
- {}
+ friend class abstract::iter<fwd_iter2d>;
- iter2d(const size2d& size) :
- super_type(),
- nrows_(size.nrows()),
- ncols_(size.ncols())
- {}
-
-
- protected:
-
- coord_t nrows_;
- coord_t ncols_;
- point2d p_;
-
- point2d
- to_point() const
+ fwd_iter2d(const size2d& size) :
+ super_type(size)
{
- precondition(!end_impl());
- invariant(this->p_.row() >= 0 &&
- (this->p_.row() < nrows_ || this->p_.row() == nrows_) &&
- this->p_.col() >= 0 &&
- this->p_.col() < ncols_);
- return this->p_;
}
-
- void op_par_impl(const size2d& size)
+ void impl_start()
{
- ncols_ = size.ncols();
- nrows_ = size.nrows();
- }
-
- void
- next_impl()
- {
- this->p_.col()++;
- if (this->p_.col() != this->ncols_)
- return;
- this->p_.col() = 0;
- this->p_.row()++;
- }
-
- void
- begin_impl()
- {
this->p_.row() = 0;
this->p_.col() = 0;
}
- bool
- end_impl() const
+ bool impl_is_ok() const
{
- return this->p_.row() == this->nrows_;
+ return this->p_.row() < this->s_.nrows();
}
-
- bool
- noteq_impl(const point2d &p) const
+ void impl_next() const
{
- return p_ != p.exact();
+ ++this->p_.col();
+ if (this->p_.col() != this->s_.ncols())
+ return;
+ this->p_.col() = 0;
+ ++this->p_.row();
}
- bool
- eq_impl(const point2d &p) const
+ void impl_invalidate()
{
- return p_ == p.exact();
+ this->p_.row() = this->s_.nrows();
+ this->p_.col() = this->s_.ncols();
}
-
};
}
-#endif // ndef PROTO_OLN_CORE_2D_ITER2D_HH
+#endif // ndef PROTO_OLN_CORE_2D_FWD_ITER2D_HH
Index: oln/core/cats.hh
===================================================================
--- oln/core/cats.hh (revision 18)
+++ oln/core/cats.hh (working copy)
@@ -35,9 +35,10 @@
namespace cat {
struct image;
+ struct data_storage;
+ struct piter;
struct point;
struct size;
- struct data_storage;
// FIXME:...
} // end of namespace oln::cat
1
0
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* mlc/traits.hh: Add `mlc_encoding_type_' macro.
traits.hh | 1 +
1 files changed, 1 insertion(+)
Index: mlc/traits.hh
--- mlc/traits.hh (revision 17)
+++ mlc/traits.hh (working copy)
@@ -14,6 +14,7 @@
# define mlc_encoding_type(T) typename mlc::traits<T>::encoding_type
+# define mlc_encoding_type_(T) mlc::traits<T>::encoding_type
1
0