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
February 2007
- 4 participants
- 45 discussions
08 Feb '07
I admit this is a hack, but from Akim's words himself, Autoconf is not
designed to handle optionally configured files, nor is Automake designed
to support optionally distributed files.
Note: olena/oln/lrde is only removed from the distributed files, not
from the repository.
2007-02-08 Roland Levillain <roland(a)lrde.epita.fr>
Remove olena/oln/lrde from the distribution.
* config/strip-lrde: New.
* Makefile.am (EXTRA_DIST): Add config/strip-lrde.
(dist-hook): New.
* configure.ac, Makefile.am, olena/oln/Makefile.am: Use
config/strip-lrde to strip everything related to olena/oln/lrde
when creating the distribution.
2006-12-20 Roland Levillain <roland(a)lrde.epita.fr>
--- 10.271/configure.ac Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.12 600)
+++ 10.272/configure.ac Thu, 08 Feb 2007 18:09:47 +0100 levill_r (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.13 600)
@@ -463,16 +463,17 @@
AC_SUBST([DOC_CPPFLAGS])
AC_SUBST([TOOLS_LDFLAGS])
-## -- FIXME: Improve integration. ----------------------------------------
-##
-## The contents of `olena/oln/lrde' should be moved to another subdirectory
-## of `olena/oln/', and the contents of `olena/lrde/ufmt/bin to
-## `olena/tests' or to `tools'.
+#<<lrde
+# FIXME: Improve integration.
+#
+# The directory `olena/oln/lrde' is a place where we work on algorithms
+# not mature enough to integrate the distribution. Hence it is only
+# available from the repository, not from the distribution.
AC_CONFIG_FILES([olena/oln/lrde/Makefile
olena/oln/lrde/efigi/Makefile
olena/oln/lrde/ufmt/Makefile
olena/oln/lrde/ufmt/bin/Makefile])
-## ---------------------------------------- FIXME: Improve integration. --
+#>>
AC_OUTPUT
--- 10.271/Makefile.am Fri, 07 Jul 2006 18:40:24 +0200 levill_r (oln/n/32_Makefile.a 1.17.1.2.1.8 600)
+++ 10.272/Makefile.am Thu, 08 Feb 2007 18:09:47 +0100 levill_r (oln/n/32_Makefile.a 1.17.1.2.1.9 600)
@@ -19,7 +19,8 @@
### Development files.
###
-EXTRA_DIST = bootstrap.sh config/oln-local.m4 contrib/runtests
+EXTRA_DIST = bootstrap.sh config/oln-local.m4 contrib/runtests \
+ config/strip-lrde
###
### Basic doc files generation.
@@ -64,3 +65,20 @@
else \
echo "$@: GNU cppi is required" >&2; \
fi
+
+#<<lrde
+## FIXME: Improve integration.
+# Remove any trace of olena/oln/lrde from the distribution and reset
+# the GNU Build system for the distdir layout.
+dist-hook:
+ $(top_srcdir)/config/strip-lrde $(distdir)/configure.ac && \
+ $(top_srcdir)/config/strip-lrde $(distdir)/Makefile.am && \
+ $(top_srcdir)/config/strip-lrde $(distdir)/olena/oln/Makefile.am && \
+ rm -rf $(distdir)/olena/oln/lrde && \
+ ( \
+ cd $(distdir); \
+ set -evx; \
+ ./bootstrap.sh; \
+ find . -name autom4te.cache | xargs rm -rf \
+ )
+#>>
--- 10.271/olena/oln/Makefile.am Fri, 15 Sep 2006 11:05:05 +0200 levill_r (oln/q/47_Makefile.a 1.3.1.1.1.6.1.7.1.7.1.3 600)
+++ 10.272/olena/oln/Makefile.am Thu, 08 Feb 2007 18:09:47 +0100 levill_r (oln/q/47_Makefile.a 1.3.1.1.1.6.1.7.1.7.1.4 600)
@@ -11,10 +11,12 @@
nobase_oln_HEADERS = $(OLN_DEP)
-## -- FIXME: Improve integration. ----------------------------------------
+SUBDIRS = .
+#<<lrde
+## FIXME: Improve integration.
##
-## The contents of `olena/lrde' should be moved to subdirectory of
-## `olena/oln', and the contents of `olena/lrde/ufmt/bin to `olena/tests'
-## or to `tools'.
-SUBDIRS = . lrde
-## ---------------------------------------- FIXME: Improve integration. --
+## The directory `olena/oln/lrde' is a place where we work on algorithms
+## not mature enough to integrate the distribution. Hence it is only
+## available from the Subversion repository, not from the distribution.
+SUBDIRS += lrde
+#>>
Index: 10.271/oln.prj
--- 10.271/oln.prj
+++ 10.272/oln.prj
@@ -1,46 +1,21 @@
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Olena")
-(Project-Version oln 10 271)
-(Parent-Version oln 10 270)
+(Project-Version oln 10 272)
+(Parent-Version oln 10 271)
(Version-Log "2007-02-08 Roland Levillain <roland(a)lrde.epita.fr>
- Add new binaries for Salembier et al. algorithm.
-
- * oln/lrde/ufmt/generic_salembier.hh
- (generic_salembier::npoints) [DEBUG]: New attribute.
- (generic_salembier::generic_salembier) [DEBUG]: Initialize it.
- (generic_salembier::update_status) [DEBUG]: New function.
- (generic_salembier::flood) [DEBUG]: Use it.
- * oln/lrde/ufmt/generic_simplified_salembier.hh
- (generic_simplified_salembier::npoints) [DEBUG]: New attribute.
- (generic_simplified_salembier::generic_simplified_salembier)
- [DEBUG]: Initialize it.
- (generic_simplified_salembier::update_status) [DEBUG]: New
- function.
- (generic_simplified_salembier::flood) [DEBUG]: Use it.
- * oln/lrde/ufmt/bin/basic_salembier_float_via_16b.cc,
- * oln/lrde/ufmt/bin/generic_salembier_float_via_16b.cc: New.
- * oln/lrde/ufmt/bin/Makefile.am (check_PROGRAMS): Add
- basic_salembier_float_via_16b and generic_salembier_float_via_16b.
- (basic_salembier_float_via_16b_SOURCES)
- (basic_salembier_float_via_16b_LDFLAGS)
- (generic_salembier_float_via_16b_SOURCES)
- (generic_salembier_float_via_16b_LDFLAGS): New.
- * oln/lrde/ufmt/README: Typo.
-
-
- New tool: pfm-crop.
-
- * oln/lrde/efigi/misc.hh (crop): New function.
- * oln/lrde/efigi/req.hh (equalize_16): New function.
- * oln/lrde/efigi/pfm-crop.cc: New.
- * oln/lrde/efigi/Makefile.am (check_PROGRAMS): Add pfm-crop.
- (pfm_crop_SOURCES): New.
+ Remove olena/oln/lrde from the distribution.
+ * config/strip-lrde: New.
+ * Makefile.am (EXTRA_DIST): Add config/strip-lrde.
+ (dist-hook): New.
+ * configure.ac, Makefile.am, olena/oln/Makefile.am: Use
+ config/strip-lrde to strip everything related to olena/oln/lrde
+ when creating the distribution.
")
(New-Version-Log "")
-(Checkin-Time "Thu, 08 Feb 2007 12:40:28 +0100")
+(Checkin-Time "Thu, 08 Feb 2007 18:09:47 +0100")
(Checkin-Login levill_r)
;; diff-ignore tests/data/.*pbm$
;; diff-ignore .*\.pbm$
@@ -153,7 +128,7 @@
(Project-Keywords)
(Files
- (ChangeLog (oln/o/33_ChangeLog 1.37.1.16.1.17.1.19.1.31 600))
+ (ChangeLog (oln/o/33_ChangeLog 1.37.1.16.1.17.1.19.1.32 600))
(doc/ChangeLog (oln/o/31_ChangeLog 1.38.1.7.1.5.1.14.1.17 600))
(integre/ChangeLog (oln/q/35_ChangeLog 1.12.1.2.1.51 600))
(metalic/ChangeLog (oln/q/30_ChangeLog 1.3.1.44 600))
@@ -169,7 +144,7 @@
(cleanup.sh (oln/o/29_cleanup.sh 1.6 700))
- (configure.ac (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.12 600))
+ (configure.ac (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.13 600))
(doc/demo/image.cc (oln/d/46_image.cc 1.8 600))
(doc/demo/Makefile.am (oln/d/44_Makefile.a 1.16.1.2 600))
@@ -185,7 +160,7 @@
(doc/Makefile.am (oln/e/0_Makefile.a 1.14 600))
(doc/ref/processing.tpl (oln/d/48_processing 1.16 600))
- (Makefile.am (oln/n/32_Makefile.a 1.17.1.2.1.8 600))
+ (Makefile.am (oln/n/32_Makefile.a 1.17.1.2.1.9 600))
(NEWS (oln/0_NEWS 1.24 600))
(olena/img/face_se.pbm (oln/n/17_face_se.pb 1.1 600) :no-keywords)
@@ -834,7 +809,7 @@
(integre/tests/check/defs.in (oln/q/42_defs.in 1.1 600))
(metalic/mlc/array/objs.hh (oln/q/45_objs.hh 1.3 600))
(metalic/mlc/config/system.hh (oln/q/46_system.hh 1.2 600))
- (olena/oln/Makefile.am (oln/q/47_Makefile.a 1.3.1.1.1.6.1.7.1.7.1.3 600))
+ (olena/oln/Makefile.am (oln/q/47_Makefile.a 1.3.1.1.1.6.1.7.1.7.1.4 600))
(integre/ntg/config/system.hh (oln/q/48_system.hh 1.2 600))
(metalic/tests/main/tests/is_a1 (oln/r/17_is_a1 1.4 600))
(metalic/tests/main/tests/ensure3 (oln/r/18_ensure3 1.4 600))
@@ -1695,6 +1670,11 @@
(olena/oln/lrde/efigi/pfm-crop.cc (oln/y/15_pfm-crop.c 1.1 644))
(olena/oln/lrde/ufmt/bin/basic_salembier_float_via_16b.cc (oln/y/16_basic_sale 1.1 644))
(olena/oln/lrde/ufmt/bin/generic_salembier_float_via_16b.cc (oln/y/17_generic_sa 1.1 644))
+
+;; Files added byIndex: 10.271/ChangeLog
Index: 10.271/configure.ac
Index: 10.271/Makefile.am
Index: 10.271/olena/oln/Makefile.am
Only in 10.272: config/strip-lrde
populate at Thu, 08 Feb 2007 14:59:08 +0100,
+;; to version 10.271(w), by levill_r:
+
+ (config/strip-lrde (oln/y/18_strip-lrde 1.1 755))
)
(Merge-Parents)
(New-Merge-Parents)
1
0
olena-0.10 10.271: Add new binaries for Salembier et al. algorithm. New tool: pfm-crop.
by Roland Levillain 08 Feb '07
by Roland Levillain 08 Feb '07
08 Feb '07
2007-02-08 Roland Levillain <roland(a)lrde.epita.fr>
Add new binaries for Salembier et al. algorithm.
* oln/lrde/ufmt/generic_salembier.hh
(generic_salembier::npoints) [DEBUG]: New attribute.
(generic_salembier::generic_salembier) [DEBUG]: Initialize it.
(generic_salembier::update_status) [DEBUG]: New function.
(generic_salembier::flood) [DEBUG]: Use it.
* oln/lrde/ufmt/generic_simplified_salembier.hh
(generic_simplified_salembier::npoints) [DEBUG]: New attribute.
(generic_simplified_salembier::generic_simplified_salembier)
[DEBUG]: Initialize it.
(generic_simplified_salembier::update_status) [DEBUG]: New
function.
(generic_simplified_salembier::flood) [DEBUG]: Use it.
* oln/lrde/ufmt/bin/basic_salembier_float_via_16b.cc,
* oln/lrde/ufmt/bin/generic_salembier_float_via_16b.cc: New.
* oln/lrde/ufmt/bin/Makefile.am (check_PROGRAMS): Add
basic_salembier_float_via_16b and generic_salembier_float_via_16b.
(basic_salembier_float_via_16b_SOURCES)
(basic_salembier_float_via_16b_LDFLAGS)
(generic_salembier_float_via_16b_SOURCES)
(generic_salembier_float_via_16b_LDFLAGS): New.
* oln/lrde/ufmt/README: Typo.
New tool: pfm-crop.
* oln/lrde/efigi/misc.hh (crop): New function.
* oln/lrde/efigi/req.hh (equalize_16): New function.
* oln/lrde/efigi/pfm-crop.cc: New.
* oln/lrde/efigi/Makefile.am (check_PROGRAMS): Add pfm-crop.
(pfm_crop_SOURCES): New.
--- 10.270/configure.ac Wed, 20 Dec 2006 14:46:12 +0100 levill_r (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.11 600)
+++ 10.271/configure.ac Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.12 600)
@@ -465,9 +465,9 @@
## -- FIXME: Improve integration. ----------------------------------------
##
-## The contents of `olena/lrde' should be moved to subdirectory of
-## `olena/oln', and the contents of `olena/lrde/ufmt/bin to `olena/tests'
-## or to `tools'.
+## The contents of `olena/oln/lrde' should be moved to another subdirectory
+## of `olena/oln/', and the contents of `olena/lrde/ufmt/bin to
+## `olena/tests' or to `tools'.
AC_CONFIG_FILES([olena/oln/lrde/Makefile
olena/oln/lrde/efigi/Makefile
olena/oln/lrde/ufmt/Makefile
--- 10.270/olena/oln/lrde/ufmt/README Wed, 03 Jan 2007 15:17:57 +0100 levill_r (oln/x/22_README 1.7 644)
+++ 10.271/olena/oln/lrde/ufmt/README Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/x/22_README 1.8 644)
@@ -157,7 +157,7 @@
** naive_generic_salembier
-A previous version of generic_simplified_salembier, probablt no longer
+A previous version of generic_simplified_salembier, probably no longer
useful.
flooding
--- 10.270/olena/oln/lrde/ufmt/bin/Makefile.am Wed, 03 Jan 2007 15:17:57 +0100 levill_r (oln/x/29_Makefile.a 1.5 644)
+++ 10.271/olena/oln/lrde/ufmt/bin/Makefile.am Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/x/29_Makefile.a 1.6 644)
@@ -6,14 +6,19 @@
generic_salembier_int_u8 generic_salembier_float generic_salembier_float2 \
generic_simplified_salembier_float \
naive_generic_salembier_float \
+ basic_salembier_float_via_16b \
+ generic_salembier_float_via_16b \
fiorio-1 fiorio-2 fiorio-3 \
hdc_maxtree hpc_maxtree r1ic_maxtree rpc_maxtree
basic_maxtree_SOURCES = basic_maxtree.cc
basic_najman_SOURCES = basic_najman.cc
-basic_salembier_SOURCES = basic_salembier.cc
+# Salembier - Unsigned integer versions.
+basic_salembier_SOURCES = basic_salembier.cc
generic_salembier_int_u8_SOURCES = generic_salembier_int_u8.cc
+
+# Salembier - Float versions.
generic_salembier_float_SOURCES = generic_salembier_float.cc
generic_salembier_float_LDFLAGS = -lcfitsio $(ZLIB_LDFLAGS)
generic_salembier_float2_SOURCES = generic_salembier_float2.cc
@@ -23,6 +28,13 @@
naive_generic_salembier_float_SOURCES = naive_generic_salembier_float.cc
naive_generic_salembier_float_LDFLAGS = -lcfitsio $(ZLIB_LDFLAGS)
+# Salembier - Float versions, using a 16-bits equalization step.
+basic_salembier_float_via_16b_SOURCES = basic_salembier_float_via_16b.cc
+basic_salembier_float_via_16b_LDFLAGS = -lcfitsio $(ZLIB_LDFLAGS)
+generic_salembier_float_via_16b_SOURCES = generic_salembier_float_via_16b.cc
+generic_salembier_float_via_16b_LDFLAGS = -lcfitsio $(ZLIB_LDFLAGS)
+
+
fiorio_1_SOURCES = fiorio.cc
fiorio_2_SOURCES = fiorio.cc
fiorio_2_CPPFLAGS = -DFIORIO_VERSION=2
--- 10.270/olena/oln/lrde/efigi/misc.hh Fri, 15 Dec 2006 10:22:33 +0100 theo (oln/x/50_misc.hh 1.1 644)
+++ 10.271/olena/oln/lrde/efigi/misc.hh Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/x/50_misc.hh 1.2 644)
@@ -150,6 +150,24 @@
}
+ // Crop a 2-D image.
+ template <typename T>
+ image2d<T>
+ crop(const image2d<T>& input, coord x, coord y, coord dx, coord dy)
+ {
+ assertion (dx > 0);
+ assertion (dy > 0);
+ assertion(ima.hold(point2d(x, y)));
+ assertion(ima.hold(point2d(x + dx, y + dy)));
+
+ image2d<float> output(dx, dy);
+ for (coord row = 0; row < dx; ++row)
+ for (coord col = 0; col < dy; ++col)
+ output(row, col) = input(x + row, y + col);
+ return output;
+ }
+
+
} // end of namespace oln::efigi
} // end of namespace oln
--- 10.270/olena/oln/lrde/efigi/req.hh Fri, 15 Dec 2006 10:22:33 +0100 theo (oln/y/0_req.hh 1.1 644)
+++ 10.271/olena/oln/lrde/efigi/req.hh Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/y/0_req.hh 1.2 644)
@@ -160,6 +160,30 @@
return output;
}
+ image2d<unsigned short>
+ equalize_16(const image2d<float>& input)
+ {
+ std::vector<pix> v = efigi::sort(input);
+ const int nrows = input.nrows(), ncols = input.ncols();
+ image2d<unsigned short> output(nrows, ncols);
+
+ unsigned n = unsigned((nrows * ncols) / 65536.f + 1.f);
+ unsigned l = 0;
+ for (;;)
+ {
+ for (unsigned i = 0; i < n; ++i)
+ {
+ unsigned j = l * n + i;
+ if (j >= v.size())
+ return output;
+ pix& p = v[l * n + i];
+ output(p.row, p.col) = l;
+ }
+ ++l;
+ }
+ return output;
+ }
+
image2d<bool>
lab2bin(const image2d<unsigned char>& input)
--- 10.270/olena/oln/lrde/efigi/Makefile.am Wed, 20 Dec 2006 14:46:12 +0100 levill_r (oln/y/6_Makefile.a 1.1 644)
+++ 10.271/olena/oln/lrde/efigi/Makefile.am Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/y/6_Makefile.a 1.2 644)
@@ -21,12 +21,14 @@
check_PROGRAMS = \
gaussian \
+ pfm-crop \
pfm2pgm \
pgm2pfm \
pgm2pfm_wo_noise \
wst
gaussian_SOURCES = gaussian.cc
+pfm_crop_SOURCES = pfm-crop.cc
pfm2pgm_SOURCES = pfm2pgm.cc
pgm2pfm_wo_noise_SOURCES = pgm2pfm_wo_noise.cc
pgm2pfm_SOURCES = pgm2pfm.cc
--- 10.270/olena/oln/lrde/ufmt/generic_salembier.hh Wed, 03 Jan 2007 15:17:57 +0100 levill_r (oln/y/8_generic_sa 1.2 644)
+++ 10.271/olena/oln/lrde/ufmt/generic_salembier.hh Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/y/8_generic_sa 1.3 644)
@@ -153,6 +153,9 @@
typedef std::pair<unsigned, value> pair_t;
std::map<pair_t, pair_t> father;
+# ifdef OLN_DEBUG
+ unsigned npoints;
+# endif // OLN_DEBUG
generic_salembier(const abstract::image<I>& f,
const oln_neighborhood_type(I)& nbh) :
@@ -161,6 +164,9 @@
// FIXME: status should NOT be initialized here!
// (but in "init()") (??)
status(f.size())
+# ifdef OLN_DEBUG
+ , npoints(f.npoints())
+# endif // OLN_DEBUG
{
}
@@ -195,6 +201,25 @@
}
+# ifdef OLN_DEBUG
+ void update_status (std::ostream& ostr)
+ {
+ static unsigned nupdates = 0;
+ static const unsigned step = 1;
+ static unsigned next_step = step;
+ ++nupdates;
+ unsigned percent = nupdates * 100 / npoints;
+ if (percent >= next_step)
+ {
+ // Print.
+ std::cerr << percent << "% points processed" << std::endl;
+ // Increase the next step.
+ while (percent >= next_step)
+ next_step += step;
+ }
+ }
+# endif // OLN_DEBUG
+
level_iterator flood(const value& h)
{
level_iterator m;
@@ -203,6 +228,9 @@
point p = hqueue.first(h);
status[p] = get(number_nodes, h, 0u);
+# ifdef OLN_DEBUG
+ update_status(std::cerr);
+# endif // OLN_DEBUG
oln_neighb_type(Nbh) q(nbh, p);
for_all(q)
--- 10.270/olena/oln/lrde/ufmt/generic_simplified_salembier.hh Wed, 03 Jan 2007 15:17:57 +0100 levill_r (oln/y/14_generic_si 1.1 644)
+++ 10.271/olena/oln/lrde/ufmt/generic_simplified_salembier.hh Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/y/14_generic_si 1.2 644)
@@ -251,6 +251,9 @@
std::map<point, point, point_less<I, point> > father;
+# ifdef OLN_DEBUG
+ unsigned npoints;
+# endif // OLN_DEBUG
generic_simplified_salembier(const abstract::image<I>& f,
const oln_neighborhood_type(I)& nbh) :
@@ -261,6 +264,9 @@
pset(point_less<I, point>(f.exact())),
sites(point_greater<I, point>(f.exact())),
father(point_less<I, point>(f.exact()))
+# ifdef OLN_DEBUG
+ , npoints(f.npoints())
+# endif // OLN_DEBUG
{
}
@@ -306,6 +312,26 @@
// // --------------------------------------------------- DEBUG --
}
+# ifdef OLN_DEBUG
+ void update_status (std::ostream& ostr)
+ {
+ static unsigned nupdates = 0;
+ static const unsigned step = 1;
+ static unsigned next_step = step;
+ ++nupdates;
+ unsigned percent = nupdates * 100 / npoints;
+ if (percent >= next_step)
+ {
+ // Print.
+ std::cerr << percent << "% points processed" << std::endl;
+ // Increase the next step.
+ while (percent >= next_step)
+ next_step += step;
+ }
+ }
+# endif // OLN_DEBUG
+
+
// H is a point here, not a level!
// FIXME: Change the name of this argument, as it's confusing.
site_iterator flood(const point& h)
@@ -343,6 +369,9 @@
pset.erase(i);
status[p] = true;
+#ifdef OLN_DEBUG
+ update_status(std::cerr);
+#endif // OLN_DEBUG
// // -- DEBUG -----------------------------------------------
// std::cerr << " status = " << std::endl;
Index: 10.270/oln.prj
--- 10.270/oln.prj
+++ 10.271/oln.prj
@@ -1,47 +1,46 @@
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Olena")
-(Project-Version oln 10 270)
-(Parent-Version oln 10 269)
-(Version-Log "2007-01-03 Roland Levillain <roland(a)lrde.epita.fr>
+(Project-Version oln 10 271)
+(Parent-Version oln 10 270)
+(Version-Log "2007-02-08 Roland Levillain <roland(a)lrde.epita.fr>
- New versions of Salembier et al. algorithm.
+ Add new binaries for Salembier et al. algorithm.
* oln/lrde/ufmt/generic_salembier.hh
- (oln::lrde::ufmt::generic_salembier): Add a second template
- parameter, defaulting to std::greater< oln_value_type(I) >. Use
- this parameter for comparisons, to have the algorithm be more
- flexible.
- * oln/lrde/ufmt/bin/generic_salembier_float2.cc: New.
- Use the second template parameter of
- oln::lrde::ufmt::generic_salembier to create a more flexible
- version of generic_salembier_float where float comparisons are
- performed using a maxium relative error and a maximum absolute
- error.
- * oln/lrde/ufmt/generic_simplified_salembier.hh: New.
- A simplified version of oln::lrde::ufmt::generic_salembier,
- specially useful on float images.
- * oln/lrde/ufmt/bin/generic_simplified_salembier_float.cc: New.
- * oln/lrde/ufmt/naive_generic_salembier.hh: New.
- A previous attempt before generic_simplified_salembier.
- * oln/lrde/ufmt/basic_salembier.hh: More documentation.
- * oln/lrde/ufmt/bin/basic_najman.cc: Typo.
- * oln/lrde/ufmt/README: Document Salembier et al. algorithm variants.
+ (generic_salembier::npoints) [DEBUG]: New attribute.
+ (generic_salembier::generic_salembier) [DEBUG]: Initialize it.
+ (generic_salembier::update_status) [DEBUG]: New function.
+ (generic_salembier::flood) [DEBUG]: Use it.
+ * oln/lrde/ufmt/generic_simplified_salembier.hh
+ (generic_simplified_salembier::npoints) [DEBUG]: New attribute.
+ (generic_simplified_salembier::generic_simplified_salembier)
+ [DEBUG]: Initialize it.
+ (generic_simplified_salembier::update_status) [DEBUG]: New
+ function.
+ (generic_simplified_salembier::flood) [DEBUG]: Use it.
+ * oln/lrde/ufmt/bin/basic_salembier_float_via_16b.cc,
+ * oln/lrde/ufmt/bin/generic_salembier_float_via_16b.cc: New.
* oln/lrde/ufmt/bin/Makefile.am (check_PROGRAMS): Add
- generic_salembier_float2, generic_simplified_salembier_float
- and naive_generic_salembier_float.
- (generic_salembier_float2_SOURCES)
- (generic_salembier_float2_LDFLAGS)
- (generic_simplified_salembier_float_SOURCES)
- (generic_simplified_salembier_float_LDFLAGS)
- (naive_generic_salembier_float_SOURCES)
- (naive_generic_salembier_float_LDFLAGS): New.
- * oln/lrde/ufmt/Makefile.am (noinst_HEADERS): Add
- generic_simplified_salembier.hh and naive_generic_salembier.hh.
+ basic_salembier_float_via_16b and generic_salembier_float_via_16b.
+ (basic_salembier_float_via_16b_SOURCES)
+ (basic_salembier_float_via_16b_LDFLAGS)
+ (generic_salembier_float_via_16b_SOURCES)
+ (generic_salembier_float_via_16b_LDFLAGS): New.
+ * oln/lrde/ufmt/README: Typo.
+
+
+ New tool: pfm-crop.
+
+ * oln/lrde/efigi/misc.hh (crop): New function.
+ * oln/lrde/efigi/req.hh (equalize_16): New function.
+ * oln/lrde/efigi/pfm-crop.cc: New.
+ * oln/lrde/efigi/Makefile.am (check_PROGRAMS): Add pfm-crop.
+ (pfm_crop_SOURCES): New.
")
(New-Version-Log "")
-(Checkin-Time "Wed, 03 Jan 2007 15:17:57 +0100")
+(Checkin-Time "Thu, 08 Feb 2007 12:40:28 +0100")
(Checkin-Login levill_r)
;; diff-ignore tests/data/.*pbm$
;; diff-ignore .*\.pbm$
@@ -154,11 +153,11 @@
(Project-Keywords)
(Files
- (ChangeLog (oln/o/33_ChangeLog 1.37.1.16.1.17.1.19.1.30 600))
+ (ChangeLog (oln/o/33_ChangeLog 1.37.1.16.1.17.1.19.1.31 600))
(doc/ChangeLog (oln/o/31_ChangeLog 1.38.1.7.1.5.1.14.1.17 600))
(integre/ChangeLog (oln/q/35_ChangeLog 1.12.1.2.1.51 600))
(metalic/ChangeLog (oln/q/30_ChangeLog 1.3.1.44 600))
- (olena/ChangeLog (oln/o/30_ChangeLog 1.27.1.36.1.3.1.11.1.5.1.64.1.47.1.93.1.27.2.18.1.9 600))
+ (olena/ChangeLog (oln/o/30_ChangeLog 1.27.1.36.1.3.1.11.1.5.1.64.1.47.1.93.1.27.2.18.1.10 600))
(tools/ChangeLog (oln/o/32_Index: 10.270/ChangeLog
Index: 10.270/olena/ChangeLog
ChangeLog 1.10.1.17 600))
(tools/swilena/ChangeLog (oln/n/37_ChangeLog 1.7.1.52 600))
@@ -170,7 +169,7 @@
(cleanup.sh (oln/o/29_cleanup.sh 1.6 700))
- (configure.ac (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.11 600))
+ (configure.ac (oln/3_configure. 1.47.1.1.1.1.1.4.1.15.1.16.1.12 600))
(doc/demo/image.cc (oln/d/46_image.cc 1.8 600))
(doc/demo/Makefile.am (oln/d/44_Makefile.a 1.16.1.2 600))
@@ -1594,7 +1593,7 @@
- (olena/oln/lrde/ufmt/README (oln/x/22_README 1.7 644))
+ (olena/oln/lrde/ufmt/README (oln/x/22_README 1.8 644))
;; Files deleted by depopulate at Fri, 04 Aug 2006 18:41:16 +0200,
;; from version 10.245(w), by theo:
@@ -1613,7 +1612,7 @@
(olena/oln/lrde/ufmt/Makefile.am (oln/x/26_Makefile.a 1.6 644))
(olena/oln/lrde/ufmt/fiorio-1.hh (oln/x/27_fiorio-1.h 1.3 644))
(olena/oln/lrde/ufmt/fiorio-2.hh (oln/x/28_fiorio-2.h 1.3 644))
- (olena/oln/lrde/ufmt/bin/Makefile.am (oln/x/29_Makefile.a 1.5 644))
+ (olena/oln/lrde/ufmt/bin/Makefile.am (oln/x/29_Makefile.a 1.6 644))
(olena/oln/lrde/ufmt/bin/fiorio.cc (oln/x/30_fiorio.cc 1.3 644))
;; Files added by populate at Mon, 28 Aug 2006 10:51:36 +0200,
;; to version 10.249(w), by theo:
@@ -1660,9 +1659,9 @@
;; to version 10.255(w), by theo:
(olena/oln/lrde/efigi/pfm2pgm.cc (oln/x/49_pfm2pgm.cc 1.1 644))
- (olena/oln/lrde/efigi/misc.hh (oln/x/50_misc.hh 1.1 644))
+ (olena/oln/lrde/efigi/misc.hh (oln/x/50_misc.hh 1.2 644))
(olena/oln/lrde/efigi/io.hh (oln/x/51_io.hh 1.1 644))
- (olena/oln/lrde/efigi/req.hh (oln/y/0_req.hh 1.1 644))
+ (olena/oln/lrde/efigi/req.hh (oln/y/0_req.hh 1.2 644))
(olena/oln/lrde/efigi/wst.cc (oln/y/1_wst.cc 1.1 644))
(olena/oln/lrde/efigi/gaussian.cc (oln/y/2_gaussian.c 1.1 644))
(olena/oln/lrde/efigi/pgm2pfm.cc (oln/y/3_pgm2pfm.cc 1.1 644))
@@ -1676,9 +1675,9 @@
;; to version 10.268(w), by levill_r:
(olena/oln/lrde/efigi/pgm2pfm_wo_noise.cc (oln/y/5_pgm2pfm_wo 1.1 644))
- (olena/oln/lrde/efigi/Makefile.am (oln/y/6_Makefile.a 1.1 644))
+ (olena/oln/lrde/efigi/Makefile.am (oln/y/6_Makefile.a 1.2 644))
(olena/oln/lrde/ufmt/naive_generic_salembier.hh (oln/y/7_naive_gene 1.2 644))
- (olena/oln/lrde/ufmt/generic_salembier.hh (oln/y/8_generic_sa 1.2 644))
+ (olena/oln/lrde/ufmt/generic_salembier.hh (oln/y/8_generic_sa 1.3 644))
(olena/oln/lrde/ufmt/bin/generic_salembier_int_u8.cc (oln/y/9_generic_sa 1.1 644))
(olena/oln/lrde/ufmt/bin/generic_salembier_float.cc (oln/y/10_generic_sa 1.1 644))
@@ -1688,7 +1687,14 @@
(olena/oln/lrde/ufmt/bin/generic_salembier_float2.cc (oln/y/11_generic_sa 1.1 644))
(olena/oln/lrde/ufmt/bin/generic_simplified_salembier_float.cc (oln/y/12_generic_si 1.1 644))
(olena/oln/lrde/ufmt/bin/naive_generic_salembier_float.cc (oln/y/13_naive_gene 1.1 644))
- (olena/oln/lrde/ufmt/generic_simplified_salembier.hh (oln/y/14_generic_si 1.1 644))
+ (olena/oln/lrde/ufmt/generic_simplified_salembier.hh (oln/y/14_generic_si 1.2 644))
+
+;; Files added by populate at Thu, 08 Feb 2007 12:31:43 +0100,
+;; to version 10.270(w), by levill_r:
+
+ (olena/oln/lrde/efigi/pfm-crop.cc (oln/y/15_pfm-crop.c 1.1 644))
+ (olena/oln/lrde/ufmt/bin/basic_salembier_float_via_16b.cc (oln/y/16_basic_sale 1.1 644))
+ (olena/oln/lrde/ufmt/bin/generic_salembier_float_via_16b.cc (oln/y/17_generic_sa 1.1 644))
)
(Merge-Parents)
(New-Merge-Parents)
--- 10.270/ChangeLog Wed, 20 Dec 2006 14:46:12 +0100 levill_r (oln/o/33_ChangeLog 1.37.1.16.1.17.1.19.1.30 600)
+++ 10.271/ChangeLog Thu, 08 Feb 2007 12:40:28 +0100 levill_r (oln/o/33_ChangeLog 1.37.1.16.1.17.1.19.1.31 600)
@@ -1,3 +1,7 @@
+2007-02-08 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * configure.ac: Typos.
+
2006-12-20 Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac (olena/oln/lrde/efigi/Makefile): Configure it.
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/static
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix mini-oln.
* samples/mini-oln/mini-oln.cc: Remove useless forward
declarations.
s/mlc::undefined/stc::abstract/
Aesthetic changes.
(oln::Image_with_neighborhood): New abstraction.
(oln::point3d): Fix base class.
(oln::image_with_nbh): Remove (useless).
(oln::niter2d, oln::neighborhood2d): New.
(oln::set_super_type< image_morpher<E> >, oln::image_morpher<E>):
Fix base class.
(oln::image_morpher<E>::delegatee_t): Query the virtual type from
the exact type.
(oln::set_super_type< plus<I, N> >): Fix base class.
(oln::vtypes< plus<I, N> >::nbh_type)
(oln::vtypes< plus<I, N> >::niter_type): New vtypes.
(oln::plus::plus): Call the ctor of the base class.
(oln::plus::impl_nbh): New.
(main): New tests.
mini-oln.cc | 226 +++++++++++++++++++++++++++++-------------------------------
1 file changed, 111 insertions(+), 115 deletions(-)
Index: samples/mini-oln/mini-oln.cc
--- samples/mini-oln/mini-oln.cc (revision 738)
+++ samples/mini-oln/mini-oln.cc (working copy)
@@ -35,6 +35,10 @@
#include <stc/scoop.hh>
+/*-------------.
+| Equipement. |
+`-------------*/
+
// Helper macros.
#define oln_type_of_(FromType, Alias) \
find_vtype<FromType, oln::typedef_:: Alias##_type>::ret
@@ -46,59 +50,49 @@
stc_scoop_equipment_for_namespace(oln);
mlc_case_equipment_for_namespace(oln);
-
-
-/*-------------.
- | Mini-Olena. |
- `-------------*/
-
-// -------------------- //
-// Vtypes declaration. //
-// -------------------- //
-
+// Virtual types declaration.
namespace oln
{
mlc_decl_typedef(point_type);
-
mlc_decl_typedef(iter_type);
mlc_decl_typedef(value_type);
- mlc_decl_typedef(niter_type);
mlc_decl_typedef(nbh_type);
+ mlc_decl_typedef(niter_type);
}
+
// --------------------- //
// Forward declarations. //
// --------------------- //
+// FIXME: Remove.
namespace oln
{
struct point2d;
struct point3d;
}
+
+/*---------------.
+| Abstractions. |
+`---------------*/
+
+namespace oln
+{
// ------- //
// Point. //
// ------- //
-namespace oln
-{
template <typename E>
struct Point : public stc::any<E>
{
};
-}
-
// ---------- //
// Iterator. //
// ---------- //
-namespace oln
-{
- template <typename E>
- struct Iterator;
-
template <typename E>
struct Iterator : public stc::any<E>
{
@@ -125,18 +119,12 @@
return this->exact().impl_op_point_type();
}
};
-}
// ------- //
// Image. //
// ------- //
-namespace oln
-{
- template <typename E>
- struct Image;
-
template <typename E>
struct Image : public stc::any<E>
{
@@ -153,15 +141,12 @@
return this->exact().impl_has(p);
}
};
-}
// --------- //
// Image2d. //
// --------- //
-namespace oln
-{
template <typename E>
struct Image2d : public Image<E>
{
@@ -184,15 +169,12 @@
return this->exact().impl_ncols_get();
}
};
-}
-// ---------- //
+ // --------- //
// Image 3d. //
-// ---------- //
+ // --------- //
-namespace oln
-{
template <typename E>
struct Image3d : public Image<E>
{
@@ -220,17 +202,44 @@
return this->exact().impl_nslis_get();
}
};
+
+
+ // ------------------------- //
+ // Image_with_neighborhood. //
+ // ------------------------- //
+
+ template <typename E>
+ struct Image_with_neighborhood : public Image<E>
+ {
+ typedef oln_type_of(E, nbh) nbh_t;
+
+ // FIXME: Implement.
+ nbh_t nbh() const
+ {
+ return this->exact().impl_nbh();
}
+ };
+} // End of namespace oln.
+
+/*---------.
+| Bridge. |
+`---------*/
+
+namespace oln
+{
// -------- //
// Switch. //
// -------- //
-namespace oln
-{
+ // Tag.
struct switch_image_base;
+ // Forward declarations.
+ struct point2d;
+ struct point3d;
+
template <typename E>
struct case_<switch_image_base, E, 1> :
public mlc::where_ < mlc::eq_ <oln_type_of(E, point), point2d> >
@@ -250,15 +259,12 @@
{
typedef Image<E> ret;
};
-}
// ------------ //
// Image base. //
// ------------ //
-namespace oln
-{
template <typename E>
struct image_base;
@@ -271,12 +277,12 @@
template <typename E>
struct vtypes< image_base<E> >
{
- typedef mlc::undefined point_type;
- typedef mlc::undefined iter_type;
- typedef mlc::undefined value_type;
+ typedef stc::abstract point_type;
+ typedef stc::abstract iter_type;
+ typedef stc::abstract value_type;
- typedef mlc::undefined niter_type;
- typedef mlc::undefined nbh_type;
+ typedef mlc::none niter_type;
+ typedef mlc::none nbh_type;
};
template <typename E>
@@ -286,35 +292,38 @@
{
}
};
-}
+} // End of namespace oln.
-// ------- //
-// points. //
-// ------- //
+/*------------------.
+| Implementations. |
+`------------------*/
namespace oln
{
+ // -------- //
+ // Points. //
+ // -------- //
+
struct point2d : public Point<point2d>
{
int row;
int col;
};
- struct point3d : public Point<point2d>
+ struct point3d : public Point<point3d>
{
int row;
int col;
int sli;
};
-}
+
// ------------ //
-// iterator2d. //
+ // Iterator2d. //
// ------------ //
-namespace oln
-{
+ // Forward declarations.
struct iterator2d;
template <typename T>
@@ -375,15 +384,12 @@
int ncols;
point_t p;
};
-}
-// --------- //
-// image2d. //
-// --------- //
+ // ---------- //
+ // Image 2d. //
+ // ---------- //
-namespace oln
-{
template <typename T>
struct image2d;
@@ -442,66 +448,43 @@
int nrows;
int ncols;
};
-}
-
-// ---------------- //
-// image_with_nbh. //
-// ---------------- //
-namespace oln
-{
- struct image_with_nbh;
+ // ----------------- //
+ // Neighborhood 2d. //
+ // ----------------- //
- template<>
- struct set_super_type<image_with_nbh>
- {
- typedef image_base<image_with_nbh> ret;
- };
+ struct niter2d {};
- template <>
- struct vtypes<image_with_nbh>
+ struct neighborhood2d
{
- typedef mlc::undefined niter_type;
- typedef mlc::undefined nbh_type;
+ typedef niter2d niter_type;
};
- struct image_with_nbh : public image_base< image_with_nbh >
- {
- typedef oln_type_of_(image_with_nbh, nbh) niter_t;
- typedef oln_type_of_(image_with_nbh, niter) nbh_t;
-
- image_with_nbh()
- {
- }
- };
-}
// --------------- //
-// image_morpher. //
+ // Image morpher. //
// --------------- //
-namespace oln
-{
template <typename E>
struct image_morpher;
template<typename E>
struct set_super_type< image_morpher<E> >
{
- typedef image_base< image_morpher<E> > ret;
+ typedef image_base<E> ret;
};
template <typename E>
struct vtypes< image_morpher<E> >
{
- typedef mlc::undefined delegatee_type;
+ typedef stc::abstract delegatee_type;
};
template <typename E>
- struct image_morpher : public image_base< image_morpher<E> >
+ struct image_morpher : public image_base<E>
{
- typedef oln_type_of(image_morpher, delegatee) delegatee_t;
+ typedef oln_type_of(E, delegatee) delegatee_t;
image_morpher(delegatee_t& ref_ima) :
ref_ima (ref_ima)
@@ -515,20 +498,17 @@
protected:
delegatee_t& ref_ima;
};
-}
-// ------ //
-// plus. //
-// ------ //
+ // ------------------------- //
+ // Image with neighborhood. //
+ // ------------------------- //
-namespace oln
-{
template <typename I, typename N>
struct plus;
template <typename I, typename N>
- struct set_super_type< image_morpher<plus<I, N> > >
+ struct set_super_type< plus<I, N> >
{
typedef image_morpher< plus <I, N> > ret;
};
@@ -537,29 +517,43 @@
struct vtypes< plus<I, N> >
{
typedef I delegatee_type;
+ typedef N nbh_type;
+ // For the sake of simplicity, the niter type is obtained directly
+ // from the neighborhood type itself (without using a virtual
+ // type).
+ typedef typename N::niter_type niter_type;
};
template <typename I, typename N>
struct plus : public image_morpher<plus<I, N> >
{
+ typedef plus<I, N> self_t;
+ typedef image_morpher< self_t > super_t;
+
plus(I& ima, N& nbh) :
+ super_t (ima),
nbh (nbh)
{
}
+ N impl_nbh() const
+ {
+ return nbh;
+ }
+
protected:
N& nbh;
};
- // Helper.
+ /// Helper.
template <typename I, typename N>
plus<I, N> operator+(I& lhs, N& rhs)
{
plus<I, N> res(lhs, rhs);
return res;
}
-}
+} // End of namespace oln.
/*--------------.
@@ -570,22 +564,24 @@
{
using namespace oln;
- typedef plus<image2d<int>, image_with_nbh> my_ima;
-
- point2d p2d;
- point3d p3d;
-
- image2d<int> ima(10, 10);
- image_with_nbh ima_nb;
-
- iterator2d it2d(ima);
-
- // my_ima p = ima + ima_nb;
-}
+ point2d p;
+ typedef image2d<int> ima_t;
+ ima_t ima1(10, 10);
+ iterator2d it(ima1);
+ typedef neighborhood2d nbh_t;
+ // A type of image with neighborhood2d.
+ typedef plus<ima_t, nbh_t> ima_wih_nbh_t;
+ neighborhood2d nbh;
+ ima_wih_nbh_t ima2(ima1, nbh);
+ // Another way to build an image with neigborhood.
+ ima_wih_nbh_t ima3 = ima1 + nbh;
+ point3d q;
+ // ...
+}
1
0
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
URL: https://svn.lrde.epita.fr/svn/oln/trunk/static
ChangeLog:
2007-02-06 Thomas Moulard <thomas.moulard(a)lrde.epita.fr>
Fix misc mistakes.
* samples/mini-oln/README: Add newline.
* samples/mini-oln/mini-oln.cc: Fix misc mistakes
(name resolution, SCOOP paradigm, typo).
mini-oln.cc | 317 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 159 insertions(+), 158 deletions(-)
Index: samples/mini-oln/mini-oln.cc
===================================================================
- --- samples/mini-oln/mini-oln.cc (revision 737)
+++ samples/mini-oln/mini-oln.cc (working copy)
@@ -37,7 +37,7 @@
// Helper macros.
#define oln_type_of_(FromType, Alias) \
- - oln::find_vtype<FromType, oln::typedef_:: Alias##_type>::ret
+ find_vtype<FromType, oln::typedef_:: Alias##_type>::ret
#define oln_type_of(FromType, Alias) \
typename oln_type_of_(FromType, Alias)
@@ -67,6 +67,16 @@
mlc_decl_typedef(nbh_type);
}
+// --------------------- //
+// Forward declarations. //
+// --------------------- //
+
+namespace oln
+{
+ struct point2d;
+ struct point3d;
+}
+
// ------- //
// Point. //
// ------- //
@@ -77,19 +87,6 @@
struct Point : public stc::any<E>
{
};
- -
- - struct point2d : public Point<point2d>
- - {
- - int row;
- - int col;
- - };
- -
- - struct point3d : public Point<point2d>
- - {
- - int row;
- - int col;
- - int sli;
- - };
}
@@ -103,21 +100,9 @@
struct Iterator;
template<typename E>
- - struct set_super_type<Iterator<E> >
- - {
- - typedef mlc::none ret;
- - };
- -
- - template <typename E>
- - struct vtypes<Iterator<E> >
- - {
- - typedef mlc::undefined point_type;
- - };
- -
- - template <typename E>
struct Iterator : public stc::any<E>
{
- - typedef oln_type_of(Iterator, point) point_t;
+ typedef oln_type_of(E, point) point_t;
void start()
{
@@ -132,85 +117,16 @@
bool is_valid() const
{
return this->exact().impl_is_valid();
- - };
+ }
// auto
- - operator point_t()
+ operator point_t() const
{
return this->exact().impl_op_point_type();
}
};
}
- -// ------------ //
- -// iterator2d. //
- -// ------------ //
- -
- -namespace oln
- -{
- - struct iterator2d;
- -
- - template <typename T>
- - struct image2d;
- -
- - template<>
- - struct set_super_type<iterator2d>
- - {
- - typedef Iterator<iterator2d> ret;
- - };
- -
- - template <>
- - struct vtypes<iterator2d>
- - {
- - typedef point2d point_type;
- - };
- -
- - struct iterator2d : public Iterator<iterator2d>
- - {
- - typedef oln_type_of_(iterator2d, point) point_t;
- -
- - template <typename T>
- - iterator2d(image2d<T>& ima) :
- - nrows (ima.nrows_get()),
- - ncols (ima.ncols_get())
- - {
- - }
- -
- - void impl_start()
- - {
- - p.row = 0;
- - p.col = 0;
- - }
- -
- - void impl_next()
- - {
- - p.col = p.col + 1;
- -
- - if (p.col == ncols)
- - {
- - p.col = 0;
- - p.row = p.row + 1;
- - }
- - }
- -
- - bool impl_is_valid() const
- - {
- - return p.row < nrows;
- - }
- -
- - point_t& impl_op_point_t()
- - {
- - return p;
- - }
- -
- - protected:
- - int nrows;
- - int ncols;
- - point_t p;
- - };
- -}
- -
- -
// ------- //
// Image. //
@@ -224,12 +140,15 @@
template <typename E>
struct Image : public stc::any<E>
{
- - typename E::value_t& operator ()(typename E::point_t& p)
+ typedef oln_type_of(E, point) point_t;
+ typedef oln_type_of(E, value) value_t;
+
+ value_t& operator ()(point_t& p)
{
return this->exact().impl_op_paren(p);
}
- - bool has(const typename E::point_t& p) const
+ bool has(const point_t& p) const
{
return this->exact().impl_has(p);
}
@@ -244,10 +163,13 @@
namespace oln
{
template <typename E>
- - struct Image2d : public Image<Image2d<E> >
+ struct Image2d : public Image<E>
{
+ typedef oln_type_of(E, point) point_t;
+ typedef oln_type_of(E, value) value_t;
+
//FIXME: delete?
- - typename E::value_t& operator ()(typename E::point_t& p)
+ value_t& operator ()(point_t& p)
{
return this->exact().impl_op_paren(p);
}
@@ -272,10 +194,13 @@
namespace oln
{
template <typename E>
- - struct Image3d : public Image<Image3d<E> >
+ struct Image3d : public Image<E>
{
+ typedef oln_type_of(E, point) point_t;
+ typedef oln_type_of(E, value) value_t;
+
//FIXME: delete?
- - typename E::value_t& operator ()(typename E::point_t& p)
+ value_t& operator ()(point_t& p)
{
return this->exact().impl_operator_paren(p);
}
@@ -298,25 +223,6 @@
}
- -// ------------------------- //
- -// Image with neighborhood. //
- -// ------------------------- //
- -
- -namespace oln
- -{
- - template <typename E>
- - struct Image_with_nbh : public Image<Image_with_nbh<E> >
- - {
- - // FIXME: Implement.
- -#if 0
- - nbh_t nbh() const
- - {
- - }
- -#endif
- - };
- -}
- -
- -
// -------- //
// Switch. //
// -------- //
@@ -327,14 +233,14 @@
template <typename E>
struct case_<switch_image_base, E, 1> :
- - public mlc::where_ < mlc::eq_ <E, point2d> >
+ public mlc::where_ < mlc::eq_ <oln_type_of(E, point), point2d> >
{
typedef Image2d<E> ret;
};
template <typename E>
struct case_<switch_image_base, E, 2> :
- - public mlc::where_ < mlc::eq_ <E, point3d> >
+ public mlc::where_ < mlc::eq_ <oln_type_of(E, point), point3d> >
{
typedef Image3d<E> ret;
};
@@ -374,7 +280,7 @@
};
template <typename E>
- - struct image_base : public oln::switch_<switch_image_base, E>::ret
+ struct image_base : public switch_<switch_image_base, E>::ret
{
image_base()
{
@@ -383,6 +289,93 @@
}
+// ------- //
+// points. //
+// ------- //
+
+namespace oln
+{
+ struct point2d : public Point<point2d>
+ {
+ int row;
+ int col;
+ };
+
+ struct point3d : public Point<point2d>
+ {
+ int row;
+ int col;
+ int sli;
+ };
+}
+
+// ------------ //
+// iterator2d. //
+// ------------ //
+
+namespace oln
+{
+ struct iterator2d;
+
+ template <typename T>
+ struct image2d;
+
+ template<>
+ struct set_super_type<iterator2d>
+ {
+ typedef mlc::none ret;
+ };
+
+ template <>
+ struct vtypes<iterator2d>
+ {
+ typedef point2d point_type;
+ };
+
+ struct iterator2d : public Iterator<iterator2d>
+ {
+ typedef oln_type_of_(iterator2d, point) point_t;
+
+ template <typename T>
+ iterator2d(image2d<T>& ima) :
+ nrows (ima.nrows_get()),
+ ncols (ima.ncols_get())
+ {
+ }
+
+ void impl_start()
+ {
+ p.row = 0;
+ p.col = 0;
+ }
+
+ void impl_next()
+ {
+ p.col = p.col + 1;
+
+ if (p.col == ncols)
+ {
+ p.col = 0;
+ p.row = p.row + 1;
+ }
+ }
+
+ bool impl_is_valid() const
+ {
+ return p.row < nrows;
+ }
+
+ point_t& impl_op_point_t()
+ {
+ return p;
+ }
+
+ protected:
+ int nrows;
+ int ncols;
+ point_t p;
+ };
+}
// --------- //
@@ -451,37 +444,38 @@
};
}
+
// ---------------- //
// image_with_nbh. //
// ---------------- //
- -// namespace oln
- -// {
- -// struct image_with_nbh;
- -
- -// template<>
- -// struct set_super_type<image_with_nbh>
- -// {
- -// typedef image_base<image_with_nbh> ret;
- -// };
- -
- -// template <>
- -// struct vtypes<image_with_nbh>
- -// {
- -// typedef mlc::undefined niter_type;
- -// typedef mlc::undefined nbh_type;
- -// };
- -
- -// struct image_with_nbh : public image_base< image_with_nbh >
- -// {
- -// typedef oln_type_of_(image_with_nbh, nbh) niter_t;
- -// typedef oln_type_of_(image_with_nbh, niter) nbh_t;
- -
- -// image_with_nbh()
- -// {
- -// }
- -// };
- -// }
+namespace oln
+{
+ struct image_with_nbh;
+
+ template<>
+ struct set_super_type<image_with_nbh>
+ {
+ typedef image_base<image_with_nbh> ret;
+ };
+
+ template <>
+ struct vtypes<image_with_nbh>
+ {
+ typedef mlc::undefined niter_type;
+ typedef mlc::undefined nbh_type;
+ };
+
+ struct image_with_nbh : public image_base< image_with_nbh >
+ {
+ typedef oln_type_of_(image_with_nbh, nbh) niter_t;
+ typedef oln_type_of_(image_with_nbh, niter) nbh_t;
+
+ image_with_nbh()
+ {
+ }
+ };
+}
// --------------- //
// image_morpher. //
@@ -501,7 +495,7 @@
template <typename E>
struct vtypes< image_morpher<E> >
{
- - typedef mlc::undefined delegatee_t;
+ typedef mlc::undefined delegatee_type;
};
template <typename E>
@@ -542,7 +536,7 @@
template <typename I, typename N>
struct vtypes< plus<I, N> >
{
- - typedef I delegatee_t;
+ typedef I delegatee_type;
};
template <typename I, typename N>
@@ -576,15 +570,22 @@
{
using namespace oln;
- - // typedef plus<image2d<int>, image_with_nbh> my_ima;
+ typedef plus<image2d<int>, image_with_nbh> my_ima;
point2d p2d;
point3d p3d;
image2d<int> ima(10, 10);
- - // image_with_nbh ima_nb;
+ image_with_nbh ima_nb;
- - // iterator2d it2d(ima);
+ iterator2d it2d(ima);
// my_ima p = ima + ima_nb;
}
+
+
+
+
+
+
+
Index: samples/mini-oln/README
===================================================================
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFFyLHI8QvmnUS5oeMRAvUsAJ9n2jayVaSkvCIuz6QSn8Jbr82xsgCgxR0N
6Ol1duxlimW9tTr+exX1irM=
=AGFT
-----END PGP SIGNATURE-----
1
0
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
URL: https://svn.lrde.epita.fr/svn/oln/trunk/static
ChangeLog:
2007-01-26 Thomas Moulard <thomas.moulard(a)lrde.epita.fr>
Add mini-oln.
* samples/mini-oln/README: Add mini-oln. New.
* samples/mini-oln/mini-oln.cc: Idem. New.
* samples/mini-oln: Idem. New.
* samples: Idem. New.
README | 1
mini-oln.cc | 539 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 540 insertions(+)
Index: samples/mini-oln/mini-oln.cc
===================================================================
- --- samples/mini-oln/mini-oln.cc (revision 0)
+++ samples/mini-oln/mini-oln.cc (revision 0)
@@ -0,0 +1,539 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+#include <vector>
+
+#include <mlc/case.hh>
+#include <stc/any.hh>
+#include <stc/scoop.hh>
+
+
+// Helper macros.
+#define oln_type_of_(FromType, Alias) \
+ oln::find_vtype<FromType, oln::typedef_:: Alias##_type>::ret
+
+#define oln_type_of(FromType, Alias) \
+ typename oln_type_of_(FromType, Alias)
+
+// Add equipment
+stc_scoop_equipment_for_namespace(oln);
+mlc_case_equipment_for_namespace(oln);
+
+
+// Point
+template <typename E>
+struct Point : public stc::any<E>
+{
+};
+
+struct point2d : public Point<point2d>
+{
+ int row;
+ int col;
+};
+
+struct point3d : public Point<point2d>
+{
+ int row;
+ int col;
+ int sli;
+};
+
+// Iterator
+template <typename E>
+struct Iterator;
+
+namespace oln
+{
+ mlc_decl_typedef(point_type);
+
+ template <typename E>
+ struct vtypes<Iterator<E> >
+ {
+ typedef mlc::undefined point_type;
+ };
+};
+
+template <typename E>
+struct Iterator : public stc::any<E>
+{
+ typedef oln_type_of(Iterator, point) point_t;
+
+ void start()
+ {
+ this->exact().start();
+ }
+
+ void next()
+ {
+ this->exact().next();
+ }
+
+ bool is_valid() const
+ {
+ this->exact().is_valid();
+ };
+
+ // auto
+ operator point_t()
+ {
+ return this->exact().operator point_t();
+ }
+};
+
+// Image
+template <typename E>
+struct Image;
+
+namespace oln
+{
+ mlc_decl_typedef(iter_type);
+ mlc_decl_typedef(value_type);
+
+ template <typename E>
+ struct vtypes<Image<E> >
+ {
+ typedef mlc::undefined point_type;
+ typedef mlc::undefined iter_type;
+ typedef mlc::undefined value_type;
+ };
+};
+
+template <typename E>
+struct Image : public stc::any<E>
+{
+ typedef oln_type_of(Image, point) point_t;
+ typedef oln_type_of(Image, iter) iter_t;
+ typedef oln_type_of(Image, value) value_t;
+
+ value_t& operator ()(point_t& p)
+ {
+ return this->exact().operator ()(p);
+ }
+
+ bool has(const point_t& p) const
+ {
+ this->exact().has(p);
+ }
+
+};
+
+namespace oln
+{
+ struct Image2d;
+
+ template<>
+ struct set_super_type<Image2d>
+ {
+ typedef Image<Image2d> ret;
+ };
+};
+
+struct Image2d : public Image<Image2d>
+{
+ typedef oln_type_of_(Image2d, point) point_t;
+ typedef oln_type_of_(Image2d, iter) iter_t;
+ typedef oln_type_of_(Image2d, value) value_t;
+
+ value_t& operator ()(point_t& p)
+ {
+ return this->exact().operator ()(p);
+ }
+
+ int nrows_get() const
+ {
+ this->exact().nrows_get();
+ }
+
+ int ncols_get() const
+ {
+ this->exact().ncols_get();
+ }
+};
+
+namespace oln
+{
+ struct Image3d;
+
+ template<>
+ struct set_super_type<Image3d>
+ {
+ typedef Image<Image3d> ret;
+ };
+};
+
+struct Image3d : public Image<Image3d>
+{
+ typedef oln_type_of_(Image3d, point) point_t;
+ typedef oln_type_of_(Image3d, iter) iter_t;
+ typedef oln_type_of_(Image3d, value) value_t;
+
+ value_t& operator ()(point_t& p)
+ {
+ return this->exact().operator ()(p);
+ }
+
+ int nrows_get() const
+ {
+ this->exact().nrows_get();
+ }
+
+ int ncols_get() const
+ {
+ this->exact().ncols_get();
+ }
+
+ int nslis_get() const
+ {
+ this->exact().nslis_get();
+ }
+};
+
+// Image with neighborhood
+struct image_with_nbh;
+
+namespace oln
+{
+ mlc_decl_typedef(niter_type);
+ mlc_decl_typedef(nbh_type);
+
+ template<>
+ struct set_super_type<image_with_nbh>
+ {
+ typedef Image<image_with_nbh> ret;
+ };
+
+ template <>
+ struct vtypes<image_with_nbh>
+ {
+ typedef mlc::undefined niter_type;
+ typedef mlc::undefined nbh_type;
+ };
+};
+
+struct image_with_nbh : public Image<image_with_nbh>
+{
+ typedef oln_type_of_(image_with_nbh, niter) niter_t;
+ typedef oln_type_of_(image_with_nbh, nbh) nbh_t;
+
+ nbh_t nbh() const
+ {
+ //FIXME
+ }
+};
+
+// Switch
+struct switch_image_base;
+
+namespace oln
+{
+ namespace error
+ {
+ struct ERROR_image_base;
+ };
+
+ template <typename I>
+ struct case_<switch_image_base, I, 1> : public mlc::where_ < mlc::eq_ <I, point2d> >
+ {
+ typedef Image2d ret;
+ };
+
+ template <typename I>
+ struct case_<switch_image_base, I, 2> : public mlc::where_ < mlc::eq_ <I, point3d> >
+ {
+ typedef Image3d ret;
+ };
+
+ template <typename I>
+ struct default_case_<switch_image_base, I>
+ {
+ typedef mlc::undefined ret;
+ };
+};
+
+
+
+
+// Image base
+template <typename E>
+struct image_base;
+
+namespace oln
+{
+ template<typename E>
+ struct set_super_type<image_base<E> >
+ {
+ typedef typename oln::switch_<switch_image_base, E>::ret ret;
+ };
+
+ template <typename E>
+ struct vtypes<image_base<E> >
+ {
+ typedef mlc::undefined point_type;
+ typedef mlc::undefined iter_type;
+ typedef mlc::undefined value_type;
+ };
+};
+
+template <typename E>
+struct image_base : public oln::switch_<switch_image_base, E>::ret
+{
+ typedef oln_type_of(image_base, point) point_t;
+ typedef oln_type_of(image_base, iter) iter_t;
+ typedef oln_type_of(image_base, value) value_t;
+
+ value_t& operator ()(point_t& p)
+ {
+ return this->exact().operator ()(p);
+ }
+
+ bool has(const point_t& p) const
+ {
+ this->exact().has(p);
+ }
+};
+
+// Iterator 2d
+struct iterator2d;
+
+template <typename T>
+struct image2d;
+
+namespace oln
+{
+ template<>
+ struct set_super_type<iterator2d>
+ {
+ typedef Iterator<iterator2d> ret;
+ };
+
+ template <>
+ struct vtypes<iterator2d>
+ {
+ typedef point2d point_type;
+ };
+};
+
+struct iterator2d : public Iterator<iterator2d>
+{
+ typedef oln_type_of_(iterator2d, point) point_t;
+
+ template <typename T>
+ iterator2d(image2d<T>& ima) :
+ nrows (ima.nrows_get()),
+ ncols (ima.ncols_get())
+ {
+ }
+
+ void start()
+ {
+ p.row = 0;
+ p.col = 0;
+ }
+
+ void next()
+ {
+ p.col = p.col + 1;
+
+ if (p.col == ncols)
+ {
+ p.col = 0;
+ p.row = p.row + 1;
+ }
+ }
+
+ bool is_valid() const
+ {
+ return p.row < nrows;
+ }
+
+ operator point_t()
+ {
+ return p;
+ }
+
+protected:
+ int nrows;
+ int ncols;
+ point_t p;
+};
+
+// image2d
+template <typename T>
+struct image2d;
+
+namespace oln
+{
+ template<typename T>
+ struct set_super_type<image2d<T> >
+ {
+ typedef image_base<image2d<T> > ret;
+ };
+
+ template <typename T>
+ struct vtypes<image2d<T> >
+ {
+ typedef point2d point_t;
+ typedef iterator2d iter_t;
+ typedef T value_t;
+ };
+};
+
+template <typename T>
+struct image2d : public image_base<image2d<T> >
+{
+ typedef oln_type_of(image2d, point) point_t;
+ typedef oln_type_of(image2d, iter) iter_t;
+ typedef oln_type_of(image2d, value) value_t;
+
+ image2d(int nrows, int ncols) :
+ data (0),
+ nrows (nrows),
+ ncols (ncols)
+ {
+ data = new std::vector<value_t>;
+ }
+
+ value_t& operator()(const point_t& p)
+ {
+ return this->data[p.row * nrows + p.col];
+ }
+
+ int nrows_get() const
+ {
+ return nrows;
+ }
+
+ int ncols_get() const
+ {
+ return ncols;
+ }
+
+ bool has(point_t& p)
+ {
+ assert(!!data);
+ return p.row >= 0 && p.row < nrows && p.col >= 0 && p.col < ncols;
+ }
+
+protected:
+ std::vector<value_t>* data;
+ int nrows;
+ int ncols;
+};
+
+// image_morpher
+template <typename E>
+struct image_morpher;
+
+namespace oln
+{
+ template<typename E>
+ struct set_super_type<image_morpher<E> >
+ {
+ typedef image_base<image_morpher<E> > ret;
+ };
+
+ template <typename E>
+ struct vtypes<image_morpher<E> >
+ {
+ typedef mlc::undefined delegatee_t;
+ };
+};
+
+template <typename E>
+struct image_morpher : public image_base<image_morpher<E> >
+{
+ typedef oln_type_of(image_morpher, delegatee) delegatee_t;
+
+ image_morpher(delegatee_t& ref_ima) :
+ ref_ima (ref_ima)
+ {
+ }
+
+ delegatee_t& ref ()
+ {
+ return ref_ima;
+ }
+protected:
+ delegatee_t& ref_ima;
+};
+
+//image_plus_neighborhood
+template <typename I, typename N>
+struct plus;
+
+namespace oln
+{
+ template <typename I, typename N>
+ struct set_super_type<image_morpher<plus<I, N> > >
+ {
+ typedef image_morpher<plus <I, N> > ret;
+ };
+
+ template <typename I, typename N>
+ struct vtypes<plus<I, N> >
+ {
+ typedef I delegatee_t;
+ };
+};
+
+template <typename I, typename N>
+struct plus : public image_morpher<plus<I, N> >
+{
+ plus(I& ima, N& nbh) :
+ nbh (nbh)
+ {
+ }
+
+protected:
+ N& nbh;
+};
+
+template <typename I, typename N>
+plus<I, N> operator +(I& lhs, N& rhs)
+{
+ plus<I, N> res(lhs, rhs);
+ return res;
+}
+
+
+
+int main()
+{
+ typedef plus<image2d<int>, image_with_nbh> my_ima;
+
+ point2d p2d;
+ point3d p3d;
+
+ image2d<int> ima(10, 10);
+ image_with_nbh ima_nb;
+
+ iterator2d it2d(ima);
+
+ //my_ima p = ima + ima_nb;
+}
+
Index: samples/mini-oln/README
===================================================================
- --- samples/mini-oln/README (revision 0)
+++ samples/mini-oln/README (revision 0)
@@ -0,0 +1 @@
+FIXME
\ No newline at end of file
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFFui+58QvmnUS5oeMRAqExAJ0YPJPC3maAOi+LM/Qq8Ee86b1I8ACeLpnE
pI+i4X30a0sH6KZHEBQOokw=
=8KbQ
-----END PGP SIGNATURE-----
2
2
On 2007-02-01, Roland Levillain <roland(a)lrde.epita.fr> wrote:
> * stc/scoop.hh: Replace every occurrence of `where' (as a template
> parameter) with `location', to comply with the upcoming C++0x
> standard.
>
Do you mean that `where' is going to be a keyword in C++0x?
--
SIGOURE Benoit aka Tsuna (SUSv3 compliant)
_____ "On a long enough timeline, the survival rate
/EPITA\ Promo 2008.CSI/ACU/YAKA for everyone drops to zero" -- Jack.
3
2
05 Feb '07
2007-02-05 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add a README and a "SCOOP 1+" translation in doc/tiny.
* doc/tiny/a_la_scoop_1_plus: New.
* doc/tiny/README: New.
* doc/tiny/local/scoop.hh (Concept): Rename as...
(concept_): ...this.
(stc_equip_namespace): Add "vtypes< stc::any<E> >" so
that we can have SCOOP 1 with SCOOP 2 tools.
(stc_deferred): New.
* doc/tiny/a_la_scoop_2/main.cc: Update.
* doc/tiny/a_la_scoop_2/desugar.cc: Update.
* doc/tiny/more_scoop_2/main.cc: Update.
(reference): New.
* doc/tiny/design/main.cc (is_valid): Fix sig.
Index: doc/tiny/a_la_scoop_2/main.cc
===================================================================
--- doc/tiny/a_la_scoop_2/main.cc (revision 735)
+++ doc/tiny/a_la_scoop_2/main.cc (working copy)
@@ -48,7 +48,7 @@
// Iterator
template <typename Exact>
- struct Iterator : public Concept<Exact>,
+ struct Iterator : public concept_<Exact>,
public automatic::impl<Iterator, Exact>
{
stc_typename(value);
Index: doc/tiny/a_la_scoop_2/desugar.cc
===================================================================
--- doc/tiny/a_la_scoop_2/desugar.cc (revision 735)
+++ doc/tiny/a_la_scoop_2/desugar.cc (working copy)
@@ -48,7 +48,7 @@
// Iterator
template <typename Exact>
- struct Iterator : public Concept<Exact>,
+ struct Iterator : public concept_<Exact>,
public automatic::impl<Iterator, Exact>
{
stc_typename(value);
Index: doc/tiny/a_la_scoop_1_plus/gpp
===================================================================
--- doc/tiny/a_la_scoop_1_plus/gpp (revision 0)
+++ doc/tiny/a_la_scoop_1_plus/gpp (revision 0)
@@ -0,0 +1 @@
+g++ -Wall -ansi -pedantic -I../../../ -I../../../../metalic $1
Property changes on: doc/tiny/a_la_scoop_1_plus/gpp
___________________________________________________________________
Name: svn:executable
+ *
Index: doc/tiny/a_la_scoop_1_plus/main.cc
===================================================================
--- doc/tiny/a_la_scoop_1_plus/main.cc (revision 0)
+++ doc/tiny/a_la_scoop_1_plus/main.cc (revision 0)
@@ -0,0 +1,139 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+
+/* \file doc/tiny/a_la_scoop_1_plus/main.cc
+
+ \brief Tiny sample use of FIXME: SCOOP 1. */
+
+
+#include "../local/scoop.hh"
+
+
+stc_equip_namespace(abc);
+
+
+
+namespace abc
+{
+
+ // List of associated types.
+ stc_decl_associated_type(value);
+
+
+ // Iterator
+
+# define super stc::any<Exact>
+ // -----------------
+ // ^
+ // |
+# define current Iterator<Exact>
+ // -----------------
+
+# define templ template <typename Exact>
+# define classname Iterator
+
+ stc_Header;
+
+ typedef stc::abstract value; // stc::abstract is a feature of SCOOP 2.
+
+ stc_End;
+
+ template <typename Exact>
+ struct Iterator : public stc::any<Exact>
+ {
+ stc_typename(value);
+ void next() { this->exact().impl_next(); }
+ bool is_valid() const { return this->exact().impl_is_valid(); }
+ void set(const value& v) { this->exact().impl_set(v); }
+ };
+
+# include "../local/undefs.hh"
+
+
+
+ // array_iterator
+
+# define current array_iterator<T>
+ // -------------------
+
+# define templ template <typename T>
+# define classname array_iterator
+
+# define super Iterator< current >
+
+
+ stc_Header;
+
+ typedef stc::final<T> value; // stc::final is a feature of SCOOP 2.
+
+ stc_End;
+
+
+ template <typename T>
+ class array_iterator : public super
+ {
+ public:
+
+ stc_using(value);
+ void impl_next() { i_ = i_ + 1; }
+ bool impl_is_valid() const { return i_ >= 0 and i_ < n_; }
+ void impl_set(const value& v) { v_ = v; }
+
+ array_iterator(int n) : i_(0), n_(n) {}
+ protected:
+ int i_, n_;
+ value v_;
+ };
+
+# include "../local/undefs.hh"
+
+
+
+ // algo
+
+ template <typename I>
+ void algo(Iterator<I>& iter, typename I::value val)
+ {
+ if (iter.is_valid())
+ {
+ iter.set(val);
+ iter.next();
+ }
+ }
+
+
+} // abc
+
+
+int main()
+{
+ abc::array_iterator<int> i(7);
+ int val = 51;
+
+ abc::algo(i, val);
+}
Index: doc/tiny/more_scoop_2/main.cc
===================================================================
--- doc/tiny/more_scoop_2/main.cc (revision 735)
+++ doc/tiny/more_scoop_2/main.cc (working copy)
@@ -43,6 +43,7 @@
// List of associated types.
stc_decl_associated_type(value);
+ stc_decl_associated_type(reference);
stc_decl_associated_type(forward);
stc_decl_associated_type(backward);
@@ -54,7 +55,7 @@
// Iterator
template <typename Exact>
- struct Iterator : public Concept<Exact>,
+ struct Iterator : public concept_<Exact>,
public automatic::impl<Iterator, Exact>
{
stc_typename(value);
@@ -120,7 +121,7 @@
# define super top<E>
- // -------
+ // --------
// ^
// |
# define current iterator_base<E>
@@ -134,6 +135,7 @@
typedef stc::is<Iterator> category;
typedef stc::abstract value;
+ typedef stc::final< stc_deferred(value) & > reference;
stc_End;
Index: doc/tiny/design/main.cc
===================================================================
--- doc/tiny/design/main.cc (revision 735)
+++ doc/tiny/design/main.cc (working copy)
@@ -38,7 +38,7 @@
{
value : type
next : () -> void
- is_valid : const bool
+ is_valid : const () -> bool
set : (v : value const&) -> void
}
Index: doc/tiny/local/scoop.hh
===================================================================
--- doc/tiny/local/scoop.hh (revision 735)
+++ doc/tiny/local/scoop.hh (working copy)
@@ -903,13 +903,24 @@
\
\
\
+ /* stc::any vtypes in equipped namespace; code required for SCOOP 1 */ \
+ \
+ template <typename E> \
+ struct vtypes< stc::any<E> > \
+ { \
+ typedef mlc::none super_type; \
+ typedef stc::final<E> exact_type; \
+ }; \
+ \
+ \
+ \
/* concept class */ \
\
template <typename E> \
- struct Concept : public virtual stc::any<E> \
+ struct concept_ : public virtual stc::any<E> \
{ \
protected: \
- Concept() {} \
+ concept_() {} \
}; \
\
\
@@ -1031,6 +1042,12 @@
# define stc_using(Type) typedef typename super::Type Type
+# define stc_deferred(Type) \
+ typename deferred_vtype< typename deferred_vtype< current, \
+ typedef_::exact_type >::ret, \
+ typedef_::Type >::ret
+
+
// For impl classes.
# define stc_lookup(Type) typedef typename vtype< stc_type(current, exact_type), typedef_::Type>::ret Type
@@ -1050,6 +1067,8 @@
{ \
typedef super super_type \
+
+
# define stc_End }
Index: doc/tiny/README
===================================================================
--- doc/tiny/README (revision 0)
+++ doc/tiny/README (revision 0)
@@ -0,0 +1,158 @@
+ -*- outline -*-
+
+
+
+* Introduction.
+
+FIXME: ...
+
+
+
+* Contents.
+
+
+** design/
+
+Presents the sample program in a pseudo language.
+
+It defines Iterator as a record type with value (type), next,
+is_valid, set (three methods). The class array_iterator[T] is an
+implementation of an Iterator.
+
+
+** classical/
+
+Classical object-oriented C++ with abstract class and inheritance.
+The use of "void*" maps a generalization of all value types and allows
+to manually implement a covariant behavior of the "set" method.
+
+
+** cpp_with_virtual_types/
+
+Rewriting of the "classical" example but in an extension of the C++
+language with virtual types. This code does not compile! Yet it
+expresses an syntactically elegant solution to the covariance issue.
+
+
+** a_la_scoop_1/
+
+SCOOP 1 aims at writing C++ class hierarchies in a static way
+(with methods and typedefs dispatching at compile-time).
+
+Same as "cpp_with_virtual_types" but conforming to the 2003 ISO/ANSI
+C++. The "virtual" keyword has disappeared so polymorphic methods
+now are fast at run-time and the use of covariance is statically
+solved and checked.
+
+To break recursion that appears in types definitions (*), an auxiliary
+structure (vtypes) is introduced. This structure shall map the
+inheritance tree of the targeted classes so that we also get
+inheritance for virtual types.
+
+For instance, if B derives from A, we should have vtypes<B> deriving
+from vtypes<A>.
+
+(*) Precisely the following code cannot compile:
+ struct Iterator { typedef typename iter::value_ value; };
+ struct iter : Iterator { typedef int value_; };
+ because "Iterator" needs to be compiled before "iter" so
+ the definition of "value_" is unaccessible.
+
+
+** a_la_scoop_1_plus/
+
+Almost like the previous example but with the material offered to
+design with SCOOP 2.
+
+The main difference is that the "vtypes" definitions do not need
+anymore to replicate class inheritance. When B derives from A,
+vtypes<B> is no more required to derive from vtypes<A>. Yet the
+expected properties of virtual type inheritance and lookup are
+verified.
+
+Extra features are also provided:
+- "stc::abstract" to declare a typedef and get an error at
+ compile-time when a concrete subclass misses to give its definition;
+- "stc::final" to ensure that a typedef is not overridden in a
+ subclass;
+- "delegatee_type" to offer delegation;
+- furthermore typedef definitions based on deferred ones are now
+ possible (*).
+
+For instance, we can have:
+
+ stc_Header;
+ typedef stc::abstract value;
+ typedef stc::final< stc_deferred(value) & > reference;
+ stc_End;
+
+
+** a_la_scoop_2/
+
+SCOOP 2 aims both at writing C++ class hierarchies in a static way
+(just like SCOOP 1) and at decoupling concepts, models, and
+some automatic implementation when delegation is involved.
+
+In this sample code the "Iterator" concept (deriving from "concept_")
+is defined apart from the "array_iterator" class (deriving from
+"top"). An intermediate (non-client) meta-code looks up for the
+category of the implementation class so that it is plugged to the
+appropriate concept.
+
+What we can expect from this kind of design is better illustrated in
+the "more_scoop_2/" directory.
+
+
+** more_scoop_2/
+
+A more elaborate example than the previous one.
+
+FIXME: Give some explanations.
+
+
+** local/
+
+Material to equip a namespace with SCOOP 2 facilities and to program
+with the SCOOP 2 paradigm.
+
+
+** generic_programming/
+
+Dual code than the "classical" object-oriented C++ example. Iterator
+only appears in documentation and there is no explicit dependency
+between this concept and the "array_iterator" model.
+
+
+** cpp_with_concepts/
+
+The example is here rewritten in C++0x according to the proposal n2081
+from the evolution working group of the C++ Standard committee (*).
+"Iterator" is then translated into a concept.
+
+(*) www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2081.pdf
+
+
+
+* Recap.
+
+ Iterator array_iterator[T]
+ ------------------------- ------------------------
+
+design/ type implementation class
+(pseudo-code)
+
+classical/ abstract class derived class
+
+cpp_with_virtual_types/ abstract class derived class
+(this is not C++)
+
+generic_programming/ documentation stand-alone class
+
+a_la_scoop_1/ abstract class derived class
+(static) super is Any<Exact>
+
+a_la_scoop_2/ concept-like "stand-alone"-like class
+(static) super is concept_<Exact> super is top<Exact>
+
+cpp_with_concepts/ concept stand-alone class
+(future C++)
1
0
05 Feb '07
2007-02-01 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add a tiny example to stress differences between paradigms.
* stc/doc/tiny/: New.
* stc/scoop.hh (stc_scoop_equipment_for_namespace): Rename
SCOOPED_NAMESPACE::internal as SCOOPED_NAMESPACE::stc_vtype_internal.
2
2
2007-02-02 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Clean stc/doc/tiny.
* doc/tiny/more_scoop_2/undefs.hh: Rename as...
* doc/tiny/local/undefs.hh: ...this.
* doc/tiny/a_la_scoop_1/local_scoop.hh: Rename as...
* doc/tiny/a_la_scoop_1/scoopy.hh: ...this.
* doc/tiny/more_scoop_2/local_scoop.hh: Rename as...
* doc/tiny/local/scoop.hh: ...this.
(stc::true_, stc::false_): New.
(stc_prop): Update.
(stc_decl_associated_type): New.
* doc/tiny/a_la_scoop_2/local_scoop.hh: Remove.
* doc/tiny/a_la_scoop_1/main.cc,
(Current, Super): Rename as...
(current, super): ...this to be coherent with SCOOP 2.
* doc/tiny/a_la_scoop_1/scoopy.hh,
Likewise.
* doc/tiny/a_la_scoop_1/desugar.cc,
Likewise.
* doc/tiny/a_la_scoop_2/main.cc,
* doc/tiny/a_la_scoop_2/desugar.cc,
* doc/tiny/more_scoop_2/main.cc,
* doc/tiny/cpp_with_virtual_types/main.cc,
* doc/tiny/design/main.cc,
(category): New type in array_iterator.
* doc/tiny/cpp_with_concepts/main.cc,
* doc/tiny/classical/main.cc,
* doc/tiny/generic_programming/main.cc: Update and
add copyright header.
Index: doc/tiny/a_la_scoop_1/main.cc
===================================================================
--- doc/tiny/a_la_scoop_1/main.cc (revision 734)
+++ doc/tiny/a_la_scoop_1/main.cc (working copy)
@@ -1,7 +1,39 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
-#include "local_scoop.hh"
+/* \file doc/tiny/a_la_scoop_1/main.cc
+ \brief Tiny sample use of SCOOP 1. */
+
+
+#include "scoopy.hh"
+
+
stc_equip_namespace(abc);
@@ -12,19 +44,19 @@
// Iterator
-# define Current Iterator<Exact>
-# define Super Any<Exact>
+# define current Iterator<Exact>
+# define super Any<Exact>
template <typename Exact> class Iterator;
template <typename Exact>
- struct vtypes< Current > : vtypes< Super >
+ struct vtypes< current > : vtypes< super >
{
typedef stc::abstract value;
};
template <typename Exact>
- class Iterator : public Super
+ class Iterator : public super
{
public:
stc_typename(value);
@@ -33,25 +65,25 @@
void set(const value& v) { this->exact().impl_set(v); }
};
-#undef Super
-#undef Current
+#undef super
+#undef current
// array_iterator
-# define Current array_iterator<T>
-# define Super Iterator<Current>
+# define current array_iterator<T>
+# define super Iterator< current >
template <typename T> class array_iterator;
template <typename T>
- struct vtypes< Current > : vtypes< Super >
+ struct vtypes< current > : vtypes< super >
{
typedef T value;
};
template <typename T>
- class array_iterator : public Super
+ class array_iterator : public super
{
public:
@@ -66,8 +98,8 @@
value v_;
};
-#undef Super
-#undef Current
+#undef super
+#undef current
Index: doc/tiny/a_la_scoop_1/scoopy.hh
===================================================================
--- doc/tiny/a_la_scoop_1/scoopy.hh (revision 729)
+++ doc/tiny/a_la_scoop_1/scoopy.hh (working copy)
@@ -1,4 +1,39 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/a_la_scoop_1/scoopy.hh
+
+ \brief Mini-equipment for SCOOP 1. */
+
+#ifndef STC_DOC_TINY_A_LA_SCOOP_1_SCOOPY_HH
+# define STC_DOC_TINY_A_LA_SCOOP_1_SCOOPY_HH
+
+
namespace stc
{
@@ -14,11 +49,12 @@
}
-#define stc_typename(Type) typedef typename vtypes<Exact>::Type Type
-#define stc_using(Type) typedef typename Super::Type Type
+# define stc_typename(Type) typedef typename vtypes<Exact>::Type Type
+# define stc_using(Type) typedef typename super::Type Type
-#define stc_equip_namespace(Namespace) \
+
+# define stc_equip_namespace(Namespace) \
\
namespace Namespace \
{ \
@@ -42,3 +78,6 @@
} \
\
struct end_with_semicolumn
+
+
+#endif // ! STC_DOC_TINY_A_LA_SCOOP_1_SCOOPY_HH
Index: doc/tiny/a_la_scoop_1/local_scoop.hh
===================================================================
--- doc/tiny/a_la_scoop_1/local_scoop.hh (revision 734)
+++ doc/tiny/a_la_scoop_1/local_scoop.hh (working copy)
@@ -1,44 +0,0 @@
-
-namespace stc
-{
-
- class abstract;
-
- template <typename Exact>
- class any
- {
- public:
- Exact& exact() { return *(Exact*)(void*)this; }
- const Exact& exact() const { return *(const Exact*)(const void*)this; }
- };
-
-}
-
-#define stc_typename(Type) typedef typename vtypes<Exact>::Type Type
-#define stc_using(Type) typedef typename Super::Type Type
-
-
-#define stc_equip_namespace(Namespace) \
- \
-namespace Namespace \
-{ \
- template <typename T> struct vtypes; \
- \
- /* Any. */ \
- \
- template <typename Exact> class Any; \
- \
- template <typename Exact> \
- struct vtypes< Any<Exact> > \
- { \
- typedef Exact exact; \
- }; \
- \
- template <typename Exact> \
- class Any : public stc::any<Exact> \
- { \
- }; \
- \
-} \
- \
-struct end_with_semicolumn
Index: doc/tiny/a_la_scoop_1/desugar.cc
===================================================================
--- doc/tiny/a_la_scoop_1/desugar.cc (revision 734)
+++ doc/tiny/a_la_scoop_1/desugar.cc (working copy)
@@ -1,7 +1,39 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
-#include "local_scoop.hh"
+/* \file doc/tiny/a_la_scoop_1/desugar.cc
+ \brief Tiny sample use of SCOOP 1 without sugar. */
+
+
+#include "scoopy.hh"
+
+
stc_equip_namespace(abc);
@@ -24,7 +56,7 @@
class Iterator : public Any<Exact>
{
public:
- stc_typename(value);
+ typedef typename vtypes<Exact>::value value;
void next() { this->exact().impl_next(); }
bool is_valid() const { return this->exact().impl_is_valid(); }
void set(const value& v) { this->exact().impl_set(v); }
@@ -44,10 +76,10 @@
template <typename T>
class array_iterator : public Iterator< array_iterator<T> >
{
- typedef Iterator< array_iterator<T> > Super;
+ typedef Iterator< array_iterator<T> > super;
public:
- stc_using(value);
+ typedef typename super::value value;
void impl_next() { i_ = i_ + 1; }
bool impl_is_valid() const { return i_ >= 0 and i_ < n_; }
void impl_set(const value& v) { v_ = v; }
Index: doc/tiny/a_la_scoop_2/undefs.hh
===================================================================
--- doc/tiny/a_la_scoop_2/undefs.hh (revision 734)
+++ doc/tiny/a_la_scoop_2/undefs.hh (working copy)
@@ -1,5 +0,0 @@
-
-#undef current
-#undef super
-#undef templ
-#undef classname
Index: doc/tiny/a_la_scoop_2/main.cc
===================================================================
--- doc/tiny/a_la_scoop_2/main.cc (revision 734)
+++ doc/tiny/a_la_scoop_2/main.cc (working copy)
@@ -1,7 +1,39 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
-#include "local_scoop.hh"
+/* \file doc/tiny/a_la_scoop_2/main.cc
+ \brief Tiny sample use of SCOOP 2. */
+
+
+#include "../local/scoop.hh"
+
+
stc_equip_namespace(abc);
@@ -10,7 +42,7 @@
{
// List of associated types.
- mlc_decl_typedef(value);
+ stc_decl_associated_type(value);
// Iterator
@@ -20,7 +52,6 @@
public automatic::impl<Iterator, Exact>
{
stc_typename(value);
-
void next() { this->exact().impl_next(); }
bool is_valid() const { return this->exact().impl_is_valid(); }
void set(const value& v) { this->exact().impl_set(v); }
@@ -53,23 +84,17 @@
public:
stc_using(value);
-
- // Impl.
-
void impl_next() { i_ = i_ + 1; }
bool impl_is_valid() const { return i_ >= 0 and i_ < n_; }
void impl_set(const value& v) { v_ = v; }
- // Ctor.
-
array_iterator(int n) : i_(0), n_(n) {}
-
protected:
int i_, n_;
value v_;
};
-# include "undefs.hh"
+# include "../local/undefs.hh"
Index: doc/tiny/a_la_scoop_2/local_scoop.hh
===================================================================
--- doc/tiny/a_la_scoop_2/local_scoop.hh (revision 734)
+++ doc/tiny/a_la_scoop_2/local_scoop.hh (working copy)
@@ -1,1050 +0,0 @@
-// Copyright (C) 2005, 2006 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, 51 Franklin Street, Fifth Floor,
-// 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.
-
-/* \file stc/scoop2.hh
-
- \brief Equipment for SCOOP2: notably, Virtual types (also known as
- ``properties'') mechanism.
-*/
-
-#ifndef STC_SCOOP2_HH
-# define STC_SCOOP2_HH
-
-# include <mlc/flags.hh>
-# include <mlc/typedef.hh>
-# include <mlc/ret.hh>
-# include <mlc/assert.hh>
-# include <mlc/abort.hh>
-# include <mlc/bool.hh>
-# include <mlc/pair.hh>
-# include <mlc/cmp.hh>
-# include <mlc/if.hh>
-# include <mlc/is_a.hh>
-# include <mlc/case.hh>
-
-# include <stc/any.hh>
-
-
-namespace stc
-{
-
- struct not_delegated;
-
- struct abstract;
-
- template <typename T>
- struct final;
-
- template < template <class> class >
- struct is;
-
-} // end of namespace stc
-
-
-
-#define stc_super(T) typename vtypes< T >::super_type
-#define stc_stm(From, Target) typename get_stm< From , Target >::ret
-
-
-
-
-
-# define stc_equip_namespace(SCOOPED_NAMESPACE) \
- \
- \
-namespace SCOOPED_NAMESPACE \
-{ \
- \
- mlc_decl_typedef(delegatee_type); \
- \
- \
- template <typename from_type> \
- struct vtypes \
- { \
- }; \
- \
- template <typename from_type, typename type> \
- struct single_vtype \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- \
- \
- namespace ERROR \
- { \
- \
- template < typename first_definition, \
- typename re_definition, \
- typename target > \
- struct final_vtype_redefined_; \
- \
- \
- template < typename first_definition, \
- typename declaration, \
- typename target > \
- struct vtype_declared_but_already_set_; \
- \
- \
- template < typename from, \
- typename target > \
- struct vtype_not_found; \
- \
- \
- template < typename curr, \
- typename target, \
- typename stm > \
- struct wrong_final_stm_; \
- \
- \
- template < typename target, \
- typename declaration, \
- typename from > \
- struct vtype_declared_but_not_defined; \
- \
- \
- template <typename T> \
- struct _declaration_is_in_; \
- \
- template <typename T> \
- struct _definition_is_looked_up_from_; \
- \
- \
- template <typename T> \
- struct _for_vtype_; \
- \
- \
- struct no_delegatee_declared_; \
- \
- \
- } /* end of namespace SCOOPED_NAMESPACE::ERROR */ \
- \
- \
- \
- namespace internal \
- { \
- \
- \
- /* \
- * Forward declarations. \
- */ \
- \
- \
- template <typename from, typename target> \
- struct get_stm; \
- \
- template <typename res1, typename res2> \
- struct helper_get_stm; \
- \
- template <typename from, typename target> \
- struct first_stm; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_first_stm; \
- \
- \
- template <typename from, typename target, typename curr = from> \
- struct superior_find; \
- \
- template <typename from, typename target, typename curr, typename stm> \
- struct helper_superior_find; \
- \
- template <typename from, typename target> \
- struct delegator_find; \
- \
- template <typename from, typename target, typename delegatee> \
- struct helper_delegator_find; \
- \
- template <typename from, typename target> \
- struct find; \
- \
- template <typename from, typename target, typename where, typename res> \
- struct helper_find; \
- \
- \
- \
- template <typename from, typename target> \
- struct check; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_check; \
- \
- \
- \
- /* get_stm(from, target) \
- * \
- * Returns the statement for class 'from' corresponding to 'target'. \
- * This statement is either defined in 'vtypes' or in 'single_vtype'. \
- * \
- * This routine is local; it does not recourse on superior classes. \
- * \
- */ \
- \
- template <typename res1> \
- struct helper_get_stm <res1, mlc::not_found> \
- { \
- typedef res1 ret; \
- }; \
- \
- template <typename res2> \
- struct helper_get_stm <mlc::not_found, res2> \
- { \
- typedef res2 ret; \
- }; \
- \
- template <> \
- struct helper_get_stm <mlc::not_found, mlc::not_found> \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- template <typename res1, typename res2> \
- struct helper_get_stm /* FIXME: Insert mlc::abort_<> statement here? */ \
- { \
- /* error */ \
- }; \
- \
- template <typename from, typename target> \
- struct get_stm \
- { \
- typedef SCOOPED_NAMESPACE::vtypes<from> decl1; \
- typedef typename target::template from_<decl1>::ret res1; \
- \
- typedef SCOOPED_NAMESPACE::single_vtype<from, target> decl2; \
- typedef typename decl2::ret ret2; \
- \
- typedef typename helper_get_stm<res1, ret2>::ret ret; \
- }; \
- \
- \
- \
- \
- /* -------------------- */ \
- /* Checking algorithm. */ \
- /* -------------------- */ \
- \
- /* \
- * check_no_final_inherited \
- * \
- * FIXME: ... \
- */ \
- \
- template < typename orig, typename curr, typename target, \
- typename stm = typename get_stm<curr, target>::ret > \
- struct check_no_final_inherited \
- \
- : mlc::assert_< mlc_is_not_a(stm, stc::final), \
- ERROR::final_vtype_redefined_< orig, \
- mlc::pair_<curr, stm>, \
- target > \
- >, \
- /* rec */ check_no_final_inherited<orig, stc_super(curr), target> \
- { \
- }; \
- \
- template <typename orig, typename target, typename stm> \
- struct check_no_final_inherited <orig, /* if curr == */ mlc::none, target, stm> \
- { \
- }; \
- \
- \
- /* \
- * check_no_stm_inherited \
- * \
- * FIXME: ... \
- */ \
- \
- template < typename orig, typename curr, typename target, \
- typename stm = typename get_stm<curr, target>::ret > \
- struct check_no_stm_inherited \
- \
- : mlc::assert_< mlc::is_not_found_<stm>, \
- ERROR::vtype_declared_but_already_set_< orig, \
- mlc::pair_<curr, stm>, \
- target > \
- >, \
- /* rec */ check_no_stm_inherited<orig, stc_super(curr), target> \
- { \
- }; \
- \
- template <typename orig, typename target, typename stm> \
- struct check_no_stm_inherited <orig, /* if curr == */ mlc::none, target, stm> \
- { \
- }; \
- \
- \
- /* \
- * check_delegatee_inherited \
- */ \
- \
- template <typename curr, typename target> \
- struct check_delegatee_inherited \
- : mlc::assert_< mlc::is_found_< typename first_stm<curr, \
- typedef_::delegatee_type>::ret::second_elt >, \
- ERROR::no_delegatee_declared_ > \
- { \
- }; \
- \
- \
- /* \
- * check_final_stm \
- */ \
- \
- template <typename curr, typename target, typename stm> \
- struct check_final_stm \
- {}; \
- \
- template <typename curr, typename target> \
- struct check_final_stm < curr, target, stc::abstract > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<stc::abstract> > > \
- {}; \
- \
- template <typename curr, typename target, typename T> \
- struct check_final_stm < curr, target, stc::final<T> > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<stc::final<T> > > > \
- {}; \
- \
- template <typename curr, typename target> \
- struct check_final_stm < curr, target, stc::not_delegated > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<stc::not_delegated> > > \
- {}; \
- \
- template <typename curr, typename target> \
- struct check_final_stm < curr, target, mlc::not_found > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<mlc::not_found> > > \
- {}; \
- \
- \
- \
- \
- /* \
- * check(from, target) \
- * \
- * pseudo-code: \
- * \
- * check(from, target) \
- * { \
- * if (from == mlc::none) // stop because no more class \
- * return done; \
- * else \
- * return helper_check(from, target, get_stm(from, target)); \
- * } \
- */ \
- \
- struct dummy {}; \
- \
- template <typename target> \
- struct check < /* if from == */ mlc::none, target > \
- { \
- typedef dummy ret; \
- }; \
- \
- template <typename from, typename target> \
- struct check /* otherwise */ \
- { \
- typedef typename helper_check< from, target, \
- stc_stm(from, target) >::ret ret; \
- }; \
- \
- \
- \
- \
- /* \
- * pseudo-code: \
- * \
- * helper_check(curr, target, stm) \
- * { \
- * super = super(curr); \
- * \
- * if (stm == stc::abstract) { \
- * check_no_stm_inherited(curr, super, target); \
- * return check(super, target); \
- * } \
- * if (stm == stc::final<T>) { \
- * check_final_stm(T); \
- * check_no_final_inherited((curr, T), super, target); \
- * return check(super, target); \
- * } \
- * if (stm == stc::not_delegated) { \
- * check_delegatee_inherited(curr); \
- * check_no_final_inherited((curr, stc::not_delegated), super, target); \
- * return check(super, target); \
- * } \
- * if (stm == mlc::not_found) { \
- * return check(super, target); \
- * } \
- * // otherwise, non-final stm: \
- * if (stm == T) { \
- * check_no_final_inherited((curr, T), super, target); \
- * return check(super, target); \
- * } \
- * } \
- * \
- */ \
- \
- template <typename curr, typename target> \
- struct helper_check < curr, target, \
- /* if stm == */ stc::abstract > \
- : check_no_stm_inherited< mlc::pair_<curr, stc::abstract >, \
- stc_super(curr), \
- target > \
- { \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target, typename T> \
- struct helper_check < curr, target, \
- /* if stm == */ stc::final<T> > \
- : check_no_final_inherited< mlc::pair_<curr, stc::final<T> >, \
- stc_super(curr), \
- target > \
- { \
- /* FIXME: \
- check_final_stm(T); \
- */ \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target> \
- struct helper_check < curr, target, \
- /* if stm == */ stc::not_delegated > \
- : check_no_final_inherited< mlc::pair_<curr, stc::not_delegated>, \
- stc_super(curr), \
- target > \
- { \
- /* FIXME: \
- check_delegatee_inherited(curr); \
- */ \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target> \
- struct helper_check < curr, target, \
- /* if stm == */ mlc::not_found > \
- { \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_check /* otherwise, non-final stm */ \
- : check_no_final_inherited< mlc::pair_<curr, stm>, \
- stc_super(curr), \
- target > \
- { \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- \
- \
- /* ------------------- */ \
- /* Look-up algorithm. */ \
- /* ------------------- */ \
- \
- /* \
- * first_stm(from, target) \
- * \
- * returns a pair (Where, Value) with Value being: \
- * - stc::abstract \
- * - stc::not_delegated \
- * - mlc::not_found \
- * - a type T \
- * and Where being the class where the stm is found. \
- * \
- * \
- * helper_first_stm(curr, target, stm) \
- * { \
- * if (stm == mlc::not_found) \
- * return first_stm(super(curr), target); \
- * else if (stm == stc::final<T>) \
- * return pair(curr, T); \
- * else \
- * return pair(curr, stm); \
- * } \
- * \
- * first_stm(from, target) \
- * { \
- * if (from == mlc::none) \
- * return pair(mlc::none, mlc::not_found); \
- * else \
- * return helper_first_stm(from, target, \
- * get_stm(from, target)); \
- * } \
- * \
- */ \
- \
- template <typename curr, typename target> \
- struct helper_first_stm < curr, target, \
- /* if stm == */ mlc::not_found > \
- { \
- typedef typename first_stm<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target, typename T> \
- struct helper_first_stm < curr, target, \
- /* if stm == */ stc::final<T> > \
- { \
- typedef mlc::pair_<curr, T> ret; \
- }; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_first_stm /* otherwise */ \
- { \
- typedef mlc::pair_<curr, stm> ret; \
- }; \
- \
- template <typename target> \
- struct first_stm < /* if from == */ mlc::none, target > \
- { \
- typedef mlc::pair_<mlc::none, mlc::not_found> ret; \
- }; \
- \
- template <typename from, typename target> \
- struct first_stm /* otherwise */ \
- { \
- typedef typename helper_first_stm<from, target, \
- stc_stm(from, target)>::ret ret; \
- }; \
- \
- \
- \
- /* \
- * superior_find(from, target) \
- * \
- * returns: \
- * either mlc::not_found \
- * or a type T \
- * behavior: \
- * - the stm stc::not_delegated is ignored \
- * - error when stc::abstract is reached \
- * \
- * helper_superior_find(from, target, curr, stm) \
- * { \
- * if (stm == stc::abstract) \
- * error("<target> declared in <curr> but not defined at <from>"); \
- * else if (stm == mlc::not_found or \
- * stm == stc::not_delegated) \
- * return superior_find(from, target, super(curr)); \
- * else if (stm == stc::final<T>) \
- * return T; \
- * else \
- * return stm; \
- * } \
- * \
- * superior_find(from, target, curr = from) \
- * { \
- * if (curr == mlc::none) \
- * return mlc::not_found; \
- * else \
- * return helper_superior_find(from, target, curr, \
- * get_stm(curr, target)); \
- * } \
- */ \
- \
- template <typename from, typename target, typename curr> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ stc::abstract > \
- { \
- /* FIXME: error("<target> declared in <curr> but not defined at <from>"); */ \
- }; \
- \
- template <typename from, typename target, typename curr> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ mlc::not_found > \
- { \
- typedef typename superior_find< from, target, \
- stc_super(curr) >::ret ret; \
- }; \
- \
- template <typename from, typename target, typename curr> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ stc::not_delegated > \
- { \
- typedef typename superior_find< from, target, \
- stc_super(curr) >::ret ret; \
- }; \
- \
- template <typename from, typename target, typename curr, typename T> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ stc::final<T> > \
- { \
- typedef T ret; \
- }; \
- \
- template <typename from, typename target, typename curr, typename stm> \
- struct helper_superior_find /* otherwise */ \
- { \
- typedef stm ret; \
- }; \
- \
- template <typename from, typename target> \
- struct superior_find < from, target, /* if curr == */ mlc::none > \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- template <typename from, typename target, typename curr> \
- struct superior_find /* otherwise */ \
- { \
- typedef typename helper_superior_find<from, target, curr, \
- stc_stm(curr, target)>::ret ret; \
- }; \
- \
- \
- \
- /* \
- * delegator_find(from, target) \
- * \
- * \
- * delegator_find(from, target) \
- * { \
- * precondition(target != delegatee_type); \
- * delegatee = superior_find(from, delegatee_type); \
- * if (delegatee == mlc::not_found) \
- * return mlc::not_found; \
- * else \
- * return find(delegatee, target); \
- * } \
- */ \
- \
- template <typename from, typename target> \
- struct helper_delegator_find < from, target, \
- /* if delegatee == */ mlc::not_found > \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- template <typename from, typename target, typename delegatee> \
- struct helper_delegator_find /* otherwise */ \
- { \
- typedef typename find<delegatee, target>::ret ret; \
- }; \
- \
- template <typename from, typename target> \
- struct delegator_find \
- { \
- typedef typename superior_find<from, typedef_::delegatee_type>::ret delegatee; \
- typedef typename helper_delegator_find<from, target, delegatee>::ret ret; \
- }; \
- \
- \
- \
- /* \
- * helper_find(from, target, where, res) \
- * \
- * \
- * \
- */ \
- \
- template <typename from, typename target, typename where> \
- struct helper_find < from, target, where, \
- /* if res == */ mlc::not_found > \
- { \
- typedef typename delegator_find<from, target>::ret ret; \
- }; \
- \
- template <typename from, typename target, typename where> \
- struct helper_find < from, target, where, \
- /* if res == */ stc::abstract > \
- { \
- typedef typename delegator_find<from, target>::ret res_d; \
- struct check_ \
- : mlc::assert_< mlc::is_found_<res_d>, \
- ERROR::vtype_declared_but_not_defined \
- < ERROR::_for_vtype_<target>, \
- ERROR::_declaration_is_in_<where>, \
- ERROR::_definition_is_looked_up_from_<from> > > \
- /* FIXME: error("<target> declared in <where> but not defined at <from>"); */ \
- { \
- typedef res_d ret; \
- }; \
- typedef typename check_::ret ret; \
- }; \
- \
- template <typename from, typename target, typename where> \
- struct helper_find < from, target, where, \
- /* if res == */ stc::not_delegated > \
- { \
- typedef typename superior_find<from, target>::ret ret; \
- }; \
- \
- template <typename from, typename target, typename where, typename res> \
- struct helper_find /* otherwise */ \
- { \
- typedef res ret; \
- }; \
- \
- \
- \
- /* \
- * find(from, target) \
- * \
- * FIXME: ... \
- * \
- * find(from, target) \
- * { \
- * if (target == delegatee_type) \
- * return superior_find(from, delegatee_type); \
- * else \
- * return helper_find(from, target); \
- * } \
- */ \
- \
- template <typename from> \
- struct find <from, /* if target == */ typedef_::delegatee_type > \
- { \
- typedef typename superior_find<from, typedef_::delegatee_type>::ret ret; \
- }; \
- \
- template <typename from, typename target> \
- struct find /* otherwise */ \
- { \
- typedef typename first_stm<from, target>::ret stm; \
- typedef mlc_elt(stm, 1) where; \
- typedef mlc_elt(stm, 2) res; \
- typedef typename helper_find<from, target, \
- where, res>::ret ret; \
- }; \
- \
- \
- } /* end of SCOOPED_NAMESPACE::internal */ \
- \
- \
- /* \
- * find_vtype(from, target) \
- * \
- * FIXME:... \
- * \
- */ \
- \
- template <typename from, typename target> \
- struct deferred_vtype \
- { \
- typedef typename internal::find<from, target>::ret ret; \
- }; \
- \
- template <typename from, typename target> \
- struct find_vtype \
- { \
- typedef typename internal::find<from, target>::ret ret; \
- typedef typename internal::check<from, target>::ret chk; \
- }; \
- \
- template <typename from, typename target> \
- struct vtype \
- { \
- typedef typename find_vtype<from, target>::ret res; \
- struct check_ : mlc::assert_< mlc::is_found_<res> > \
- { \
- typedef res ret; \
- }; \
- typedef typename check_::ret ret; \
- }; \
- \
- \
- \
- mlc_case_equipment_for_namespace(internal); \
- \
- mlc_decl_typedef(tag); \
- mlc_decl_typedef(category); \
- mlc_decl_typedef(exact_type); \
- \
- \
- namespace internal \
- { \
- \
- \
- template < template <class> class abstraction, \
- unsigned num = 1 > \
- struct selector \
- { \
- protected: selector() {} \
- }; \
- \
- \
- /* fwd decl */ \
- template < template <class> class abstraction, typename E, unsigned num > \
- struct plug_node; \
- \
- template < template <class> class abstraction, \
- typename E, \
- unsigned num, \
- typename another_selector = mlc::false_ > \
- struct next_plug_node \
- { \
- /* here: no other selector */ \
- protected: next_plug_node() {} \
- }; \
- \
- template < template <class> class abstraction, \
- typename E > \
- struct next_plug_node < abstraction, E, 1, mlc::false_ > \
- : public abstraction<E> \
- { \
- protected: next_plug_node() {} \
- }; \
- \
- \
- template < template <class> class abstraction, \
- typename E, \
- unsigned num > \
- struct next_plug_node < abstraction, \
- E, \
- num, \
- mlc::true_> \
- \
- : /* plug to client selectors */ \
- public virtual switch_< selector<abstraction, num>, E >::ret, \
- \
- /* here: another selector (number is 'num + 1') */ \
- public plug_node<abstraction, E, num + 1> \
- { \
- protected: next_plug_node() {} \
- }; \
- \
- \
- template < template <class> class abstraction, \
- typename E, \
- unsigned num > \
- struct plug_node \
- : public next_plug_node< abstraction, \
- E, \
- num, \
- typename mlc::is_defined_< case_< selector<abstraction, num>, \
- E, 1 > >::eval > \
- { \
- protected: plug_node() {} \
- }; \
- \
- \
- template < template <class> class abstraction, \
- unsigned num, \
- typename E > \
- struct default_case_ < selector<abstraction, num>, \
- E > \
- { \
- typedef abstraction<E> ret; \
- }; \
- \
- \
- template < template <class> class abstraction, \
- typename E > \
- struct plug : public plug_node<abstraction, E, 1> \
- { \
- protected: plug() {} \
- }; \
- \
- template <typename abstraction, typename E> \
- struct top; \
- \
- template <template<class> class abstraction, typename E> \
- struct top < stc::is<abstraction>, E > : public plug< abstraction, E > \
- { \
- protected: top() {} \
- }; \
- \
- template <typename E> \
- struct top < mlc::not_found, E > \
- { \
- protected: top() {} \
- }; \
- \
- \
- } /* end of namespace internal */ \
- \
- \
- \
- /* top class */ \
- \
- template <typename E> struct top; \
- \
- template <typename E> \
- struct vtypes< top<E> > \
- { \
- typedef mlc::none super_type; \
- typedef stc::abstract category; \
- typedef stc::final<E> exact_type; \
- }; \
- \
- template <typename E> \
- struct top : public internal::top< stc_find_type(E, category), E > \
- { \
- protected: \
- top() {} \
- }; \
- \
- \
- \
- /* concept class */ \
- \
- template <typename E> \
- struct Concept : public stc::any<E> \
- { \
- protected: \
- Concept() {} \
- }; \
- \
- \
- namespace automatic \
- { \
- \
- template < template <class> class abstraction, typename E, typename tag = void > \
- struct impl \
- /* undefined */ ; \
- \
- template < template <class> class abstraction, typename E > \
- struct impl< abstraction, E, mlc::not_found > \
- { /* nothing */ }; \
- \
- template < template <class> class abstraction, typename E > \
- struct impl< abstraction, E, void > : impl< abstraction, E, stc_find_type(E, tag) > \
- { /* fetch impl w.r.t. tag */ }; \
- \
- } /* end of namespace automatic */ \
- \
- \
- \
-} /* end of SCOOPED_NAMESPACE */ \
- \
- \
-struct e_n_d__w_i_t_h___s_e_m_i_c_o_l_o_n;
-
-
-/*
-
-
-// --------------------------------------------
-// O L D B U N C H O F M A C R O S
-// --------------------------------------------
-
-
-
-# define stc_find_vtype_(Namespace, From, Target) \
- Namespace::find_vtype<From, Namespace::typedef_::Target##_type>::ret
-
-# define stc_find_vtype(Namespace, From, Target) \
- typename stc_find_vtype_(Namespace, From, Target)
-
-
-
-# define stc_deferred_vtype_(Namespace, From, Target) \
- Namespace::deferred_vtype<From, Namespace::typedef_::Target##_type>::ret
-
-# define stc_deferred_vtype(Namespace, From, Target) \
- typename stc_deferred_vtype_(Namespace, From, Target)
-
-
-
-# define stc_vtype_(Namespace, From, Target) \
- Namespace::vtype<From, Namespace::typedef_::Target##_type>::ret
-
-# define stc_vtype(Namespace, From, Target) \
- typename stc_vtype_(Namespace, From, Target)
-
-
-
-# define stc_find_deduce_vtype_(Namespace, From, Target1, Target2) \
- Namespace::find_vtype< Namespace::find_vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-# define stc_find_deduce_vtype(Namespace, From, Target1, Target2) \
- typename \
- Namespace::find_vtype< typename \
- Namespace::find_vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-
-
-# define stc_deduce_deferred_vtype(Namespace, From, Target1, Target2) \
- typename \
- Namespace::deferred_vtype< typename \
- Namespace::deferred_vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret \
-
-
-
-# define stc_deduce_vtype_(Namespace, From, Target1, Target2) \
- Namespace::vtype< Namespace::vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-# define stc_deduce_vtype(Namespace, From, Target1, Target2) \
- typename \
- Namespace::vtype< typename \
- Namespace::vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-
-// # define stc_vtype_is_found_(Namespace, From, Target)
-// mlc::is_found_< Namespace::find_vtype<From, Namespace::typedef_::Target##_type>::ret >
-
-
-// ----------------------------------------------------------
-// E N D O F O L D B U N C H O F M A C R O S
-// ----------------------------------------------------------
-
-*/
-
-
-
-
-# define stc_type_(From, Type) vtype<From, typedef_::Type>::ret
-# define stc_type(From, Type) typename stc_type_(From, Type)
-
-# define stc_find_type(From, Type) typename find_vtype<From, typedef_::Type>::ret
-
-
-// For concepts.
-# define stc_typename(Type) typedef stc_type(Exact, Type) Type
-# define stc_using(Type) typedef typename super::Type Type
-
-
-// For impl classes.
-# define stc_lookup(Type) typedef typename vtype< stc_type(current, exact_type), typedef_::Type>::ret Type
-
-// typedef stc_type(current, Type) Type
-
-
-
-// sugar:
-
-# define stc_Header \
- \
-templ class classname ; /* fwd decl */ \
- \
-templ struct vtypes< current > /* vtypes */ \
-{ \
- typedef super super_type \
-
-# define stc_End }
-
-
-
-#endif // ! STC_SCOOP2_HH
Index: doc/tiny/a_la_scoop_2/desugar.cc
===================================================================
--- doc/tiny/a_la_scoop_2/desugar.cc (revision 734)
+++ doc/tiny/a_la_scoop_2/desugar.cc (working copy)
@@ -1,7 +1,39 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
-#include "local_scoop.hh"
+/* \file doc/tiny/a_la_scoop_2/desugar.cc
+ \brief Tiny sample use of SCOOP 2 without sugar. */
+
+
+#include "../local/scoop.hh"
+
+
stc_equip_namespace(abc);
@@ -10,7 +42,7 @@
{
// List of associated types.
- mlc_decl_typedef(value);
+ stc_decl_associated_type(value);
// Iterator
Index: doc/tiny/more_scoop_2/undefs.hh
===================================================================
--- doc/tiny/more_scoop_2/undefs.hh (revision 734)
+++ doc/tiny/more_scoop_2/undefs.hh (working copy)
@@ -1,5 +0,0 @@
-
-#undef current
-#undef super
-#undef templ
-#undef classname
Index: doc/tiny/more_scoop_2/main.cc
===================================================================
--- doc/tiny/more_scoop_2/main.cc (revision 734)
+++ doc/tiny/more_scoop_2/main.cc (working copy)
@@ -1,6 +1,37 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/more_scoop_2/main.cc
+
+ \brief Extension of the tiny sample use of SCOOP 2. */
+
#include <iostream>
-#include "local_scoop.hh"
+#include "../local/scoop.hh"
stc_equip_namespace(abc);
@@ -11,9 +42,9 @@
{
// List of associated types.
- mlc_decl_typedef(value);
- mlc_decl_typedef(forward);
- mlc_decl_typedef(backward);
+ stc_decl_associated_type(value);
+ stc_decl_associated_type(forward);
+ stc_decl_associated_type(backward);
@@ -123,12 +154,11 @@
value v_;
};
+# include "../local/undefs.hh"
-# include "undefs.hh"
-
// lightweight_iterator
@@ -166,7 +196,7 @@
};
-# include "undefs.hh"
+# include "../local/undefs.hh"
@@ -191,8 +221,8 @@
stc_Header;
typedef T value;
- typedef mlc::true_ forward;
- typedef mlc::true_ backward;
+ typedef stc::true_ forward;
+ typedef stc::true_ backward;
stc_End;
@@ -213,7 +243,7 @@
int i_, n_;
};
-# include "undefs.hh"
+# include "../local/undefs.hh"
@@ -335,7 +365,7 @@
};
-# include "undefs.hh"
+# include "../local/undefs.hh"
template <typename I>
Index: doc/tiny/more_scoop_2/local_scoop.hh
===================================================================
--- doc/tiny/more_scoop_2/local_scoop.hh (revision 734)
+++ doc/tiny/more_scoop_2/local_scoop.hh (working copy)
@@ -1,1054 +0,0 @@
-// Copyright (C) 2005, 2006 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, 51 Franklin Street, Fifth Floor,
-// 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.
-
-/* \file stc/scoop2.hh
-
- \brief Equipment for SCOOP2: notably, Virtual types (also known as
- ``properties'') mechanism.
-*/
-
-#ifndef STC_SCOOP2_HH
-# define STC_SCOOP2_HH
-
-# include <mlc/flags.hh>
-# include <mlc/typedef.hh>
-# include <mlc/ret.hh>
-# include <mlc/assert.hh>
-# include <mlc/abort.hh>
-# include <mlc/bool.hh>
-# include <mlc/pair.hh>
-# include <mlc/cmp.hh>
-# include <mlc/if.hh>
-# include <mlc/is_a.hh>
-# include <mlc/case.hh>
-
-# include <stc/any.hh>
-
-
-
-
-namespace stc
-{
-
- struct not_delegated;
-
- struct abstract;
-
- template <typename T>
- struct final;
-
- template < template <class> class >
- struct is;
-
-} // end of namespace stc
-
-
-
-#define stc_super(T) typename vtypes< T >::super_type
-#define stc_stm(From, Target) typename get_stm< From , Target >::ret
-
-
-
-
-
-# define stc_equip_namespace(SCOOPED_NAMESPACE) \
- \
- \
-namespace SCOOPED_NAMESPACE \
-{ \
- \
- mlc_decl_typedef(delegatee_type); \
- \
- \
- template <typename from_type> \
- struct vtypes \
- { \
- }; \
- \
- template <typename from_type, typename type> \
- struct single_vtype \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- \
- \
- namespace ERROR \
- { \
- \
- template < typename first_definition, \
- typename re_definition, \
- typename target > \
- struct final_vtype_redefined_; \
- \
- \
- template < typename first_definition, \
- typename declaration, \
- typename target > \
- struct vtype_declared_but_already_set_; \
- \
- \
- template < typename from, \
- typename target > \
- struct vtype_not_found; \
- \
- \
- template < typename curr, \
- typename target, \
- typename stm > \
- struct wrong_final_stm_; \
- \
- \
- template < typename target, \
- typename declaration, \
- typename from > \
- struct vtype_declared_but_not_defined; \
- \
- \
- template <typename T> \
- struct _declaration_is_in_; \
- \
- template <typename T> \
- struct _definition_is_looked_up_from_; \
- \
- \
- template <typename T> \
- struct _for_vtype_; \
- \
- \
- struct no_delegatee_declared_; \
- \
- \
- } /* end of namespace SCOOPED_NAMESPACE::ERROR */ \
- \
- \
- \
- namespace internal \
- { \
- \
- \
- /* \
- * Forward declarations. \
- */ \
- \
- \
- template <typename from, typename target> \
- struct get_stm; \
- \
- template <typename res1, typename res2> \
- struct helper_get_stm; \
- \
- template <typename from, typename target> \
- struct first_stm; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_first_stm; \
- \
- \
- template <typename from, typename target, typename curr = from> \
- struct superior_find; \
- \
- template <typename from, typename target, typename curr, typename stm> \
- struct helper_superior_find; \
- \
- template <typename from, typename target> \
- struct delegator_find; \
- \
- template <typename from, typename target, typename delegatee> \
- struct helper_delegator_find; \
- \
- template <typename from, typename target> \
- struct find; \
- \
- template <typename from, typename target, typename where, typename res> \
- struct helper_find; \
- \
- \
- \
- template <typename from, typename target> \
- struct check; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_check; \
- \
- \
- \
- /* get_stm(from, target) \
- * \
- * Returns the statement for class 'from' corresponding to 'target'. \
- * This statement is either defined in 'vtypes' or in 'single_vtype'. \
- * \
- * This routine is local; it does not recourse on superior classes. \
- * \
- */ \
- \
- template <typename res1> \
- struct helper_get_stm <res1, mlc::not_found> \
- { \
- typedef res1 ret; \
- }; \
- \
- template <typename res2> \
- struct helper_get_stm <mlc::not_found, res2> \
- { \
- typedef res2 ret; \
- }; \
- \
- template <> \
- struct helper_get_stm <mlc::not_found, mlc::not_found> \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- template <typename res1, typename res2> \
- struct helper_get_stm /* FIXME: Insert mlc::abort_<> statement here? */ \
- { \
- /* error */ \
- }; \
- \
- template <typename from, typename target> \
- struct get_stm \
- { \
- typedef SCOOPED_NAMESPACE::vtypes<from> decl1; \
- typedef typename target::template from_<decl1>::ret res1; \
- \
- typedef SCOOPED_NAMESPACE::single_vtype<from, target> decl2; \
- typedef typename decl2::ret ret2; \
- \
- typedef typename helper_get_stm<res1, ret2>::ret ret; \
- }; \
- \
- \
- \
- \
- /* -------------------- */ \
- /* Checking algorithm. */ \
- /* -------------------- */ \
- \
- /* \
- * check_no_final_inherited \
- * \
- * FIXME: ... \
- */ \
- \
- template < typename orig, typename curr, typename target, \
- typename stm = typename get_stm<curr, target>::ret > \
- struct check_no_final_inherited \
- \
- : mlc::assert_< mlc_is_not_a(stm, stc::final), \
- ERROR::final_vtype_redefined_< orig, \
- mlc::pair_<curr, stm>, \
- target > \
- >, \
- /* rec */ check_no_final_inherited<orig, stc_super(curr), target> \
- { \
- }; \
- \
- template <typename orig, typename target, typename stm> \
- struct check_no_final_inherited <orig, /* if curr == */ mlc::none, target, stm> \
- { \
- }; \
- \
- \
- /* \
- * check_no_stm_inherited \
- * \
- * FIXME: ... \
- */ \
- \
- template < typename orig, typename curr, typename target, \
- typename stm = typename get_stm<curr, target>::ret > \
- struct check_no_stm_inherited \
- \
- : mlc::assert_< mlc::is_not_found_<stm>, \
- ERROR::vtype_declared_but_already_set_< orig, \
- mlc::pair_<curr, stm>, \
- target > \
- >, \
- /* rec */ check_no_stm_inherited<orig, stc_super(curr), target> \
- { \
- }; \
- \
- template <typename orig, typename target, typename stm> \
- struct check_no_stm_inherited <orig, /* if curr == */ mlc::none, target, stm> \
- { \
- }; \
- \
- \
- /* \
- * check_delegatee_inherited \
- */ \
- \
- template <typename curr, typename target> \
- struct check_delegatee_inherited \
- : mlc::assert_< mlc::is_found_< typename first_stm<curr, \
- typedef_::delegatee_type>::ret::second_elt >, \
- ERROR::no_delegatee_declared_ > \
- { \
- }; \
- \
- \
- /* \
- * check_final_stm \
- */ \
- \
- template <typename curr, typename target, typename stm> \
- struct check_final_stm \
- {}; \
- \
- template <typename curr, typename target> \
- struct check_final_stm < curr, target, stc::abstract > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<stc::abstract> > > \
- {}; \
- \
- template <typename curr, typename target, typename T> \
- struct check_final_stm < curr, target, stc::final<T> > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<stc::final<T> > > > \
- {}; \
- \
- template <typename curr, typename target> \
- struct check_final_stm < curr, target, stc::not_delegated > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<stc::not_delegated> > > \
- {}; \
- \
- template <typename curr, typename target> \
- struct check_final_stm < curr, target, mlc::not_found > \
- : mlc::abort_< ERROR::wrong_final_stm_<curr, target, stc::final<mlc::not_found> > > \
- {}; \
- \
- \
- \
- \
- /* \
- * check(from, target) \
- * \
- * pseudo-code: \
- * \
- * check(from, target) \
- * { \
- * if (from == mlc::none) // stop because no more class \
- * return done; \
- * else \
- * return helper_check(from, target, get_stm(from, target)); \
- * } \
- */ \
- \
- struct dummy {}; \
- \
- template <typename target> \
- struct check < /* if from == */ mlc::none, target > \
- { \
- typedef dummy ret; \
- }; \
- \
- template <typename from, typename target> \
- struct check /* otherwise */ \
- { \
- typedef typename helper_check< from, target, \
- stc_stm(from, target) >::ret ret; \
- }; \
- \
- \
- \
- \
- /* \
- * pseudo-code: \
- * \
- * helper_check(curr, target, stm) \
- * { \
- * super = super(curr); \
- * \
- * if (stm == stc::abstract) { \
- * check_no_stm_inherited(curr, super, target); \
- * return check(super, target); \
- * } \
- * if (stm == stc::final<T>) { \
- * check_final_stm(T); \
- * check_no_final_inherited((curr, T), super, target); \
- * return check(super, target); \
- * } \
- * if (stm == stc::not_delegated) { \
- * check_delegatee_inherited(curr); \
- * check_no_final_inherited((curr, stc::not_delegated), super, target); \
- * return check(super, target); \
- * } \
- * if (stm == mlc::not_found) { \
- * return check(super, target); \
- * } \
- * // otherwise, non-final stm: \
- * if (stm == T) { \
- * check_no_final_inherited((curr, T), super, target); \
- * return check(super, target); \
- * } \
- * } \
- * \
- */ \
- \
- template <typename curr, typename target> \
- struct helper_check < curr, target, \
- /* if stm == */ stc::abstract > \
- : check_no_stm_inherited< mlc::pair_<curr, stc::abstract >, \
- stc_super(curr), \
- target > \
- { \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target, typename T> \
- struct helper_check < curr, target, \
- /* if stm == */ stc::final<T> > \
- : check_no_final_inherited< mlc::pair_<curr, stc::final<T> >, \
- stc_super(curr), \
- target > \
- { \
- /* FIXME: \
- check_final_stm(T); \
- */ \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target> \
- struct helper_check < curr, target, \
- /* if stm == */ stc::not_delegated > \
- : check_no_final_inherited< mlc::pair_<curr, stc::not_delegated>, \
- stc_super(curr), \
- target > \
- { \
- /* FIXME: \
- check_delegatee_inherited(curr); \
- */ \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target> \
- struct helper_check < curr, target, \
- /* if stm == */ mlc::not_found > \
- { \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_check /* otherwise, non-final stm */ \
- : check_no_final_inherited< mlc::pair_<curr, stm>, \
- stc_super(curr), \
- target > \
- { \
- typedef typename check<stc_super(curr), target>::ret ret; \
- }; \
- \
- \
- \
- /* ------------------- */ \
- /* Look-up algorithm. */ \
- /* ------------------- */ \
- \
- /* \
- * first_stm(from, target) \
- * \
- * returns a pair (Where, Value) with Value being: \
- * - stc::abstract \
- * - stc::not_delegated \
- * - mlc::not_found \
- * - a type T \
- * and Where being the class where the stm is found. \
- * \
- * \
- * helper_first_stm(curr, target, stm) \
- * { \
- * if (stm == mlc::not_found) \
- * return first_stm(super(curr), target); \
- * else if (stm == stc::final<T>) \
- * return pair(curr, T); \
- * else \
- * return pair(curr, stm); \
- * } \
- * \
- * first_stm(from, target) \
- * { \
- * if (from == mlc::none) \
- * return pair(mlc::none, mlc::not_found); \
- * else \
- * return helper_first_stm(from, target, \
- * get_stm(from, target)); \
- * } \
- * \
- */ \
- \
- template <typename curr, typename target> \
- struct helper_first_stm < curr, target, \
- /* if stm == */ mlc::not_found > \
- { \
- typedef typename first_stm<stc_super(curr), target>::ret ret; \
- }; \
- \
- template <typename curr, typename target, typename T> \
- struct helper_first_stm < curr, target, \
- /* if stm == */ stc::final<T> > \
- { \
- typedef mlc::pair_<curr, T> ret; \
- }; \
- \
- template <typename curr, typename target, typename stm> \
- struct helper_first_stm /* otherwise */ \
- { \
- typedef mlc::pair_<curr, stm> ret; \
- }; \
- \
- template <typename target> \
- struct first_stm < /* if from == */ mlc::none, target > \
- { \
- typedef mlc::pair_<mlc::none, mlc::not_found> ret; \
- }; \
- \
- template <typename from, typename target> \
- struct first_stm /* otherwise */ \
- { \
- typedef typename helper_first_stm<from, target, \
- stc_stm(from, target)>::ret ret; \
- }; \
- \
- \
- \
- /* \
- * superior_find(from, target) \
- * \
- * returns: \
- * either mlc::not_found \
- * or a type T \
- * behavior: \
- * - the stm stc::not_delegated is ignored \
- * - error when stc::abstract is reached \
- * \
- * helper_superior_find(from, target, curr, stm) \
- * { \
- * if (stm == stc::abstract) \
- * error("<target> declared in <curr> but not defined at <from>"); \
- * else if (stm == mlc::not_found or \
- * stm == stc::not_delegated) \
- * return superior_find(from, target, super(curr)); \
- * else if (stm == stc::final<T>) \
- * return T; \
- * else \
- * return stm; \
- * } \
- * \
- * superior_find(from, target, curr = from) \
- * { \
- * if (curr == mlc::none) \
- * return mlc::not_found; \
- * else \
- * return helper_superior_find(from, target, curr, \
- * get_stm(curr, target)); \
- * } \
- */ \
- \
- template <typename from, typename target, typename curr> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ stc::abstract > \
- { \
- /* FIXME: error("<target> declared in <curr> but not defined at <from>"); */ \
- }; \
- \
- template <typename from, typename target, typename curr> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ mlc::not_found > \
- { \
- typedef typename superior_find< from, target, \
- stc_super(curr) >::ret ret; \
- }; \
- \
- template <typename from, typename target, typename curr> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ stc::not_delegated > \
- { \
- typedef typename superior_find< from, target, \
- stc_super(curr) >::ret ret; \
- }; \
- \
- template <typename from, typename target, typename curr, typename T> \
- struct helper_superior_find < from, target, curr, \
- /* if stm == */ stc::final<T> > \
- { \
- typedef T ret; \
- }; \
- \
- template <typename from, typename target, typename curr, typename stm> \
- struct helper_superior_find /* otherwise */ \
- { \
- typedef stm ret; \
- }; \
- \
- template <typename from, typename target> \
- struct superior_find < from, target, /* if curr == */ mlc::none > \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- template <typename from, typename target, typename curr> \
- struct superior_find /* otherwise */ \
- { \
- typedef typename helper_superior_find<from, target, curr, \
- stc_stm(curr, target)>::ret ret; \
- }; \
- \
- \
- \
- /* \
- * delegator_find(from, target) \
- * \
- * \
- * delegator_find(from, target) \
- * { \
- * precondition(target != delegatee_type); \
- * delegatee = superior_find(from, delegatee_type); \
- * if (delegatee == mlc::not_found) \
- * return mlc::not_found; \
- * else \
- * return find(delegatee, target); \
- * } \
- */ \
- \
- template <typename from, typename target> \
- struct helper_delegator_find < from, target, \
- /* if delegatee == */ mlc::not_found > \
- { \
- typedef mlc::not_found ret; \
- }; \
- \
- template <typename from, typename target, typename delegatee> \
- struct helper_delegator_find /* otherwise */ \
- { \
- typedef typename find<delegatee, target>::ret ret; \
- }; \
- \
- template <typename from, typename target> \
- struct delegator_find \
- { \
- typedef typename superior_find<from, typedef_::delegatee_type>::ret delegatee; \
- typedef typename helper_delegator_find<from, target, delegatee>::ret ret; \
- }; \
- \
- \
- \
- /* \
- * helper_find(from, target, where, res) \
- * \
- * \
- * \
- */ \
- \
- template <typename from, typename target, typename where> \
- struct helper_find < from, target, where, \
- /* if res == */ mlc::not_found > \
- { \
- typedef typename delegator_find<from, target>::ret ret; \
- }; \
- \
- template <typename from, typename target, typename where> \
- struct helper_find < from, target, where, \
- /* if res == */ stc::abstract > \
- { \
- typedef typename delegator_find<from, target>::ret res_d; \
- struct check_ \
- : mlc::assert_< mlc::is_found_<res_d>, \
- ERROR::vtype_declared_but_not_defined \
- < ERROR::_for_vtype_<target>, \
- ERROR::_declaration_is_in_<where>, \
- ERROR::_definition_is_looked_up_from_<from> > > \
- /* FIXME: error("<target> declared in <where> but not defined at <from>"); */ \
- { \
- typedef res_d ret; \
- }; \
- typedef typename check_::ret ret; \
- }; \
- \
- template <typename from, typename target, typename where> \
- struct helper_find < from, target, where, \
- /* if res == */ stc::not_delegated > \
- { \
- typedef typename superior_find<from, target>::ret ret; \
- }; \
- \
- template <typename from, typename target, typename where, typename res> \
- struct helper_find /* otherwise */ \
- { \
- typedef res ret; \
- }; \
- \
- \
- \
- /* \
- * find(from, target) \
- * \
- * FIXME: ... \
- * \
- * find(from, target) \
- * { \
- * if (target == delegatee_type) \
- * return superior_find(from, delegatee_type); \
- * else \
- * return helper_find(from, target); \
- * } \
- */ \
- \
- template <typename from> \
- struct find <from, /* if target == */ typedef_::delegatee_type > \
- { \
- typedef typename superior_find<from, typedef_::delegatee_type>::ret ret; \
- }; \
- \
- template <typename from, typename target> \
- struct find /* otherwise */ \
- { \
- typedef typename first_stm<from, target>::ret stm; \
- typedef mlc_elt(stm, 1) where; \
- typedef mlc_elt(stm, 2) res; \
- typedef typename helper_find<from, target, \
- where, res>::ret ret; \
- }; \
- \
- \
- } /* end of SCOOPED_NAMESPACE::internal */ \
- \
- \
- /* \
- * find_vtype(from, target) \
- * \
- * FIXME:... \
- * \
- */ \
- \
- template <typename from, typename target> \
- struct deferred_vtype \
- { \
- typedef typename internal::find<from, target>::ret ret; \
- }; \
- \
- template <typename from, typename target> \
- struct find_vtype \
- { \
- typedef typename internal::find<from, target>::ret ret; \
- typedef typename internal::check<from, target>::ret chk; \
- }; \
- \
- template <typename from, typename target> \
- struct vtype \
- { \
- typedef typename find_vtype<from, target>::ret res; \
- struct check_ : mlc::assert_< mlc::is_found_<res> > \
- { \
- typedef res ret; \
- }; \
- typedef typename check_::ret ret; \
- }; \
- \
- \
- \
- mlc_case_equipment_for_namespace(internal); \
- \
- mlc_decl_typedef(tag); \
- mlc_decl_typedef(category); \
- mlc_decl_typedef(exact_type); \
- \
- \
- namespace internal \
- { \
- \
- \
- template < template <class> class abstraction, \
- unsigned num = 1 > \
- struct selector \
- { \
- protected: selector() {} \
- }; \
- \
- \
- /* fwd decl */ \
- template < template <class> class abstraction, typename E, unsigned num > \
- struct plug_node; \
- \
- template < template <class> class abstraction, \
- typename E, \
- unsigned num, \
- typename another_selector = mlc::false_ > \
- struct next_plug_node \
- { \
- /* here: no other selector */ \
- protected: next_plug_node() {} \
- }; \
- \
- template < template <class> class abstraction, \
- typename E > \
- struct next_plug_node < abstraction, E, 1, mlc::false_ > \
- : public abstraction<E> \
- { \
- protected: next_plug_node() {} \
- }; \
- \
- \
- template < template <class> class abstraction, \
- typename E, \
- unsigned num > \
- struct next_plug_node < abstraction, \
- E, \
- num, \
- mlc::true_> \
- \
- : /* plug to client selectors */ \
- public virtual switch_< selector<abstraction, num>, E >::ret, \
- \
- /* here: another selector (number is 'num + 1') */ \
- public plug_node<abstraction, E, num + 1> \
- { \
- protected: next_plug_node() {} \
- }; \
- \
- \
- template < template <class> class abstraction, \
- typename E, \
- unsigned num > \
- struct plug_node \
- : public next_plug_node< abstraction, \
- E, \
- num, \
- typename mlc::is_defined_< case_< selector<abstraction, num>, \
- E, 1 > >::eval > \
- { \
- protected: plug_node() {} \
- }; \
- \
- \
- template < template <class> class abstraction, \
- unsigned num, \
- typename E > \
- struct default_case_ < selector<abstraction, num>, \
- E > \
- { \
- typedef abstraction<E> ret; \
- }; \
- \
- \
- template < template <class> class abstraction, \
- typename E > \
- struct plug : public plug_node<abstraction, E, 1> \
- { \
- protected: plug() {} \
- }; \
- \
- template <typename abstraction, typename E> \
- struct top; \
- \
- template <template<class> class abstraction, typename E> \
- struct top < stc::is<abstraction>, E > : public plug< abstraction, E > \
- { \
- protected: top() {} \
- }; \
- \
- template <typename E> \
- struct top < mlc::not_found, E > \
- { \
- protected: top() {} \
- }; \
- \
- \
- } /* end of namespace internal */ \
- \
- \
- \
- /* top class */ \
- \
- template <typename E> struct top; \
- \
- template <typename E> \
- struct vtypes< top<E> > \
- { \
- typedef mlc::none super_type; \
- typedef stc::abstract category; \
- typedef stc::final<E> exact_type; \
- }; \
- \
- template <typename E> \
- struct top : public internal::top< stc_find_type(E, category), E > \
- { \
- protected: \
- top() {} \
- }; \
- \
- \
- \
- /* concept class */ \
- \
- template <typename E> \
- struct Concept : public virtual stc::any<E> \
- { \
- protected: \
- Concept() {} \
- }; \
- \
- \
- namespace automatic \
- { \
- \
- template < template <class> class abstraction, typename E, typename tag = void > \
- struct impl \
- /* undefined */ ; \
- \
- template < template <class> class abstraction, typename E > \
- struct impl< abstraction, E, mlc::not_found > \
- { /* nothing */ }; \
- \
- template < template <class> class abstraction, typename E > \
- struct impl< abstraction, E, void > : impl< abstraction, E, stc_find_type(E, tag) > \
- { /* fetch impl w.r.t. tag */ }; \
- \
- } /* end of namespace automatic */ \
- \
- \
- \
-} /* end of SCOOPED_NAMESPACE */ \
- \
- \
-struct e_n_d__w_i_t_h___s_e_m_i_c_o_l_o_n;
-
-
-/*
-
-
-// --------------------------------------------
-// O L D B U N C H O F M A C R O S
-// --------------------------------------------
-
-
-
-# define stc_find_vtype_(Namespace, From, Target) \
- Namespace::find_vtype<From, Namespace::typedef_::Target##_type>::ret
-
-# define stc_find_vtype(Namespace, From, Target) \
- typename stc_find_vtype_(Namespace, From, Target)
-
-
-
-# define stc_deferred_vtype_(Namespace, From, Target) \
- Namespace::deferred_vtype<From, Namespace::typedef_::Target##_type>::ret
-
-# define stc_deferred_vtype(Namespace, From, Target) \
- typename stc_deferred_vtype_(Namespace, From, Target)
-
-
-
-# define stc_vtype_(Namespace, From, Target) \
- Namespace::vtype<From, Namespace::typedef_::Target##_type>::ret
-
-# define stc_vtype(Namespace, From, Target) \
- typename stc_vtype_(Namespace, From, Target)
-
-
-
-# define stc_find_deduce_vtype_(Namespace, From, Target1, Target2) \
- Namespace::find_vtype< Namespace::find_vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-# define stc_find_deduce_vtype(Namespace, From, Target1, Target2) \
- typename \
- Namespace::find_vtype< typename \
- Namespace::find_vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-
-
-# define stc_deduce_deferred_vtype(Namespace, From, Target1, Target2) \
- typename \
- Namespace::deferred_vtype< typename \
- Namespace::deferred_vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret \
-
-
-
-# define stc_deduce_vtype_(Namespace, From, Target1, Target2) \
- Namespace::vtype< Namespace::vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-# define stc_deduce_vtype(Namespace, From, Target1, Target2) \
- typename \
- Namespace::vtype< typename \
- Namespace::vtype<From, \
- Namespace::typedef_::Target1##_type>::ret, \
- Namespace::typedef_::Target2##_type>::ret
-
-
-// # define stc_vtype_is_found_(Namespace, From, Target)
-// mlc::is_found_< Namespace::find_vtype<From, Namespace::typedef_::Target##_type>::ret >
-
-
-// ----------------------------------------------------------
-// E N D O F O L D B U N C H O F M A C R O S
-// ----------------------------------------------------------
-
-*/
-
-
-
-
-# define stc_type_(From, Type) vtype<From, typedef_::Type>::ret
-# define stc_type(From, Type) typename stc_type_(From, Type)
-
-# define stc_find_type(From, Type) typename find_vtype<From, typedef_::Type>::ret
-
-
-// For concepts.
-# define stc_typename(Type) typedef stc_type(Exact, Type) Type
-# define stc_using(Type) typedef typename super::Type Type
-
-
-// For impl classes.
-# define stc_lookup(Type) typedef typename vtype< stc_type(current, exact_type), typedef_::Type>::ret Type
-
-// typedef stc_type(current, Type) Type
-
-
-# define stc_prop(Name) mlc::eq_< stc_find_type(E, Name), mlc::true_ >
-
-
-// sugar:
-
-# define stc_Header \
- \
-templ class classname ; /* fwd decl */ \
- \
-templ struct vtypes< current > /* vtypes */ \
-{ \
- typedef super super_type \
-
-# define stc_End }
-
-
-
-#endif // ! STC_SCOOP2_HH
Index: doc/tiny/cpp_with_virtual_types/main.cc
===================================================================
--- doc/tiny/cpp_with_virtual_types/main.cc (revision 734)
+++ doc/tiny/cpp_with_virtual_types/main.cc (working copy)
@@ -1,4 +1,36 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/cpp_with_virtual_types/main.cc
+
+ \brief Tiny sample use in pseudo-C++ (C++ with virtual types). */
+
+
namespace abc
{
Index: doc/tiny/design/main.cc
===================================================================
--- doc/tiny/design/main.cc (revision 734)
+++ doc/tiny/design/main.cc (working copy)
@@ -1,4 +1,35 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/design/main.cc
+
+ \brief Tiny sample use in a pseudo-language. */
+
namespace abc
{
@@ -14,6 +45,8 @@
array_iterator : [T: type] -> class =
{
+ category : type = Iterator;
+
value : type = T
next : () -> void = { i_ := i_ + 1 }
is_valid : const () -> bool = { return i_ >= 0 and i_ < n_ }
Index: doc/tiny/local/scoop.hh
===================================================================
--- doc/tiny/local/scoop.hh (revision 0)
+++ doc/tiny/local/scoop.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2005, 2006 EPITA Research and Development Laboratory
+// Copyright (C) 2005, 2006, 2007 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
@@ -25,14 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/* \file stc/scoop2.hh
+/* \file doc/tiny/local/scoop.hh
- \brief Equipment for SCOOP2: notably, Virtual types (also known as
- ``properties'') mechanism.
-*/
+ \brief Equipment for SCOOP 2 which mimics the file stc/scoop2.hh. */
-#ifndef STC_SCOOP2_HH
-# define STC_SCOOP2_HH
+#ifndef STC_DOC_TINY_LOCAL_SCOOP_HH
+# define STC_DOC_TINY_LOCAL_SCOOP_HH
# include <mlc/flags.hh>
# include <mlc/typedef.hh>
@@ -64,10 +62,15 @@
template < template <class> class >
struct is;
+ typedef mlc::bexpr_<true> true_;
+ typedef mlc::bexpr_<false> false_;
+
} // end of namespace stc
+#define stc_decl_associated_type mlc_decl_typedef
+
#define stc_super(T) typename vtypes< T >::super_type
#define stc_stm(From, Target) typename get_stm< From , Target >::ret
@@ -1034,7 +1037,7 @@
// typedef stc_type(current, Type) Type
-# define stc_prop(Name) mlc::eq_< stc_find_type(E, Name), mlc::true_ >
+# define stc_prop(Name) stc_find_type(E, Name)
// sugar:
@@ -1051,4 +1054,4 @@
-#endif // ! STC_SCOOP2_HH
+#endif // ! STC_DOC_TINY_LOCAL_SCOOP_HH
Index: doc/tiny/local/undefs.hh
===================================================================
--- doc/tiny/local/undefs.hh (revision 0)
+++ doc/tiny/local/undefs.hh (working copy)
@@ -1,4 +1,36 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/local/undefs.hh
+
+ \brief Utility file for tiny sample uses of SCOOP 2. */
+
+
#undef current
#undef super
#undef templ
Index: doc/tiny/cpp_with_concepts/main.cc
===================================================================
--- doc/tiny/cpp_with_concepts/main.cc (revision 734)
+++ doc/tiny/cpp_with_concepts/main.cc (working copy)
@@ -1,4 +1,36 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/cpp_with_concepts/main.cc
+
+ \brief Tiny sample use with C++Ox; it should compile with ConceptGCC. */
+
+
#include <iostream>
Index: doc/tiny/classical/main.cc
===================================================================
--- doc/tiny/classical/main.cc (revision 734)
+++ doc/tiny/classical/main.cc (working copy)
@@ -1,4 +1,36 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/classical/main.cc
+
+ \brief Tiny sample use in classical OOP. */
+
+
namespace abc
{
Index: doc/tiny/generic_programming/main.cc
===================================================================
--- doc/tiny/generic_programming/main.cc (revision 734)
+++ doc/tiny/generic_programming/main.cc (working copy)
@@ -1,4 +1,35 @@
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
+// 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.
+
+/* \file doc/tiny/generic_programming/main.cc
+
+ \brief Tiny sample use in (simple) C++ generic programming. */
+
namespace abc
{
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Configure new Makefiles of static/samples.
* configure.ac: Declare CONCEPTCXX as a previous variable.
Look for a Concept C++ compiler, and store it in CONCEPTCXX.
Configure static/samples/Makefile,
static/samples/mini-oln/Makefile and
static/samples/mini-oln/concept-c.
configure.ac | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
Index: configure.ac
--- configure.ac (revision 733)
+++ configure.ac (working copy)
@@ -46,12 +46,18 @@
fi
+## ----------------------------- ##
+## Concept C++ compiler set up. ##
+## ----------------------------- ##
+
+AC_ARG_VAR([CONCEPTCXX], [Concept C++ compiler])
+AC_CHECK_PROGS([CONCEPTCXX], [conceptg++ conceptc++])
+
+
## ------- ##
## Tests. ##
## ------- ##
-# Students should create their test suite in tests/. Add the needed
-# configure options here.
AC_CONFIG_FILES([
metalic/tests/Makefile
extended/tests/Makefile
@@ -76,6 +82,9 @@
extended/xtd/Makefile
static/Makefile
static/stc/Makefile
+ static/samples/Makefile
+ static/samples/mini-oln/Makefile
+ static/samples/mini-oln/concept-c++/Makefile
olena/Makefile
olena/oln/Makefile
olena/img/Makefile
1
0