You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(51) |
Nov
(8) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(32) |
Feb
(47) |
Mar
(6) |
Apr
(19) |
May
(7) |
Jun
(19) |
Jul
(39) |
Aug
(51) |
Sep
(39) |
Oct
(18) |
Nov
(10) |
Dec
(27) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <den...@us...> - 2010-01-19 10:54:41
|
Revision: 95 http://stdair.svn.sourceforge.net/stdair/?rev=95&view=rev Author: denis_arnaud Date: 2010-01-19 10:54:35 +0000 (Tue, 19 Jan 2010) Log Message: ----------- [Conf] Improved the M4 macro file for MPICH2 (the mpich2version tool is no longer required). Modified Paths: -------------- trunk/stdair/config/mpich2.m4 Modified: trunk/stdair/config/mpich2.m4 =================================================================== --- trunk/stdair/config/mpich2.m4 2010-01-16 22:47:13 UTC (rev 94) +++ trunk/stdair/config/mpich2.m4 2010-01-19 10:54:35 UTC (rev 95) @@ -151,14 +151,14 @@ if test -z "$MPICH2_verdir" then - AC_MSG_ERROR([Did not find $MPICH2_VERBIN tool in '$MPICH2_bin_check']) + AC_MSG_RESULT([Did not find $MPICH2_VERBIN tool, but will try to determine the version with other tricks]) + else + case "$MPICH2_verdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Mpich2 tool directory ($MPICH2_verdir) must be an absolute path.]) ;; + esac fi - case "$MPICH2_verdir" in - /* ) ;; - * ) AC_MSG_ERROR([The Mpich2 tool directory ($MPICH2_verdir) must be an absolute path.]) ;; - esac - AC_MSG_RESULT([$MPICH2_verdir]) # @@ -168,7 +168,10 @@ AC_MSG_CHECKING([for Mpich2 version >= $min_mpich2_version]) # Derive the full version, e.g., 1.2.1 - MPICH2_VERSION=`${MPICH2_verdir}/${MPICH2_VERBIN} --version | cut -f2` + if test ! -z "$MPICH2_verdir" + then + MPICH2_VERSION=`${MPICH2_verdir}/${MPICH2_VERBIN} --version | cut -f2` + fi if test -z "${MPICH2_VERSION}" ; then MPICH2_VERSION=${MPICH2_DEF_VERSION} fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-16 22:47:22
|
Revision: 94 http://stdair.svn.sourceforge.net/stdair/?rev=94&view=rev Author: denis_arnaud Date: 2010-01-16 22:47:13 +0000 (Sat, 16 Jan 2010) Log Message: ----------- [Conf] Improved the M4 macro files for MySQL, SOCI, Boost, MPICH2 and OpenMPI. Modified Paths: -------------- trunk/stdair/config/ax_boost.m4 trunk/stdair/config/ax_mysql.m4 trunk/stdair/config/mpich2.m4 trunk/stdair/config/openmpi.m4 trunk/stdair/config/soci.m4 Removed Paths: ------------- trunk/stdair/config/mysql.m4 Modified: trunk/stdair/config/ax_boost.m4 =================================================================== --- trunk/stdair/config/ax_boost.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/ax_boost.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -69,6 +69,7 @@ # AC_CANONICAL_BUILD BOOST_MDW_VERSION="1-33-1" BOOSTLIB_MDW_VERSION="1_33_1" +BOOST_version_header="boost/version.hpp" if test "x$want_boost" = "xyes"; then boost_lib_version_req=ifelse([$1], ,1.20.0,$1) @@ -87,14 +88,18 @@ dnl this location is chosen if boost libraries are installed dnl with the --layout=system option dnl or if you install boost with RPM - if test -d /lib64; then + if test -d /lib64 + then BOOST_LIBDIRTYPE="lib64" else BOOST_LIBDIRTYPE="lib" fi - if test "$ac_boost_path" != ""; then - if test "$BOOST_LIBDIRTYPE" == "lib64"; then - if test -d "$ac_boost_path/$BOOST_LIBDIRTYPE" && test -r "$ac_boost_path/$BOOST_LIBDIRTYPE"; then + if test "$ac_boost_path" != "" + then + if test "$BOOST_LIBDIRTYPE" == "lib64" + then + if test -d "$ac_boost_path/$BOOST_LIBDIRTYPE" && test -r "$ac_boost_path/$BOOST_LIBDIRTYPE" + then BOOST_LIBS="-L$ac_boost_path/$BOOST_LIBDIRTYPE" else BOOST_LIBS="-L$ac_boost_path/lib" @@ -103,19 +108,28 @@ BOOST_LIBS="-L$ac_boost_path/lib" fi BOOST_CFLAGS="-I$ac_boost_path/include" + BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path/include/${BOOST_version_header} | cut -d' ' -f3 | cut -d\" -f2` else - for ac_boost_path_tmp in /usr /usr/local /opt /nastools/boost ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then + for ac_boost_path_tmp in /usr /usr/local /opt /nastools/boost + do + if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost" + then BOOST_LIBS="-L$ac_boost_path_tmp/$BOOST_LIBDIRTYPE" BOOST_CFLAGS="-I$ac_boost_path_tmp/include" + BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path_tmp/include/${BOOST_version_header} | cut -d' ' -f3 | cut -d\" -f2` break; fi - if test -d "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" && test -r "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost"; then + if test -d "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" && test -r "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" + then BOOST_LIBS="-L$ac_boost_path_tmp/$BOOST_LIBDIRTYPE" BOOST_CFLAGS="-I$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION" + BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/${BOOST_version_header} | cut -d' ' -f3 | cut -d\" -f2` dnl Hack for wrongly installed Boost libraries (AMD64 libraries installed in boost/lib directory) - if test -d "$ac_boost_path_tmp/lib" && test -r "$ac_boost_path_tmp/lib" && test ! -d "$ac_boost_path_tmp/lib64"; then + if test -d "$ac_boost_path_tmp/lib" \ + && test -r "$ac_boost_path_tmp/lib" \ + && test ! -d "$ac_boost_path_tmp/lib64" + then BOOST_LIBS="-L$ac_boost_path_tmp/lib" echo "Hack: $BOOST_LIBS" fi @@ -584,10 +598,12 @@ # than MPICH2 # CPPFLAGS_ORIG="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPICH2_CFLAGS}" + CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPIGEN_CFLAGS}" +# CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPICH2_CFLAGS}" # CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${OPENMPI_CFLAGS}" LDFLAGS_ORIG="${LDFLAGS}" - LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPICH2_LIBS}" + LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPIGEN_LIBS}" +# LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPICH2_LIBS}" # LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${OPENMPI_LIBS}" # @@ -606,7 +622,7 @@ AC_LANG_RESTORE ]) - BOOST_PYTHON_LIB="-lboost_python" + BOOST_PYTHON_LIB="-lboost_python ${PYTHON_LIBS} ${PYTHON_ADD_LIBS}" AC_SUBST(BOOST_PYTHON_LIB) # @@ -637,7 +653,7 @@ if test "x$link_mpi" = "xno"; then AC_MSG_NOTICE(Could not link against $ax_lib !) else - BOOST_MPI_LIB="${BOOST_MPI_LIB} ${BOOST_SERIALIZATION_LIB}" + BOOST_MPI_LIB="${BOOST_MPI_LIB} ${BOOST_SERIALIZATION_LIB} ${MPIGEN_LIBS}" fi fi @@ -673,6 +689,7 @@ BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_SERIALIZATION_LIB}" BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_PYTHON_LIB}" BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_MPI_LIB}" + BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${MPIGEN_LIBS}" fi fi Modified: trunk/stdair/config/ax_mysql.m4 =================================================================== --- trunk/stdair/config/ax_mysql.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/ax_mysql.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -63,7 +63,7 @@ * ) AC_MSG_ERROR([The MySQL binary directory ($MYSQL_bindir) must be an absolute path.]) ;; esac - AC_MSG_RESULT([$MYSQL_bindir]) + AC_MSG_RESULT([$MYSQL_CONFIG]) # AC_PATH_PROG(MYSQL_CONFIG, mysql_config, $MYSQL_bindir) @@ -79,7 +79,7 @@ MYSQL_LIB_OPTION=libs fi - if test "x${MYSQL_CONFIG+set}" != xset + if test "x${MYSQL_CONFIG}1" = "x1" then MYSQL_VERSION=`${MYSQL_CONFIG} --version` MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags` @@ -144,6 +144,7 @@ AC_MSG_RESULT([$MYSQL_incdir]) + MYSQL_VERSION=`grep "define MYSQL_SERVER_VERSION" $MYSQL_incdir/mysql_version.h | cut -d\" -f2` MYSQL_CFLAGS="-I${MYSQL_incdir}" MYSQL_LIBS="-L${MYSQL_libdir} -l${MYSQL_C_LIB}" fi Modified: trunk/stdair/config/mpich2.m4 =================================================================== --- trunk/stdair/config/mpich2.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/mpich2.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -202,6 +202,10 @@ # # Make the changes permanent # + HAVE_MPICH2=1 + MPIGEN_VERSION=${MPICH2_VERSION} + MPIGEN_CFLAGS=${MPICH2_CFLAGS} + MPIGEN_LIBS=${MPICH2_LIBS} AC_SUBST(MPICH2_VERSION) AC_SUBST(MPICH2_CFLAGS) AC_SUBST(MPICH2_LIBS) Deleted: trunk/stdair/config/mysql.m4 =================================================================== --- trunk/stdair/config/mysql.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/mysql.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -1,163 +0,0 @@ -dnl @synopsis AX_MYSQL -dnl -dnl This macro tries to find MySQL C API header and library locations. -dnl -dnl We define the following configure script flags: -dnl -dnl --with-mysql: Give prefix for both library and headers, and try -dnl to guess subdirectory names for each. (e.g. Tack /lib and -dnl /include onto given dir name, and other common schemes.) -dnl --with-mysql-lib: Similar to --with-mysql, but for library only. -dnl --with-mysql-include: Similar to --with-mysql, but for headers -dnl only. -dnl -dnl @version 1.2, 2007/02/20 -dnl @author Warren Young <my...@et...> - -AC_DEFUN([AX_MYSQL], -[ - # - # Set up configure script macros - # - AC_ARG_WITH(mysql, - [ --with-mysql=<path> root directory path of MySQL installation], - [MYSQL_lib_check="$with_mysql/lib64/mysql $with_mysql/lib/mysql $with_mysql/lib64 $with_mysql/lib" - MYSQL_inc_check="$with_mysql/include $with_mysql/include/mysql" - MYSQL_bin_check="$with_mysql/bin"], - [MYSQL_lib_check="/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /opt/mysql/lib /opt/mysql/lib/mysql" - MYSQL_inc_check="/usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /opt/mysql/include/mysql" - MYSQL_bin_check="/usr/bin /usr/local/bin /usr/local/mysql/bin"]) - - AC_ARG_WITH(mysql-lib, - [ --with-mysql-lib=<path> directory path of MySQL library installation], - [MYSQL_lib_check="$with_mysql_lib $with_mysql_lib/lib64 $with_mysql_lib/lib $with_mysql_lib/lib64/mysql $with_mysql_lib/lib/mysql"]) - - AC_ARG_WITH(mysql-include, - [ --with-mysql-include=<path> directory path of MySQL header installation], - [MYSQL_inc_check="$with_mysql_include $with_mysql_include/include $with_mysql_include/include/mysql"]) - - - # - # Look for MySQL Configuration Script - # - AC_MSG_CHECKING([for MySQL configuration script]) - MYSQL_CONFIG= - MYSQL_bindir= - for m in $MYSQL_bin_check - do - if test -d "$m" && test -f "$m/mysql_config" - then - MYSQL_CONFIG=$m/mysql_config - MYSQL_bindir=$m - break - fi - done - - if test -z "$MYSQL_bindir" - then - AC_MSG_ERROR([Didn't find $MYSQL_CONFIG binary in '$MYSQL_bin_check']) - fi - - case "$MYSQL_bindir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL binary directory ($MYSQL_bindir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_bindir]) - -# AC_PATH_PROG(MYSQL_CONFIG, mysql_config, $MYSQL_bindir) - - # - # Decide which C API library to use, based on thread support - # - if test "x$acx_pthread_ok" = xyes - then - MYSQL_C_LIB=mysqlclient_r - MYSQL_LIB_OPTION=libs_r - else - MYSQL_C_LIB=mysqlclient - MYSQL_LIB_OPTION=libs - fi - - if test "x${MYSQL_CONFIG+set}" != xset - then - MYSQL_VERSION=`${MYSQL_CONFIG} --version` - MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags` - MYSQL_LIBS=`${MYSQL_CONFIG} --${MYSQL_LIB_OPTION}` - else - # - # Look for MySQL C API library - # - AC_MSG_CHECKING([for MySQL library directory]) - MYSQL_libdir= - for m in $MYSQL_lib_check - do - if test -d "$m" && \ - (test -f "$m/lib$MYSQL_C_LIB.so" \ - || test -f "$m/lib$MYSQL_C_LIB.a") - then - MYSQL_libdir=$m - break - fi - done - - if test -z "$MYSQL_libdir" - then - AC_MSG_ERROR([Didn't find $MYSQL_C_LIB library in '$MYSQL_lib_check']) - fi - - case "$MYSQL_libdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_libdir]) - -# case "$MYSQL_libdir" in -# /usr/lib) ;; -# *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;; -# esac - - # - # Look for MySQL C API headers - # - AC_MSG_CHECKING([for MySQL include directory]) - MYSQL_incdir= - for m in $MYSQL_inc_check - do - if test -d "$m" && test -f "$m/mysql.h" - then - MYSQL_incdir=$m - break - fi - done - - if test -z "$MYSQL_incdir" - then - AC_MSG_ERROR([Didn't find the MySQL include dir in '$MYSQL_inc_check']) - fi - - case "$MYSQL_incdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_incdir]) - - MYSQL_CFLAGS="-I${MYSQL_incdir}" - MYSQL_LIBS="-L${MYSQL_libdir} -l${MYSQL_C_LIB}" - fi - - AC_SUBST(MYSQL_VERSION) - AC_SUBST(MYSQL_CFLAGS) - AC_SUBST(MYSQL_LIBS) - - save_LIBS="$LIBS" - LIBS="$LIBS $MYSQL_LIBS" - AC_CHECK_LIB($MYSQL_C_LIB, mysql_store_result, - [], - [AC_MSG_ERROR([Could not find working MySQL client library!])] - ) - AC_SUBST(MYSQL_C_LIB) - LIBS="$save_LIBS" -]) dnl AX_MYSQL Modified: trunk/stdair/config/openmpi.m4 =================================================================== --- trunk/stdair/config/openmpi.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/openmpi.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -201,6 +201,10 @@ # # Make the changes permanent # + HAVE_OPENMPI=1 + MPIGEN_VERSION=${OPENMPI_VERSION} + MPIGEN_CFLAGS=${OPENMPI_CFLAGS} + MPIGEN_LIBS=${OPENMPI_LIBS} AC_SUBST(OPENMPI_VERSION) AC_SUBST(OPENMPI_CFLAGS) AC_SUBST(OPENMPI_LIBS) Modified: trunk/stdair/config/soci.m4 =================================================================== --- trunk/stdair/config/soci.m4 2010-01-16 21:07:16 UTC (rev 93) +++ trunk/stdair/config/soci.m4 2010-01-16 22:47:13 UTC (rev 94) @@ -22,9 +22,11 @@ AC_ARG_WITH(soci, [ --with-soci=<path> root directory path of Soci installation], [SOCI_lib_check="$with_soci/lib64/soci $with_soci/lib/soci $with_soci/lib64 $with_soci/lib" - SOCI_inc_check="$with_soci/include $with_soci/include/soci"], + SOCI_inc_check="$with_soci/include $with_soci/include/soci" + SOCI_bin_check="$with_soci/bin"], [SOCI_lib_check="/usr/lib64 /usr/lib /usr/lib64/soci /usr/lib/soci /usr/local/lib64 /usr/local/lib /usr/local/lib/soci /usr/local/soci/lib /usr/local/soci/lib/soci /opt/soci/lib /opt/soci/lib/soci" - SOCI_inc_check="/usr/include /usr/include/soci /usr/local/include/soci /usr/local/soci/include /usr/local/soci/include/soci /opt/soci/include /opt/soci/include/soci"]) + SOCI_inc_check="/usr/include /usr/include/soci /usr/local/include/soci /usr/local/soci/include /usr/local/soci/include/soci /opt/soci/include /opt/soci/include/soci" + SOCI_bin_check="/usr/bin /usr/local/bin /usr/local/soci/bin /opt/bin /opt/soci/bin /opt/bin/soci"]) AC_ARG_WITH(soci-lib, [ --with-soci-lib=<path> directory path of Soci library installation], @@ -34,6 +36,41 @@ [ --with-soci-include=<path> directory path of Soci header installation], [SOCI_inc_check="$with_soci_include $with_soci_include/include $with_soci_include/include/soci"]) + # + # Look for Soci Configuration Script + # + AC_MSG_CHECKING([for Soci configuration script]) + SOCI_CONFIG= + SOCI_bindir= + for m in $SOCI_bin_check + do + if test -d "$m" && test -f "$m/soci-config" + then + SOCI_CONFIG=$m/soci-config + SOCI_bindir=$m + break + fi + done + +# if test -z "$SOCI_bindir" +# then +# AC_MSG_ERROR([Didn't find $SOCI_CONFIG binary in '$SOCI_bin_check']) +# fi + +# case "$SOCI_bindir" in +# /* ) ;; +# * ) AC_MSG_ERROR([The Soci binary directory ($SOCI_bindir) must be an absolute path.]) ;; +# esac + + AC_MSG_RESULT([$SOCI_CONFIG]) + +# AC_PATH_PROG(SOCI_CONFIG, soci-config, $SOCI_bindir) + + if test "x${SOCI_CONFIG}1" != "x1" + then + SOCI_VERSION=`${SOCI_CONFIG} --version` + fi + # SOCI library SOCI_CORE_LIB=soci_core SOCI_MYSQL_LIB=soci_mysql This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-16 21:07:23
|
Revision: 93 http://stdair.svn.sourceforge.net/stdair/?rev=93&view=rev Author: denis_arnaud Date: 2010-01-16 21:07:16 +0000 (Sat, 16 Jan 2010) Log Message: ----------- [Conf] Improved the M4 macro files for MPICH2, OpenMPI and Python. Modified Paths: -------------- trunk/stdair/config/mpich2.m4 trunk/stdair/config/openmpi.m4 trunk/stdair/config/python.m4 Modified: trunk/stdair/config/mpich2.m4 =================================================================== --- trunk/stdair/config/mpich2.m4 2010-01-14 17:32:54 UTC (rev 92) +++ trunk/stdair/config/mpich2.m4 2010-01-16 21:07:16 UTC (rev 93) @@ -56,9 +56,11 @@ AC_ARG_WITH(mpich2, [ --with-mpich2=<path> root directory path of Mpich2 installation], [MPICH2_lib_check="$with_mpich2/lib${MODE}/mpich2 $with_mpich2/lib/mpich2 $with_mpich2/lib${MODE} $with_mpich2/lib" - MPICH2_inc_check="$with_mpich2/include $with_mpich2/include/mpich2 $with_mpich2/include/mpich2/${MPIDIR}"], - [MPICH2_lib_check="/usr/lib${MODE} /usr/lib /usr/lib${MODE}/mpich2 /usr/lib/mpich2 /usr/lib${MODE}/mpich2/lib /usr/lib/mpich2/lib /usr/lib${MODE}/mpich2/${MPIDIR} /usr/lib/mpich2/${MPIDIR} /usr/local/lib${MODE} /usr/local/lib /usr/local/lib${MODE}/mpich2 /usr/local/lib/mpich2 /usr/local/lib${MODE}/mpich2/${MPIDIR} /usr/local/lib/mpich2/${MPIDIR} /usr/local/mpich2/lib${MODE} /usr/local/mpich2/lib /usr/local/mpich2/${MPIDIR}/lib${MODE} /usr/local/mpich2/${MPIDIR}/lib$ /opt/mpich2/lib /opt/mpich2/${MPIDIR}/lib /opt/mpich2/lib/mpich2" - MPICH2_inc_check="/usr/include /usr/include/mpich2 /usr/include/mpich2/${MPIDIR} /usr/local/include /usr/local/include/mpich2 /usr/local/include/mpich2/${MPIDIR} /opt/mpich2/include /opt/mpich2/${MPIDIR}/include"]) + MPICH2_inc_check="$with_mpich2/include $with_mpich2/include/mpich2 $with_mpich2/include/mpich2/${MPIDIR}" + MPICH2_bin_check="$with_mpich2/bin $with_mpich2/lib${MODE}/mpich2/bin $with_mpich2/lib/mpich2/bin $with_mpich2/lib${MODE}/bin $with_mpich2/lib/bin"], + [MPICH2_lib_check="/usr/lib${MODE} /usr/lib /usr/lib${MODE}/mpich2 /usr/lib/mpich2 /usr/lib${MODE}/mpich2/lib /usr/lib/mpich2/lib /usr/lib${MODE}/mpich2/${MPIDIR} /usr/lib/mpich2/${MPIDIR} /usr/local/lib${MODE} /usr/local/lib /usr/local/lib${MODE}/mpich2 /usr/local/lib/mpich2 /usr/local/lib${MODE}/mpich2/${MPIDIR} /usr/local/lib/mpich2/${MPIDIR} /usr/local/mpich2/lib${MODE} /usr/local/mpich2/lib /usr/local/mpich2/${MPIDIR}/lib${MODE} /usr/local/mpich2/${MPIDIR}/lib /opt/mpich2/lib /opt/mpich2/${MPIDIR}/lib /opt/mpich2/lib/mpich2" + MPICH2_inc_check="/usr/include /usr/include/mpich2 /usr/include/mpich2-${ARCH} /usr/include/mpich2-${GENARCH} /usr/include/mpich2/${MPIDIR} /usr/local/include /usr/local/include/mpich2 /usr/local/include/mpich2/${MPIDIR} /opt/mpich2/include /opt/mpich2/${MPIDIR}/include" + MPICH2_bin_check="/usr/lib${MODE}/bin /usr/lib/bin /usr/lib${MODE}/mpich2/bin /usr/lib/mpich2/bin /usr/lib${MODE}/mpich2/lib/bin /usr/lib/mpich2/lib/bin /usr/lib${MODE}/mpich2/${MPIDIR}/bin /usr/lib/mpich2/${MPIDIR}/bin /usr/local/lib${MODE}/bin /usr/local/lib/bin /usr/local/lib${MODE}/mpich2/bin /usr/local/lib/mpich2/bin /usr/local/lib${MODE}/mpich2/${MPIDIR}/bin /usr/local/lib/mpich2/${MPIDIR}/bin /usr/local/mpich2/lib${MODE}/bin /usr/local/mpich2/lib/bin /usr/local/mpich2/${MPIDIR}/lib${MODE}/bin /usr/local/mpich2/${MPIDIR}/lib/bin /opt/mpich2/lib/bin /opt/mpich2/${MPIDIR}/lib/bin /opt/mpich2/lib/mpich2/bin"]) AC_ARG_WITH(mpich2-lib, [ --with-mpich2-lib=<path> directory path of Mpich2 library installation], @@ -91,7 +93,7 @@ if test -z "$MPICH2_libdir" then - AC_MSG_ERROR([Didn't find $MPICH2_LIB library in '$MPICH2_lib_check']) + AC_MSG_ERROR([Did not find $MPICH2_LIB library in '$MPICH2_lib_check']) fi case "$MPICH2_libdir" in @@ -106,7 +108,7 @@ # AC_MSG_CHECKING([for Mpich2 include directory]) MPICH2_incdir= - for m in $MPICH2_inc_check + for m in ${MPICH2_inc_check} do if test -d "$m" && test -f "$m/mpi.h" then @@ -117,7 +119,7 @@ if test -z "$MPICH2_incdir" then - AC_MSG_ERROR([Didn't find the Mpich2 include dir in '$MPICH2_inc_check']) + AC_MSG_ERROR([Did not find the Mpich2 include dir in '$MPICH2_inc_check']) fi case "$MPICH2_incdir" in @@ -128,13 +130,45 @@ AC_MSG_RESULT([$MPICH2_incdir]) # + # Look for Mpich2 configuration + # + # Mpich2 configuration binary + MPICH2_VERBIN=mpich2version + + AC_MSG_CHECKING([for Mpich2 configuration]) + MPICH2_verdir= + for m in ${MPICH2_bin_check} + do + if test -d "$m" + then + if (test -x "$m/$MPICH2_VERBIN") + then + MPICH2_verdir=$m + break + fi + fi + done + + if test -z "$MPICH2_verdir" + then + AC_MSG_ERROR([Did not find $MPICH2_VERBIN tool in '$MPICH2_bin_check']) + fi + + case "$MPICH2_verdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Mpich2 tool directory ($MPICH2_verdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MPICH2_verdir]) + + # # Look for Mpich2 version # min_mpich2_version=ifelse([$1], , 1.0.0, $1) AC_MSG_CHECKING([for Mpich2 version >= $min_mpich2_version]) - # Derive the full version, e.g., 1.3.3 - MPICH2_VERSION=`echo ${MPICH2_incdir} | sed 's/.*\/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1.\2.\3/g'` + # Derive the full version, e.g., 1.2.1 + MPICH2_VERSION=`${MPICH2_verdir}/${MPICH2_VERBIN} --version | cut -f2` if test -z "${MPICH2_VERSION}" ; then MPICH2_VERSION=${MPICH2_DEF_VERSION} fi Modified: trunk/stdair/config/openmpi.m4 =================================================================== --- trunk/stdair/config/openmpi.m4 2010-01-14 17:32:54 UTC (rev 92) +++ trunk/stdair/config/openmpi.m4 2010-01-16 21:07:16 UTC (rev 93) @@ -56,9 +56,11 @@ AC_ARG_WITH(openmpi, [ --with-openmpi=<path> root directory path of Openmpi installation], [OPENMPI_lib_check="$with_openmpi/lib${MODE}/openmpi $with_openmpi/lib/openmpi $with_openmpi/lib${MODE} $with_openmpi/lib" - OPENMPI_inc_check="$with_openmpi/include $with_openmpi/include/openmpi $with_openmpi/include/openmpi/${MPIDIR}"], - [OPENMPI_lib_check="/usr/lib${MODE} /usr/lib /usr/lib${MODE}/openmpi /usr/lib/openmpi /usr/lib${MODE}/openmpi/lib /usr/lib/openmpi/lib /usr/lib${MODE}/openmpi/${MPIDIR} /usr/lib/openmpi/${MPIDIR} /usr/local/lib${MODE} /usr/local/lib /usr/local/lib${MODE}/openmpi /usr/local/lib/openmpi /usr/local/lib${MODE}/openmpi/${MPIDIR} /usr/local/lib/openmpi/${MPIDIR} /usr/local/openmpi/lib${MODE} /usr/local/openmpi/lib /usr/local/openmpi/${MPIDIR}/lib${MODE} /usr/local/openmpi/${MPIDIR}/lib$ /opt/openmpi/lib /opt/openmpi/${MPIDIR}/lib /opt/openmpi/lib/openmpi" - OPENMPI_inc_check="/usr/include /usr/include/openmpi /usr/include/openmpi-${ARCH} /usr/include/openmpi-${GENARCH} /usr/include/openmpi/${MPIDIR} /usr/local/include /usr/local/include/openmpi /usr/local/include/openmpi/${MPIDIR} /opt/openmpi/include /opt/openmpi/${MPIDIR}/include"]) + OPENMPI_inc_check="$with_openmpi/include $with_openmpi/include/openmpi $with_openmpi/include/openmpi/${MPIDIR}" + OPENMPI_bin_check="$with_openmpi/lib${MODE}/openmpi/bin $with_openmpi/lib/openmpi/bin $with_openmpi/lib${MODE}/bin $with_openmpi/lib/bin"], + [OPENMPI_lib_check="/usr/lib${MODE} /usr/lib /usr/lib${MODE}/openmpi /usr/lib/openmpi /usr/lib${MODE}/openmpi/lib /usr/lib/openmpi/lib /usr/lib${MODE}/openmpi/${MPIDIR} /usr/lib/openmpi/${MPIDIR} /usr/local/lib${MODE} /usr/local/lib /usr/local/lib${MODE}/openmpi /usr/local/lib/openmpi /usr/local/lib${MODE}/openmpi/${MPIDIR} /usr/local/lib/openmpi/${MPIDIR} /usr/local/openmpi/lib${MODE} /usr/local/openmpi/lib /usr/local/openmpi/${MPIDIR}/lib${MODE} /usr/local/openmpi/${MPIDIR}/lib /opt/openmpi/lib /opt/openmpi/${MPIDIR}/lib /opt/openmpi/lib/openmpi" + OPENMPI_inc_check="/usr/include /usr/include/openmpi /usr/include/openmpi-${ARCH} /usr/include/openmpi-${GENARCH} /usr/include/openmpi/${MPIDIR} /usr/local/include /usr/local/include/openmpi /usr/local/include/openmpi/${MPIDIR} /opt/openmpi/include /opt/openmpi/${MPIDIR}/include" + OPENMPI_bin_check="/usr/lib${MODE}/bin /usr/lib/bin /usr/lib${MODE}/openmpi/bin /usr/lib/openmpi/bin /usr/lib${MODE}/openmpi/lib/bin /usr/lib/openmpi/lib/bin /usr/lib${MODE}/openmpi/${MPIDIR}/bin /usr/lib/openmpi/${MPIDIR}/bin /usr/local/lib${MODE}/bin /usr/local/lib/bin /usr/local/lib${MODE}/openmpi/bin /usr/local/lib/openmpi/bin /usr/local/lib${MODE}/openmpi/${MPIDIR}/bin /usr/local/lib/openmpi/${MPIDIR}/bin /usr/local/openmpi/lib${MODE}/bin /usr/local/openmpi/lib/bin /usr/local/openmpi/${MPIDIR}/lib${MODE}/bin /usr/local/openmpi/${MPIDIR}/lib/bin /opt/openmpi/lib/bin /opt/openmpi/${MPIDIR}/lib/bin /opt/openmpi/lib/openmpi/bin"]) AC_ARG_WITH(openmpi-lib, [ --with-openmpi-lib=<path> directory path of Openmpi library installation], @@ -127,13 +129,45 @@ AC_MSG_RESULT([$OPENMPI_incdir]) # + # Look for OpenMPI configuration + # + # OpenMPI configuration binary + OPENMPI_VERBIN=mpirun + + AC_MSG_CHECKING([for OpenMPI configuration]) + OPENMPI_verdir= + for m in ${OPENMPI_bin_check} + do + if test -d "$m" + then + if (test -x "$m/$OPENMPI_VERBIN") + then + OPENMPI_verdir=$m + break + fi + fi + done + + if test -z "$OPENMPI_verdir" + then + AC_MSG_ERROR([Did not find $OPENMPI_VERBIN tool in '$OPENMPI_bin_check']) + fi + + case "$OPENMPI_verdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Openmpi tool directory ($OPENMPI_verdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$OPENMPI_verdir]) + + # # Look for OpenMPI version # min_openmpi_version=ifelse([$1], , 1.0.0, $1) AC_MSG_CHECKING([for OpenMPI version >= $min_openmpi_version]) # Derive the full version, e.g., 1.3.3 - OPENMPI_VERSION=`echo ${OPENMPI_incdir} | sed 's/.*\/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1.\2.\3/g'` + OPENMPI_VERSION=`${OPENMPI_verdir}/${OPENMPI_VERBIN} --version 2>&1 | grep mpirun | cut -d\) -f2` if test -z "${OPENMPI_VERSION}" ; then OPENMPI_VERSION=${OPENMPI_DEF_VERSION} fi Modified: trunk/stdair/config/python.m4 =================================================================== --- trunk/stdair/config/python.m4 2010-01-14 17:32:54 UTC (rev 92) +++ trunk/stdair/config/python.m4 2010-01-16 21:07:16 UTC (rev 93) @@ -28,11 +28,11 @@ AC_MSG_ERROR([distutils module not found]) fi AC_MSG_CHECKING([Python configuration directory]) -python_version=`${PYTHON} -c "import sys; print sys.version[[:3]]"` +PYTHON_VERSION=`${PYTHON} -c "import sys; print sys.version" | head -1 | cut -d' ' -f1` python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print os.path.join(f(plat_specific=1,standard_lib=1),'config')"` PYTHON_CFLAGS=`${PYTHON} -c "import distutils.sysconfig; print '-I'+distutils.sysconfig.get_python_inc()"` -AC_SUBST(python_version)[]dnl +AC_SUBST(PYTHON_VERSION)[]dnl AC_SUBST(python_configdir)[]dnl AC_SUBST(PYTHON_CFLAGS)[]dnl # This should be enough of a message. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-14 17:33:01
|
Revision: 92 http://stdair.svn.sourceforge.net/stdair/?rev=92&view=rev Author: denis_arnaud Date: 2010-01-14 17:32:54 +0000 (Thu, 14 Jan 2010) Log Message: ----------- [Dev] Added a constructor to the BookingRequestStruct object. Modified Paths: -------------- trunk/stdair/stdair/bom/BookingRequestStruct.cpp trunk/stdair/stdair/bom/BookingRequestStruct.hpp Modified: trunk/stdair/stdair/bom/BookingRequestStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-01-12 15:16:10 UTC (rev 91) +++ trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-01-14 17:32:54 UTC (rev 92) @@ -12,6 +12,14 @@ namespace stdair { // ////////////////////////////////////////////////////////////////////// + BookingRequestStruct::BookingRequestStruct (const AirportCode_T& iOrigin, + const AirportCode_T& iDestination, + const Date_T& iDepartureDate, + const PassengerType_T& iPaxType, + const NbOfSeats_T& iPartySize) { + } + + // ////////////////////////////////////////////////////////////////////// void BookingRequestStruct::toStream (std::ostream& ioOut) const { ioOut << describe(); } Modified: trunk/stdair/stdair/bom/BookingRequestStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-12 15:16:10 UTC (rev 91) +++ trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-14 17:32:54 UTC (rev 92) @@ -82,7 +82,13 @@ /** Display of the structure. */ const std::string describe() const; + public: + // /////////////// Constructors and Destructors ///////////////// + BookingRequestStruct (const AirportCode_T&, const AirportCode_T&, + const Date_T&, const PassengerType_T&, + const NbOfSeats_T&); + private: // /////////////// Attributes ///////////////// /** Origin. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-12 15:16:22
|
Revision: 91 http://stdair.svn.sourceforge.net/stdair/?rev=91&view=rev Author: denis_arnaud Date: 2010-01-12 15:16:10 +0000 (Tue, 12 Jan 2010) Log Message: ----------- [Dev] Improved the recursive display() method. Modified Paths: -------------- trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/FlightDateKey.cpp Modified: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-12 15:16:10 UTC (rev 91) @@ -36,7 +36,7 @@ // //////////////////////////////////////////////////////////////////// const std::string AirportDateKey_T::toString() const { std::ostringstream oStr; - oStr << _origin; + oStr << _parentKey.toString() << " " << _origin; return oStr.str(); } Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-01-12 15:16:10 UTC (rev 91) @@ -6,6 +6,10 @@ #include <ostream> // STDAIR #include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/AirlineFeatureSet.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/SegmentDate.hpp> @@ -13,16 +17,19 @@ #include <stdair/bom/SegmentCabin.hpp> #include <stdair/bom/LegCabin.hpp> #include <stdair/bom/BookingClass.hpp> -#include <stdair/bom/BomList.hpp> -#include <stdair/bom/BomMap.hpp> -#include <stdair/bom/AirlineFeatureSet.hpp> -#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/Network.hpp> +#include <stdair/bom/NetworkDate.hpp> +#include <stdair/bom/AirportDate.hpp> +#include <stdair/bom/OutboundPath.hpp> #include <stdair/bom/BomManager.hpp> namespace stdair { // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const BomRoot& iBomRoot) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Browse the Inventory objects const InventoryList_T& lInventoryList= iBomRoot.getInventoryList (); for (InventoryList_T::iterator itInv = lInventoryList.begin(); @@ -33,12 +40,28 @@ display (oStream, lCurrentInventory); } + // Browse the Network objects + const NetworkList_T& lNetworkList= iBomRoot.getNetworkList (); + for (NetworkList_T::iterator itInv = lNetworkList.begin(); + itInv != lNetworkList.end(); ++itInv) { + const Network& lCurrentNetwork = *itInv; + + // Call recursively the display() method on the children objects + oStream << std::endl; + display (oStream, lCurrentNetwork); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const Inventory& iInventory) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Inventory level - oStream << "Inventory: " << iInventory.toString(); + oStream << "Inventory: " << iInventory.describeKey() << std::endl; // Browse the FlightDate objects const FlightDateList_T& lFDList = iInventory.getFlightDateList (); @@ -49,13 +72,19 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentFD); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const FlightDate& iFlightDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Flight-date level - oStream << "Flight-date: " << iFlightDate.toString(); + oStream << iFlightDate.describeKey() << std::endl; // Browse the LegDate objects const LegDateList_T& lLDList = iFlightDate.getLegDateList(); @@ -76,13 +105,19 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentSD); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const LegDate& iLegDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Leg-date level - oStream << "Leg-date: " << iLegDate.toString(); + oStream << iLegDate.describeKey() << std::endl; // Browse the LegCabin objects const LegCabinList_T& lLCList = iLegDate.getLegCabinList(); @@ -93,20 +128,32 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentLC); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const LegCabin& iLegCabin) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Leg-cabin level - oStream << "Leg-cabin: " << iLegCabin.toString(); + oStream << iLegCabin.describeKey() << std::endl; + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const SegmentDate& iSegmentDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Segment-date level - oStream << "Segment-date: " << iSegmentDate.toString(); + oStream << iSegmentDate.describeKey() << std::endl; // Browse the SegmentCabin objects const SegmentCabinList_T& lSCList = iSegmentDate.getSegmentCabinList(); @@ -117,16 +164,22 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentSC); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const SegmentCabin& iSegmentCabin) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Segment-cabin level - oStream << "Segment-cabin: " << iSegmentCabin.toString(); + oStream << iSegmentCabin.describeKey() << std::endl; // Browse the BookingClass objects - const BookingClassList_T& lBCList = iSegmentCabin.getBookingClassList (); + const BookingClassList_T& lBCList = iSegmentCabin.getBookingClassList(); for (BookingClassList_T::iterator itBC = lBCList.begin(); itBC != lBCList.end(); ++itBC) { const BookingClass& lCurrentBC = *itBC; @@ -134,13 +187,110 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentBC); } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const BookingClass& iBookingClass) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + // Booking-class level - oStream << "Booking class: " << iBookingClass.toString(); + oStream << iBookingClass.describeKey() << std::endl; + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const Network& iNetwork) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << "Network: " << std::endl; + + int j = 1; + const NetworkDateList_T& lNetworkDateList = iNetwork.getNetworkDateList(); + for (NetworkDateList_T::iterator itNetworkDate = + lNetworkDateList.begin(); + itNetworkDate != lNetworkDateList.end(); ++itNetworkDate, ++j) { + const NetworkDate& lCurrentNetworkDate = *itNetworkDate; + + + // Call recursively the display() method on the children objects + display (oStream, lCurrentNetworkDate); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const NetworkDate& iNetworkDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << iNetworkDate.describeKey() << std::endl; + + const AirportDateList_T& lAirportDateList= iNetworkDate.getAirportDateList(); + for (AirportDateList_T::iterator itAirportDate = lAirportDateList.begin(); + itAirportDate != lAirportDateList.end(); ++itAirportDate) { + const AirportDate& lCurrentAirportDate = *itAirportDate; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentAirportDate); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const AirportDate& iAirportDate) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << iAirportDate.describeKey() << std::endl; + + const OutboundPathList_T& lOutboundPathList = + iAirportDate.getOutboundPathList(); + for (OutboundPathList_T::iterator itPath = lOutboundPathList.begin(); + itPath != lOutboundPathList.end(); ++itPath) { + const OutboundPath& lCurrentOutboundPath = *itPath; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentOutboundPath); + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const OutboundPath& iOutboundPath) { + // Store current formatting flags of the given output stream + std::ios::fmtflags oldFlags = oStream.flags(); + + oStream << iOutboundPath.describeKey() << std::endl; + + const SegmentDateList_T& lSegmentDateList = + iOutboundPath.getSegmentDateList(); + for (SegmentDateList_T::iterator itSegmentDate = lSegmentDateList.begin(); + itSegmentDate != lSegmentDateList.end(); ++itSegmentDate) { + const SegmentDate& lCurrentSegmentDate = *itSegmentDate; + + oStream << lCurrentSegmentDate.describeKey() << std::endl; + } + + // Reset formatting flags of the given output stream + oStream.flags (oldFlags); + } + } Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-12 15:16:10 UTC (rev 91) @@ -18,7 +18,10 @@ class SegmentDate; class SegmentCabin; class BookingClass; - + class Network; + class NetworkDate; + class AirportDate; + class OutboundPath; /** Utility class for StdAir objects. */ class BomManager { @@ -79,6 +82,34 @@ logged/dumped. @param const BookingClass& Root of the BOM tree to be displayed. */ static void display (std::ostream&, const BookingClass&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const Network& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const Network&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const NetworkDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const NetworkDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const AirportDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const AirportDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const OutboundPath& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const OutboundPath&); }; } Modified: trunk/stdair/stdair/bom/FlightDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-01-07 15:53:41 UTC (rev 90) +++ trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-01-12 15:16:10 UTC (rev 91) @@ -34,7 +34,7 @@ // //////////////////////////////////////////////////////////////////// const std::string FlightDateKey_T::toString() const { std::ostringstream oStr; - oStr << _flightNumber << ", " << _flightDate; + oStr << _parentKey.toString() << _flightNumber << " " << _flightDate; return oStr.str(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-01-07 15:53:50
|
Revision: 90 http://stdair.svn.sourceforge.net/stdair/?rev=90&view=rev Author: quannaus Date: 2010-01-07 15:53:41 +0000 (Thu, 07 Jan 2010) Log Message: ----------- [Dev] Implemented the network building procedure. Modified Paths: -------------- trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/AirportDateContent.hpp trunk/stdair/stdair/bom/AirportDateStructure.hpp trunk/stdair/stdair/bom/FlightDateKey.hpp trunk/stdair/stdair/bom/InventoryKey.hpp trunk/stdair/stdair/bom/LegDateContent.cpp trunk/stdair/stdair/bom/LegDateContent.hpp trunk/stdair/stdair/bom/LegDateKey.cpp trunk/stdair/stdair/bom/LegDateKey.hpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/NetworkDateStructure.hpp trunk/stdair/stdair/bom/NetworkStructure.hpp trunk/stdair/stdair/bom/OutboundPath.cpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/OutboundPathContent.hpp trunk/stdair/stdair/bom/OutboundPathStructure.hpp trunk/stdair/stdair/bom/OutboundPathTypes.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/SegmentDateContent.cpp trunk/stdair/stdair/bom/SegmentDateContent.hpp trunk/stdair/stdair/bom/SegmentDateKey.cpp trunk/stdair/stdair/bom/SegmentDateKey.hpp trunk/stdair/stdair/factory/FacBomContent.hpp trunk/stdair/stdair/factory/FacBomStructure.hpp Modified: trunk/stdair/stdair/bom/AirportDate.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -4,6 +4,7 @@ // C #include <assert.h> // STDAIR +#include <stdair/basic/BasConst_Inventory.hpp> #include <stdair/bom/AirportDateStructure.hpp> #include <stdair/bom/AirportDate.hpp> #include <stdair/bom/OutboundPath.hpp> @@ -63,6 +64,34 @@ OutboundPathMap_T AirportDate::getOutboundPathMap () const { return _airportDateStructure.getChildrenHolder(); } + + // //////////////////////////////////////////////////////////////////// + void AirportDate:: + buildOutboundPathListList (OutboundPath& ioOutboundPath) { + const OutboundPathKey_T& lOutboundPathKey = ioOutboundPath.getKey(); + const NbOfSegments_T& lNbOfSegments = + lOutboundPathKey.getNbOfSegments (); + assert (lNbOfSegments > 0 + && lNbOfSegments <= MAXIMUM_NUMBER_OF_SEGMENTS_IN_OND); + const NbOfSegments_T lNbOfSegments_m1 = + static_cast<const NbOfSegments_T> (lNbOfSegments - 1); + + // If needed, initialise the list of lists with empty fixed-length + // outbound-path lists. + while (_outboundPathListList.size() <= lNbOfSegments_m1) { + OutboundPathLightList_T lOutboundPathLightList; + _outboundPathListList.push_back (lOutboundPathLightList); + } + + // Retrieve the i-fixed-length Outbound-Path list (i = number of + // segments). + OutboundPathLightList_T& lOutboundPathLightList = + _outboundPathListList.at (lNbOfSegments-1); + + // Add the OutboundPath to that fixed-length-path list. + lOutboundPathLightList.push_back (&ioOutboundPath); + } + } Modified: trunk/stdair/stdair/bom/AirportDate.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/NetworkDate.hpp> #include <stdair/bom/AirportDateStructure.hpp> #include <stdair/bom/AirportDateContent.hpp> #include <stdair/bom/AirportDateTypes.hpp> @@ -26,7 +26,7 @@ // Type definitions /** Definition allowing to retrieve the associated parent BOM content type. */ - typedef FlightDate Parent_T; + typedef NetworkDate Parent_T; /** Definition allowing to retrieve the associated BOM structure type. */ typedef AirportDateStructure_T BomStructure_T; @@ -68,13 +68,22 @@ /** Get a OutboundPathMap_T for iteration methods. */ OutboundPathMap_T getOutboundPathMap () const; - + /** Get the OutboundPathListList. */ + const OutboundPathListList_T& getOutboundPathListList () const { + return _outboundPathListList; + } + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { return _airportDateStructure; } + public: + // //////////// Business Methods ////////////// + /** Build the list of lists of outbound paths. **/ + void buildOutboundPathListList (stdair::OutboundPath&); + protected: /** Constructors are private so as to force the usage of the Factory layer. */ @@ -91,6 +100,11 @@ /** Reference structure. */ BomStructure_T& _airportDateStructure; + /** The list of lists of OutboundPaths, used uniquement for the + construction of the main list of OutboundPaths in + AirportDateStructure. */ + OutboundPathListList_T _outboundPathListList; + }; } Modified: trunk/stdair/stdair/bom/AirportDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/AirportDateContent.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -23,6 +23,11 @@ const BomKey_T& getKey() const { return _key; } + + /** Get the (origin) airport (part of the primary key). */ + const AirportCode_T& getOrigin() const { + return _key.getBoardingPoint(); + } public: // /////////// Display support methods ///////// Modified: trunk/stdair/stdair/bom/AirportDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateStructure.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/AirportDateStructure.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -15,6 +15,7 @@ namespace stdair { // Forward declarations. template <typename BOM> struct BomMap_T; + struct NetworkDateKey_T; /** Wrapper class aimed at holding the actual content, modeled by an external specific AirportDate class (for instance, @@ -103,6 +104,15 @@ return oContentChild_ptr; } + + /** Get the AirportDate (from the Network parent class) corresponding + to the given key (reference date + airport code). + <br>Return the NULL pointer if not existing. */ + Content_T* getAirportDate (const BomKey_T& iAirportDateKey, + const NetworkDateKey_T& iNetworkDateKey)const{ + assert (_parent != NULL); + return _parent->getAirportDate (iAirportDateKey, iNetworkDateKey); + } private: // /////////// Setters ///////////// Modified: trunk/stdair/stdair/bom/FlightDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/FlightDateKey.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -43,6 +43,11 @@ const Date_T& getFlightDate() const { return _flightDate; } + + /** Get the airline code of the flight-date. */ + const AirlineCode_T& getAirlineCode () const { + return _parentKey.getAirlineCode(); + } // /////////// Setters ///////////// /** Set the parent key. */ Modified: trunk/stdair/stdair/bom/InventoryKey.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryKey.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/InventoryKey.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -34,7 +34,9 @@ // /////////// Getters ////////// /** Get the airline code. */ - const AirlineCode_T& getAirlineCode() const; + const AirlineCode_T& getAirlineCode() const { + return _airlineCode; + } // /////////// Display support methods ///////// /** Dump a Business Object Key into an output stream. Modified: trunk/stdair/stdair/bom/LegDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateContent.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/LegDateContent.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -24,9 +24,9 @@ // ////////////////////////////////////////////////////////////////////// const Duration_T LegDateContent::getTimeOffSet() const { - // TimeOffSet = (OffTime - BoardTime) + (OffDate - BoardDate) * 24 + // TimeOffSet = (OffTime - BoardingTime) + (OffDate - BoardingDate) * 24 // - ElapsedTime - Duration_T oTimeOffSet = (_offTime - _boardTime); + Duration_T oTimeOffSet = (_offTime - _boardingTime); const DateOffSet_T& lDateOffSet = getDateOffSet(); const Duration_T lDateOffSetInHours (lDateOffSet.days() * 24, 0, 0); oTimeOffSet += lDateOffSetInHours - _elapsedTime; Modified: trunk/stdair/stdair/bom/LegDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateContent.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/LegDateContent.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -24,9 +24,9 @@ return _key; } - /** Get the board point (part of the primary key). */ - const AirportCode_T& getBoardPoint () const { - return _key.getBoardPoint(); + /** Get the boarding point (part of the primary key). */ + const AirportCode_T& getBoardingPoint () const { + return _key.getBoardingPoint(); } /** Get the off point. */ @@ -34,14 +34,14 @@ return _offPoint; } - /** Get the board date. */ - const Date_T& getBoardDate () const { - return _boardDate; + /** Get the boarding date. */ + const Date_T& getBoardingDate () const { + return _boardingDate; } - /** Get the board time. */ - const Duration_T& getBoardTime () const { - return _boardTime; + /** Get the boarding time. */ + const Duration_T& getBoardingTime () const { + return _boardingTime; } /** Get the off date. */ @@ -85,14 +85,14 @@ } - /** Get the date off set (off date - board date). */ + /** Get the date off set (off date - boarding date). */ const DateOffSet_T getDateOffSet () const { - return _offDate - _boardDate; + return _offDate - _boardingDate; } - /** Get the time off set between board and off points. + /** Get the time off set between boarding and off points. <br>It is defined as being: - TimeOffSet = (OffTime - BoardTime) + (OffDate - BoardDate) * 24 + TimeOffSet = (OffTime - BoardingTime) + (OffDate - BoardingDate) * 24 - ElapsedTime. */ const Duration_T getTimeOffSet() const; @@ -103,14 +103,14 @@ _offPoint = iOffPoint; } - /** Set the board date. */ - void setBoardDate (const Date_T& iBoardDate) { - _boardDate = iBoardDate; + /** Set the boarding date. */ + void setBoardingDate (const Date_T& iBoardingDate) { + _boardingDate = iBoardingDate; } - /** Set the board time. */ - void setBoardTime (const Duration_T& iBoardTime) { - _boardTime = iBoardTime; + /** Set the boarding time. */ + void setBoardingTime (const Duration_T& iBoardingTime) { + _boardingTime = iBoardingTime; } /** Set the off date. */ @@ -172,11 +172,11 @@ /** Off Point. */ AirportCode_T _offPoint; - /** Board Date. */ - Date_T _boardDate; + /** Boarding Date. */ + Date_T _boardingDate; - /** Board Time. */ - Duration_T _boardTime; + /** Boarding Time. */ + Duration_T _boardingTime; /** Off Date. */ Date_T _offDate; Modified: trunk/stdair/stdair/bom/LegDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateKey.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/LegDateKey.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -7,12 +7,12 @@ namespace stdair { // //////////////////////////////////////////////////////////////////// - LegDateKey_T::LegDateKey_T (const AirportCode_T& iBoardPoint) - : _boardPoint (iBoardPoint) { + LegDateKey_T::LegDateKey_T (const AirportCode_T& iBoardingPoint) + : _boardingPoint (iBoardingPoint) { } // //////////////////////////////////////////////////////////////////// LegDateKey_T::LegDateKey_T (const LegDateKey_T& iKey) - : _parentKey (iKey._parentKey), _boardPoint (iKey._boardPoint) { + : _parentKey (iKey._parentKey), _boardingPoint (iKey._boardingPoint) { } // //////////////////////////////////////////////////////////////////// @@ -31,7 +31,7 @@ // //////////////////////////////////////////////////////////////////// const std::string LegDateKey_T::toString() const { std::ostringstream oStr; - oStr << _boardPoint; + oStr << _boardingPoint; return oStr.str(); } Modified: trunk/stdair/stdair/bom/LegDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateKey.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/LegDateKey.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -26,7 +26,7 @@ public: // /////////// Construction /////////// /** Constructors. */ - LegDateKey_T (const AirportCode_T& iBoardPoint); + LegDateKey_T (const AirportCode_T& iBoardingPoint); LegDateKey_T (const LegDateKey_T&); /** Destructor. */ @@ -34,8 +34,8 @@ // /////////// Getters ////////// /** Get the boarding point. */ - const AirportCode_T& getBoardPoint() const { - return _boardPoint; + const AirportCode_T& getBoardingPoint() const { + return _boardingPoint; } // /////////// Setters ///////////// @@ -67,8 +67,8 @@ /** Flight-date Key.*/ ParentKey_T _parentKey; - /** Boarding airport. */ - AirportCode_T _boardPoint; + /** Boardinging airport. */ + AirportCode_T _boardingPoint; }; } Modified: trunk/stdair/stdair/bom/NetworkDate.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -57,6 +57,12 @@ AirportDateMap_T NetworkDate::getAirportDateMap () const { return _networkDateStructure.getChildrenHolder(); } - + + // ////////////////////////////////////////////////////////////////////// + AirportDate* NetworkDate:: + getAirportDate (const AirportDateKey_T& iKey) const { + return _networkDateStructure.getContentChild (iKey); + } + } Modified: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STDAIR -#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/Network.hpp> #include <stdair/bom/NetworkDateStructure.hpp> #include <stdair/bom/NetworkDateTypes.hpp> #include <stdair/bom/AirportDateTypes.hpp> @@ -30,7 +30,7 @@ // ///////////////////////////////////////////////////////////////////////// /** Definition allowing to retrieve the associated parent BOM content type. */ - typedef BomRoot Parent_T; + typedef Network Parent_T; /** Definition allowing to retrieve the associated BOM structure type. */ typedef NetworkDateStructure_T BomStructure_T; @@ -41,9 +41,6 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef AirportDate ContentChild_T; - - /** Definition allowing to retrieve the specific BookingClass type. */ - typedef BookingClass BookingClassContent_T; // ///////////////////////////////////////////////////////////////////////// public: @@ -74,7 +71,12 @@ /** Get a AirportDateMap_T for iteration methods. */ AirportDateMap_T getAirportDateMap () const; - + + /** Retrieve, if existing, the AirportDate corresponding to the + given airport-date key. + <br>If not existing, return the NULL pointer. */ + AirportDate* getAirportDate (const AirportDateKey_T&) const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { Modified: trunk/stdair/stdair/bom/NetworkDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateStructure.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/NetworkDateStructure.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -17,6 +17,7 @@ namespace stdair { // Forward declarations. template <typename BOM> struct BomMap_T; + struct AirportDateKey_T; /** Wrapper class aimed at holding the actual content, modeled by an external specific NetworkDate class (for instance, @@ -109,6 +110,26 @@ return oContentChild_ptr; } + + /** Get the AirportDate (from the Network parent class) corresponding + to the given key (reference date + airport code). + <br>Return the NULL pointer if not existing. */ + ContentChild_T* getAirportDate (const AirportDateKey_T& iAirportDateKey, + const BomKey_T& iNetworkDateKey) const { + assert (_parent != NULL); + ContentChild_T* oAirportDate_ptr = NULL; + + const BOM_CONTENT* lNetworkDate_ptr = + _parent->getContentChild (iNetworkDateKey); + + + if (lNetworkDate_ptr != NULL) { + oAirportDate_ptr = + lNetworkDate_ptr->getAirportDate (iAirportDateKey); + } + + return oAirportDate_ptr; + } private: // /////////// Setters ///////////// Modified: trunk/stdair/stdair/bom/NetworkStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkStructure.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/NetworkStructure.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -60,15 +60,6 @@ /** Define the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; - // /** Define the children booking class type. */ - // typedef typename BOM_CONTENT::BookingClassContent_T BookingClass_T; - - // /** Define the children booking class holder type. */ - // typedef BomChildrenHolderImp<BookingClass_T> BookingClassHolder_T; - - // /** Define the map of booking class. */ - // typedef BomMap_T<BookingClass_T> BookingClassMap_T; - public: // /////////// Getters ///////////// /** Get the (parent) BomStructureRoot object. */ @@ -99,28 +90,22 @@ ioChildrenHolder = _childrenHolder; } - /** Get the holder of booking classes. */ - // BookingClassHolder_T& getBookingClassHolder() const { - // assert (_bookingClassHolder); - // return *_bookingClassHolder; - // } - /** Retrieve, if existing, the network-date corresponding to the given key. <br>If not exissting, return the NULL pointer. */ ContentChild_T* getContentChild (const ChildKey_T& iKey) const { ContentChild_T* oContentChild_ptr= NULL; - // ChildrenMap_T lChildrenMap (getChildrenHolder()); - // const MapKey_T lMapKey = iKey.toString(); + ChildrenMap_T lChildrenMap (getChildrenHolder()); + const MapKey_T lMapKey = iKey.toString(); - // typename ChildrenMap_T::iterator itContentChild = - // lChildrenMap.find (lMapKey); + typename ChildrenMap_T::iterator itContentChild = + lChildrenMap.find (lMapKey); - // if (itContentChild != lChildrenMap.end()) { - // oContentChild_ptr = itContentChild->second; - // assert (oContentChild_ptr != NULL); - // } + if (itContentChild != lChildrenMap.end()) { + oContentChild_ptr = itContentChild->second; + assert (oContentChild_ptr != NULL); + } return oContentChild_ptr; } Modified: trunk/stdair/stdair/bom/OutboundPath.cpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/OutboundPath.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -6,6 +6,9 @@ // STDAIR #include <stdair/bom/OutboundPathStructure.hpp> #include <stdair/bom/OutboundPath.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> namespace stdair { @@ -20,16 +23,16 @@ OutboundPath::~OutboundPath () { } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// void OutboundPath::toStream (std::ostream& ioOut) const { ioOut << toString() << std::endl; } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// void OutboundPath::fromStream (std::istream& ioIn) { } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// std::string OutboundPath::toString() const { std::ostringstream oStr; @@ -42,15 +45,190 @@ return oStr.str(); } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// const std::string OutboundPath::describeKey() const { return _outboundPathStructure.describeKey(); } - // ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// const std::string OutboundPath::describeShortKey() const { return _outboundPathStructure.describeShortKey(); } + + // //////////////////////////////////////////////////////////////////// + SegmentDateList_T OutboundPath::getSegmentDateList () const { + return _outboundPathStructure.getSegmentDateHolder(); + } + + // //////////////////////////////////////////////////////////////////// + SegmentDateMap_T OutboundPath::getSegmentDateMap () const { + return _outboundPathStructure.getSegmentDateHolder(); + } + + // //////////////////////////////////////////////////////////////////// + const Date_T& OutboundPath::getOffDate () const { + const SegmentDate* lLastSegmentDate_ptr = getLastSegmentDate (); + assert (lLastSegmentDate_ptr != NULL); + return (lLastSegmentDate_ptr->getOffDate ()); + } + + // //////////////////////////////////////////////////////////////////// + const SegmentDate* OutboundPath::getLastSegmentDate () const { + const SegmentDate* oSegment_ptr = NULL; + + // Retrieve the last segment of the list + SegmentDateList_T lSegmentDateList = getSegmentDateList(); + SegmentDateList_T::reverse_iterator itLastSegment= lSegmentDateList.rbegin(); + + if (itLastSegment == lSegmentDateList.rend()) { + return oSegment_ptr; + } + + oSegment_ptr = &*itLastSegment; + assert (oSegment_ptr != NULL); + + return oSegment_ptr; + } + + // //////////////////////////////////////////////////////////////////// + const SegmentDate* OutboundPath::getFirstSegmentDate () const { + const SegmentDate* oSegment_ptr = NULL; + + // Retrieve the first segment of the list + SegmentDateList_T lSegmentDateList = getSegmentDateList(); + SegmentDateList_T::iterator itFirstSegment= lSegmentDateList.begin(); + + if (itFirstSegment == lSegmentDateList.end()) { + return oSegment_ptr; + } + + oSegment_ptr = &*itFirstSegment; + assert (oSegment_ptr != NULL); + + return oSegment_ptr; + } + + // //////////////////////////////////////////////////////////////////// + void OutboundPath::incrementTotalFlightTime (const Duration_T& iElapsed) { + _flightTime += iElapsed; + } + + // //////////////////////////////////////////////////////////////////// + void OutboundPath::updateAirlineCode() { + // TODO: to be optimised. + std::ostringstream ostr; + SegmentDateList_T lSegmentDateList = getSegmentDateList(); + + for (SegmentDateList_T::iterator itSegmentDate = lSegmentDateList.begin(); + itSegmentDate != lSegmentDateList.end(); ++itSegmentDate) { + const SegmentDate& lSegmentDate = *itSegmentDate; + ostr << lSegmentDate.getAirlineCode(); + } + + const AirlineCode_T lAirlineCode (ostr.str()); + setAirlineCode(lAirlineCode); + } + + // //////////////////////////////////////////////////////////////////// + AirportDate* OutboundPath::getDestinationAirportDate() const { + AirportDate* oAirportDate_ptr = NULL; + + // Retrieve the off point description (reference date + airport code). + const AirportCode_T& lDestination = getDestination(); + const Date_T& lReferenceDate = getOffDate(); + + const AirportDateKey_T lAirportDateKey (lDestination); + const NetworkDateKey_T lNetworkDateKey (lReferenceDate); + // Retrieve the destination airport corresponding to the destination + // reference date and airport code. + oAirportDate_ptr = _outboundPathStructure.getAirportDate (lAirportDateKey, + lNetworkDateKey); + + return oAirportDate_ptr; + } + + // //////////////////////////////////////////////////////////////////// + bool OutboundPath::isConnectable (const OutboundPath& iOutboundPath) const { + // Delegate the check on the two (potentially) connecting SegmentDate + // objects, i.e., the last SegmentDate of the current OutboundPath, + // and the first SegmentDate of the given OutboundPath. + const SegmentDate* lOffSegment_ptr = getLastSegmentDate(); + assert (lOffSegment_ptr != NULL); + + const SegmentDate* lBoardingSegment_ptr = + iOutboundPath.getFirstSegmentDate(); + assert (lBoardingSegment_ptr != NULL); + + return lOffSegment_ptr->isConnectable (*lBoardingSegment_ptr); + } + + // //////////////////////////////////////////////////////////////////// + bool OutboundPath:: + isAirlineFlown (const AirlineCode_T& iAirlineCode) const { + bool oAirlineFlown = false; + + const SegmentDateList_T& lSegmentDateList = getSegmentDateList (); + for (SegmentDateList_T::iterator itSegmentDate = + lSegmentDateList.begin(); + itSegmentDate != lSegmentDateList.end(); ++itSegmentDate) { + const SegmentDate& lSegmentDate = *itSegmentDate; + + const AirlineCode_T& lSegmentAirlineCode = + lSegmentDate.getAirlineCode(); + if (lSegmentAirlineCode == iAirlineCode) { + oAirlineFlown = true; + break; + } + } + + return oAirlineFlown; + } + + // ////////////////////////////////////////////////////////////////////// + const Duration_T OutboundPath::calculateElapsedTimeFromRouting () const { + const SegmentDateList_T& lAllSegmentList = getSegmentDateList(); + SegmentDateList_T::iterator itSegmentDate = lAllSegmentList.begin(); + + const SegmentDate* lCurrentSegmentDate_ptr = &*itSegmentDate; + assert (lCurrentSegmentDate_ptr != NULL); + + // Retrieve the elapsed time of the first segment + Duration_T oElapsedTime = lCurrentSegmentDate_ptr->getElapsedTime(); + + // Go to the next segment, if existing. If not existing, the following + // loop will not be entered (as it means: + // itSegmentDate == _segmentDateList.end()). + ++itSegmentDate; + + for (const SegmentDate* previousSegmentDate_ptr = lCurrentSegmentDate_ptr; + itSegmentDate != lAllSegmentList.end(); + ++itSegmentDate, previousSegmentDate_ptr = lCurrentSegmentDate_ptr) { + lCurrentSegmentDate_ptr = &*itSegmentDate; + assert (lCurrentSegmentDate_ptr != NULL); + assert (previousSegmentDate_ptr != NULL); + + // As the boarding point (and date) of the current segment are + // the same as the off point (and date) of the previous + // segment (by construction), there is no time difference. + assert (lCurrentSegmentDate_ptr->getBoardingPoint() + == previousSegmentDate_ptr->getOffPoint() + && lCurrentSegmentDate_ptr->getBoardingDate() + == previousSegmentDate_ptr->getOffDate()); + const Duration_T& lStopOverTime = + lCurrentSegmentDate_ptr->getBoardingTime() + - previousSegmentDate_ptr->getOffTime(); + oElapsedTime += lStopOverTime; + + // Add the elapsed time of the current outbound path + const Duration_T& currentElapsedTime = + lCurrentSegmentDate_ptr->getElapsedTime(); + oElapsedTime += currentElapsedTime; + } + + // Store the result + return oElapsedTime; + } + } Modified: trunk/stdair/stdair/bom/OutboundPath.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/OutboundPath.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -10,10 +10,12 @@ #include <stdair/bom/OutboundPathContent.hpp> #include <stdair/bom/AirportDateTypes.hpp> #include <stdair/bom/OutboundPathTypes.hpp> +#include <stdair/bom/SegmentDateTypes.hpp> namespace stdair { // Forward declarations class FacBomContent; + class SegmentDate; struct OutboundPathKey_T; /** Class representing the actual functional/business content for a @@ -37,9 +39,29 @@ BOM content child type. */ typedef OutboundPath ContentChild_T; + /** Definition allowing to retrieve the specific SegmentDate type. */ + typedef SegmentDate SegmentDateContent_T; + public: // /////////// Getters ///////////// - + /** Get a SegmentDateList_T for iteration methods. */ + SegmentDateList_T getSegmentDateList () const; + + /** Get a SegmentDateMap_T for iteration methods. */ + SegmentDateMap_T getSegmentDateMap () const; + + /** Get the off date. */ + const Date_T& getOffDate () const; + + /** Get the last SegmentDate (constant) object of the list. + <br>Return a NULL pointer if the list is empty. */ + const SegmentDate* getLastSegmentDate () const; + + /** Get the first SegmentDate (constant) object of the list. + <br>Return a NULL pointer if the list is empty. */ + const SegmentDate* getFirstSegmentDate () const; + + public: // ///////// Setters ////////// @@ -64,7 +86,58 @@ at the same level). */ const std::string describeShortKey() const; + private: + // ////////////// Business methods ////////////// + /** Increments the total flight time of the outbound path.*/ + void incrementTotalFlightTime (const Duration_T&); + public: + /** Get the AirportDate corresponding to the destination of the + outbound-path, i.e., the off point of the last segment-date + of the (segment) list. + <br>Return the NULL pointer if there is no such AirportDate object, + e.g., when the destination is an end point (i.e., when no other + SegmentDate is starting from the destination). */ + AirportDate* getDestinationAirportDate() const; + + /** States whether or not the given OutboundPath may connect with the + current one. + <br>Basically, the board time of the given OutboundPath should be + such as to allow the passenger connecting from the previous flight + (current OutboundPath object) to the next one (given OutboundPath). + <br>Note that this method relies on the eponym method of the + SegmentDate class. */ + bool isConnectable (const OutboundPath&) const; + + /** State whether or not the given airline is flown by (at least) one of + the segments of the internal list. */ + bool isAirlineFlown (const AirlineCode_T&) const; + + /** Calculate the elapsed time according to the segment routing. + <br>Note that the given segment-date should come at the end of the + outbound-path. An assertion will fail if the given board point and + board date do not correspond to the off point and off date of the + last segment-date of the outbound-path. + <br>That method is a helper function allowing calculating the + elapsed time of a to-be-built OutboundPath object. Indeed, the + elapsed time can not be set after the object creation, as it is + part of the primary key (needed at the time of object creation). + <br>Actually, the elapsed time of the outbound path is the sum of the + elapsed times of the routing segments, plus the stop-over times. + The stop-over time is the difference between the board time of a + routing segment, and the off time of the previous segment. That is, + it is the time spent at the corresponding airport. + <br>Of course, in case of mono-segment outbound pathes, there is no + stop-over, and the elapsed time of the outbound-path is equal to the + elapsed time of the single routing segment. */ + const Duration_T calculateElapsedTimeFromRouting ()const; + + + public: + // ////////////// Business methods ////////////// + /** Update Airline Code. */ + void updateAirlineCode (); + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { Modified: trunk/stdair/stdair/bom/OutboundPathContent.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathContent.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/OutboundPathContent.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -75,7 +75,6 @@ _flightPathCode = iFPCode; } - public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. Modified: trunk/stdair/stdair/bom/OutboundPathStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathStructure.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/OutboundPathStructure.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -11,6 +11,11 @@ #include <stdair/bom/BomStopContent.hpp> namespace stdair { + // Forward declarations. + template <typename BOM> struct BomMap_T; + struct AirportDateKey_T; + struct NetworkDateKey_T; + /** Wrapper class aimed at holding the actual content, modeled by an external specific OutboundPath class (for instance, in the AIRSCHED library). */ @@ -39,6 +44,18 @@ /** Definition allowing to retrieve the default children bom holder type. */ typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; + /** Define the children segment-date type. */ + typedef typename BOM_CONTENT::SegmentDateContent_T SegmentDate_T; + + /** Define the children segment-date holder type. */ + typedef BomChildrenHolderImp<SegmentDate_T> SegmentDateHolder_T; + + /** Define the map of segment-date. */ + typedef BomMap_T<SegmentDate_T> SegmentDateMap_T; + + /** Definition allowing to retrieve the AirportDate type. */ + typedef typename BOM_CONTENT::Parent_T AirportDate_T; + public: // /////////// Getters ///////////// /** Get the (parent) AirportDateStructure object. */ @@ -47,13 +64,30 @@ } /** Get the (parent) AirportDateStructure object. */ - ParentBomStructure_T& getAirportDateStructure() const; + ParentBomStructure_T& getAirportDateStructure() const { + assert (_parent != NULL); + return *_parent; + } - /** Get the segment-cabin key. */ + /** Get the outbound path key. */ const BomKey_T& getKey() const { assert (_content != NULL); return _content->getKey(); } + /** Get the holder of segment-dates. */ + SegmentDateHolder_T& getSegmentDateHolder() const { + assert (_segmentDateHolder); + return *_segmentDateHolder; + } + + /** Get the AirportDate (from the Network parent class) corresponding + to the given key (reference date + airport code). + <br>Return the NULL pointer if not existing. */ + AirportDate_T* getAirportDate (const AirportDateKey_T& iAirportDateKey, + const NetworkDateKey_T& iNetworkDateKey)const{ + assert (_parent != NULL); + return _parent->getAirportDate (iAirportDateKey, iNetworkDateKey); + } private: // /////////// Setters ///////////// @@ -64,6 +98,11 @@ /** Default children holder setter. */ void setChildrenHolder (DefaultChildrenBomHolder_T&) { } + + /** Set the segment-date holder. */ + void setSegmentDateHolder (SegmentDateHolder_T& ioSegmentDateHolder) { + _segmentDateHolder = &ioSegmentDateHolder; + } public: // /////////// Display support methods ///////// @@ -92,7 +131,8 @@ /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ - OutboundPathStructure () : _parent (NULL), _content (NULL) { } + OutboundPathStructure () : _parent (NULL), _content (NULL), + _segmentDateHolder (NULL) { } OutboundPathStructure (const OutboundPathStructure&); /** Destructor. */ @@ -106,6 +146,9 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; + /** Holder of segment-dates. */ + SegmentDateHolder_T* _segmentDateHolder; + }; } Modified: trunk/stdair/stdair/bom/OutboundPathTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathTypes.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/OutboundPathTypes.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -31,6 +31,10 @@ /** Define the booking class map. */ typedef BomMap_T<OutboundPath> OutboundPathMap_T; + + typedef std::vector<std::vector<stdair::OutboundPath*> >OutboundPathListList_T; + typedef std::vector<stdair::OutboundPath*> OutboundPathLightList_T; + } #endif // __STDAIR_BOM_OUTBOUNDPATHTYPES_HPP Modified: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -4,6 +4,7 @@ // C #include <assert.h> // STDAIR +#include <stdair/basic/BasConst_TravelSolution.hpp> #include <stdair/bom/SegmentDateStructure.hpp> #include <stdair/bom/SegmentDate.hpp> #include <stdair/bom/SegmentCabin.hpp> @@ -71,25 +72,25 @@ } // ///////// /////////////////////////////////////////////////////////////// -// bool SegmentDate:: -// isConnectable (const SegmentDate& iSegmentDate) const { -// bool oIsConnectable = false; + bool SegmentDate:: + isConnectable (const SegmentDate& iSegmentDate) const { + bool oIsConnectable = false; + + const Date_T& lOffDate = getOffDate(); + const Date_T& lBoardingDate = iSegmentDate.getBoardingDate(); + const DateOffSet_T lDateOffSet = lBoardingDate - lOffDate; + const Duration_T lDateOffSetInHours (lDateOffSet.days() * 24, 0, 0); + + const Duration_T& lOffTime = getOffTime(); + const Duration_T& lBoardingTime = iSegmentDate.getBoardingTime(); + + const Duration_T lStopOverTime = + lBoardingTime - lOffTime + lDateOffSetInHours; -// const Date_T& lOffDate = getOffDate(); -// const Date_T& lBoardDate = iSegmentDate.getBoardDate(); -// const DateOffSet_T lDateOffSet = lBoardDate - lOffDate; -// const Duration_T lDateOffSetInHours (lDateOffSet.days() * 24, 0, 0); + oIsConnectable = lStopOverTime >= DEFAULT_MINIMUM_CONNECTION_TIME; -// const Duration_T& lOffTime = getOffTime(); -// const Duration_T& lBoardTime = iSegmentDate.getBoardTime(); - -// const Duration_T lStopOverTime = -// lBoardTime - lOffTime + lDateOffSetInHours; - -// oIsConnectable = lStopOverTime >= DEFAULT_MINIMUM_CONNECTION_TIME; - -// return oIsConnectable; -// } + return oIsConnectable; + } } Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -80,7 +80,7 @@ <br>Basically, the board time of the given SegmentDate should be such as to allow the passenger connecting from the previous flight (current SegmentDate object) to the next one (given SegmentDate). */ - // bool isConnectable (const SegmentDate&) const; + bool isConnectable (const SegmentDate&) const; public: // /////////// Display support methods ///////// Modified: trunk/stdair/stdair/bom/SegmentDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateContent.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/SegmentDateContent.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -25,9 +25,9 @@ // ////////////////////////////////////////////////////////////////////// const Duration_T SegmentDateContent::getTimeOffSet() const { - // TimeOffSet = (OffTime - BoardTime) + (OffDate - BoardDate) * 24 + // TimeOffSet = (OffTime - BoardingTime) + (OffDate - BoardingDate) * 24 // - ElapsedTime - Duration_T oTimeOffSet = (_offTime - _boardTime); + Duration_T oTimeOffSet = (_offTime - _boardingTime); const DateOffSet_T& lDateOffSet = getDateOffSet(); const Duration_T lDateOffSetInHours (lDateOffSet.days() * 24, 0, 0); oTimeOffSet += lDateOffSetInHours - _elapsedTime; Modified: trunk/stdair/stdair/bom/SegmentDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateContent.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/SegmentDateContent.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -24,9 +24,9 @@ return _key; } - /** Get the board point (part of the primary key). */ - const AirportCode_T& getBoardPoint () const { - return _key.getBoardPoint(); + /** Get the boarding point (part of the primary key). */ + const AirportCode_T& getBoardingPoint () const { + return _key.getBoardingPoint(); } /** Get the off point (part of the primary key). */ @@ -59,14 +59,14 @@ return _segmentRPK; } - /** Get the board date. */ - const Date_T& getBoardDate () const { - return _boardDate; + /** Get the boarding date. */ + const Date_T& getBoardingDate () const { + return _boardingDate; } - /** Get the board time. */ - const Duration_T& getBoardTime () const { - return _boardTime; + /** Get the boarding time. */ + const Duration_T& getBoardingTime () const { + return _boardingTime; } /** Get the off date. */ @@ -89,17 +89,27 @@ return _distance; } - /** Get the date off set (off date - board date). */ + /** Get the date off set (off date - boarding date). */ const DateOffSet_T getDateOffSet () const { - return _offDate - _boardDate; + return _offDate - _boardingDate; } - /** Get the time off set between board and off points. + /** Get the time off set between boarding and off points. <br>It is defined as being: - TimeOffSet = (OffTime - BoardTime) + (OffDate - BoardDate) * 24 + TimeOffSet = (OffTime - BoardingTime) + (OffDate - BoardingDate) * 24 - ElapsedTime. */ const Duration_T getTimeOffSet() const; + /** Get the flight number of the segment. */ + const FlightNumber_T& getFlightNumber () const { + return _key.getFlightNumber(); + } + + /** Get the airline code of the segment. */ + const AirlineCode_T& getAirlineCode () const { + return _key.getAirlineCode(); + } + public: // ///////// Setters ////////// /** Set the revenue amount. */ @@ -107,14 +117,14 @@ _segmentRevenue = iSegmentRevenue; } - /** Set the board date. */ - void setBoardDate (const Date_T& iBoardDate) { - _boardDate = iBoardDate; + /** Set the boarding date. */ + void setBoardingDate (const Date_T& iBoardingDate) { + _boardingDate = iBoardingDate; } - /** Set the board time. */ - void setBoardTime (const Duration_T& iBoardTime) { - _boardTime = iBoardTime; + /** Set the boarding time. */ + void setBoardingTime (const Duration_T& iBoardingTime) { + _boardingTime = iBoardingTime; } /** Set the off date. */ @@ -208,11 +218,11 @@ /** Value of the Revenue Passanger Kilometer for this segment date.*/ Distance_T _segmentRPK; - /** Board Date. */ - Date_T _boardDate; + /** Boarding Date. */ + Date_T _boardingDate; - /** Board Time. */ - Duration_T _boardTime; + /** Boarding Time. */ + Duration_T _boardingTime; /** Off Date. */ Date_T _offDate; Modified: trunk/stdair/stdair/bom/SegmentDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateKey.cpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/SegmentDateKey.cpp 2010-01-07 15:53:41 UTC (rev 90) @@ -7,15 +7,15 @@ namespace stdair { // //////////////////////////////////////////////////////////////////// - SegmentDateKey_T::SegmentDateKey_T (const AirportCode_T& iBoardPoint, + SegmentDateKey_T::SegmentDateKey_T (const AirportCode_T& iBoardingPoint, const AirportCode_T& iOffPoint) - : _boardPoint (iBoardPoint), _offPoint (iOffPoint) { + : _boardingPoint (iBoardingPoint), _offPoint (iOffPoint) { } // //////////////////////////////////////////////////////////////////// SegmentDateKey_T::SegmentDateKey_T (const SegmentDateKey_T& iKey) : _parentKey (iKey._parentKey), - _boardPoint (iKey._boardPoint), _offPoint (iKey._offPoint) { + _boardingPoint (iKey._boardingPoint), _offPoint (iKey._offPoint) { } // //////////////////////////////////////////////////////////////////// @@ -34,7 +34,7 @@ // //////////////////////////////////////////////////////////////////// const std::string SegmentDateKey_T::toString() const { std::ostringstream oStr; - oStr << _boardPoint << "-" << _offPoint; + oStr << _boardingPoint << "-" << _offPoint; return oStr.str(); } Modified: trunk/stdair/stdair/bom/SegmentDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateKey.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/bom/SegmentDateKey.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -33,9 +33,9 @@ ~SegmentDateKey_T (); // /////////// Getters ////////// - /** Get the boarding point. */ - const AirportCode_T& getBoardPoint() const { - return _boardPoint; + /** Get the boardinging point. */ + const AirportCode_T& getBoardingPoint() const { + return _boardingPoint; } /** Get the arrival point. */ @@ -43,6 +43,16 @@ return _offPoint; } + /** Get the flight number. */ + const FlightNumber_T& getFlightNumber() const { + return _parentKey.getFlightNumber(); + } + + /** Get the airline code of the segment. */ + const AirlineCode_T& getAirlineCode () const { + return _parentKey.getAirlineCode(); + } + // /////////// Setters ///////////// void setParentKey (const ParentKey_T& iParentKey) { _parentKey = iParentKey; @@ -72,8 +82,8 @@ /** Flight-date Key.*/ ParentKey_T _parentKey; - /** Boarding airport. */ - AirportCode_T _boardPoint; + /** Boardinging airport. */ + AirportCode_T _boardingPoint; /** Arrival airport. */ AirportCode_T _offPoint; Modified: trunk/stdair/stdair/factory/FacBomContent.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomContent.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/factory/FacBomContent.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -45,7 +45,7 @@ <br>A structure object is created, under the hood, with the given key. That structure object then gets a pointer on the content object. */ template <typename BOM_CONTENT_CHILD> - BOM_CONTENT_CHILD& create (typename BOM_CONTENT_CHILD::BomKey_T& ioKey) { + BOM_CONTENT_CHILD& create(const typename BOM_CONTENT_CHILD::BomKey_T& ioKey){ // Create the child structure object for the given key BOM_CONTENT_CHILD& lBomContentChild = @@ -128,6 +128,48 @@ (iBomRoot._bomRootStructure); } + /** Link a segment-date with an outbound path. */ + template <typename OUTBOUND_PATH> + static void addSegmentDateIntoOutboundPath + (OUTBOUND_PATH& ioOutboundPath, + const typename OUTBOUND_PATH::SegmentDateContent_T& iSegmentDate) { + + // Forward the job to FacBomStructure. + FacBomStructure:: + addSegmentDateIntoOutboundPath<typename OUTBOUND_PATH::BomStructure_T> + (ioOutboundPath._outboundPathStructure, + iSegmentDate._segmentDateStructure); + + // Increment the total flight time of the outbound path + const Duration_T lElapsed = iSegmentDate.getElapsedTime(); + ioOutboundPath.incrementTotalFlightTime (lElapsed); + // Increment the flight path code + std::ostringstream ostr; + FlightPathCode_T lPreviousFPCode = + ioOutboundPath.getCurrentFlightPathCode(); + ostr << lPreviousFPCode + << iSegmentDate.getFlightNumber(); + ioOutboundPath.setFlightPathCode(ostr.str()); + } + + /** Clone the links, existing between a reference OutboundPath and its + SegmentDate objects, to another OutboundPath. + @param OutboundPath& + @param const OutboundPath& The reference OutboundPath object. + @exception FacExceptionNullPointer + @exception FacException.*/ + template <typename OUTBOUND_PATH> + static void cloneSegmentDateLinks (OUTBOUND_PATH& ioOutboundPath, + const OUTBOUND_PATH& iReferenceOutboundPath) { + // Clone the list of SegmentDate pointers. + ioOutboundPath._outboundPathStructure._segmentDateHolder = + iReferenceOutboundPath._outboundPathStructure._segmentDateHolder; + + // Clone the flight path + ioOutboundPath._flightPathCode = + iReferenceOutboundPath._flightPathCode; + } + public: /** Provide the unique instance. <br>The singleton is instantiated when first used. Modified: trunk/stdair/stdair/factory/FacBomStructure.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomStructure.hpp 2010-01-06 18:13:55 UTC (rev 89) +++ trunk/stdair/stdair/factory/FacBomStructure.hpp 2010-01-07 15:53:41 UTC (rev 90) @@ -137,7 +137,7 @@ /** Add a BOM object into a dedicated BOM holder by using the full key of the object. */ template <typename BOM_CONTENT> - static bool addFullBomObjecdToBomHolder (BomChildrenHolderImp<BOM_CONTENT>& ioBomHolder, typename BOM_CONTENT::BomStructure_T& ioBomStructure) { + static bool addFullBomObjectToBomHolder (BomChildrenHolderImp<BOM_CONTENT>& ioBomHolder, typename BOM_CONTENT::BomStructure_T& ioBomStructure) { // Retrieve the bom structure type. typedef typename BOM_CONTENT::BomStructure_T BOM_STRUCTURE_T; // Define the bom holder type. @@ -208,7 +208,6 @@ // booking class holder directly in inventory or flight-date, ect. // ////////////////////////////////////////////////////////////////// private: - // ///////////////////////////////////////////////////////////////// template <typename BOM_ROOT_STRUCTURE> static void createDirectAccesses (BOM_ROOT_STRUCTURE& ioBomRootStructure) { @@ -332,8 +331,8 @@ const SEGMENT_DATE_KEY_T& lSegmentDateKey = lCurrentSegmentDate_ptr->getKey(); - const AirportCode_T& lBoardPoint = lSegmentDateKey.getBoardPoint(); - AirportCode_T currentBoardPoint = lBoardPoint; + const AirportCode_T& lBoardingPoint = lSegmentDateKey.getBoardingPoint(); + AirportCode_T currentBoardingPoint = lBoardingPoint; const AirportCode_T& lOffPoint = lSegmentDateKey.getOffPoint(); // Add a sanity check so as to ensure that the loop stops. If @@ -342,14 +341,14 @@ // segments are derived from the legs thanks to the // FlightPeriodStruct::buildSegments() method). unsigned short i = 1; - while (currentBoardPoint != lOffPoint + while (currentBoardingPoint != lOffPoint && i <= MAXIMUM_NUMBER_OF_LEGS_IN_FLIGHT) { - // Retrieve the (unique) LegDate getting that Board Point + // Retrieve the (unique) LegDate getting that Boarding Point const LEG_DATE_HOLDER_T& lLegDateHolder = ioFlightDateStructure.getSecondChildrenHolder(); const LEG_DATE_STRUCTURE_MAP_T& lLegDateMap = lLegDateHolder._bomChildrenMap; typename LEG_DATE_STRUCTURE_MAP_T::const_iterator itLegDate = - lLegDateMap.find (currentBoardPoint); + lLegDateMap.find (currentBoardingPoint); assert (itLegDate != lLegDateMap.end()); LEG_DATE_STRUCTURE_T* lLegDateStructure_ptr = itLegDate->second; assert (lLegDateStructure_ptr != NULL); @@ -361,7 +360,7 @@ const typename LEG_DATE_STRUCTURE_T::Content_T* lLegDateContent_ptr = lLegDateStructure_ptr->_content; assert (lLegDateContent_ptr != NULL); - currentBoardPoint = lLegDateContent_ptr->getOffPoint(); + currentBoardingPoint = lLegDateContent_ptr->getOffPoint(); ++i; } assert (i <= MAXIMUM_NUMBER_OF_LEGS_IN_FLIGHT); @@ -369,7 +368,7 @@ } // Create the routing for the leg- and segment-cabins. // At the same time, set the SegmentDate attributes derived from - // its routing legs (e.g., board and off dates). + // its routing legs (e.g., boarding and off dates). createDirectAccessesWithinSegmentDate<SEGMENT_DATE_STRUCTURE_T> (*lCurrentSegmentDate_ptr); } } @@ -499,11 +498,11 @@ assert (lBookingClassStructure_ptr != NULL); bool addingSucceeded = - addFullBomObjecdToBomHolder<BOOKING_CLASS_T> (lFDBookingClassHolder, + addFullBomObjectToBomHolder<BOOKING_CLASS_T> (lFDBookingClassHolder, *lBookingClassStructure_ptr); assert (addingSucceeded == true); addingSucceeded = - addFullBomObjecdToBomHolder<BOOKING_CLASS_T> (lInvBookingClassHolder, + addFullBomObjectToBomHolder<BOOKING_CLASS_T> (lInvBookingClassHolder, *lBookingClassStructure_ptr); assert (addingSucceeded == true); } @@ -577,6 +576,33 @@ assert (addingSucceeded == true); } + /** Link a segment-date with an outbound path. */ + template <typename OUTBOUND_PATH_STRUCTURE> + static void addSegmentDateIntoOutboundPath + (OUTBOUND_PATH_STRUCTURE& ioOutboundPathStructure, + typename OUTBOUND_PATH_STRUCTURE::SegmentDate_T::BomStructure_T& ioSegmentDateStructure) { + + // Retrieve the segment-date type. + typedef typename OUTBOUND_PATH_STRUCTURE::SegmentDate_T SEGMENT_DATE_T; + typedef typename OUTBOUND_PATH_STRUCTURE::SegmentDate_T::BomStructure_T SEGMENT_DATE_STRUCTURE_T; + // Define the bom holder of segment-dates. + typedef BomChildrenHolderImp<SEGMENT_DATE_T> SEGMENT_DATE_HOLDER_T; + + // Check if it is necessary to initialize the SegmentDate holder. + if (boost::is_same<SEGMENT_DATE_T, BomStopContent>::value == false + && ioOutboundPathStructure._segmentDateHolder == NULL) { + // Initialize the segment-date holder within the outbound path. + SEGMENT_DATE_HOLDER_T& lSegmentDateHolder = + FacBomStructure::instance().createBomHolder<SEGMENT_DATE_T>(); + ioOutboundPathStructure.setSegmentDateHolder(lSegmentDateHolder); + } + assert (ioOutboundPathStructure._segmentDateHolder != NULL); + bool addingSucceeded = + addFullBomObjectToBomHolder<SEGMENT_DATE_T> (*ioOutboundPathStructure._segmentDateHolder, ioSegmentDateStructure); + assert (addingSucceeded == true); + } + // ////////////////////////////////////////////////////////////////// + private: /** The unique instance.*/ static FacBomStructure* _instance; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-01-06 18:14:02
|
Revision: 89 http://stdair.svn.sourceforge.net/stdair/?rev=89&view=rev Author: quannaus Date: 2010-01-06 18:13:55 +0000 (Wed, 06 Jan 2010) Log Message: ----------- [Dev] Fixed some bugs. Modified Paths: -------------- trunk/stdair/stdair/basic/BasConst.cpp trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/AirportDateKey.hpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkDateKey.cpp trunk/stdair/stdair/bom/NetworkDateKey.hpp trunk/stdair/stdair/bom/OutboundPathContent.cpp trunk/stdair/stdair/bom/OutboundPathContent.hpp trunk/stdair/stdair/bom/OutboundPathKey.cpp trunk/stdair/stdair/bom/OutboundPathKey.hpp Modified: trunk/stdair/stdair/basic/BasConst.cpp =================================================================== --- trunk/stdair/stdair/basic/BasConst.cpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/basic/BasConst.cpp 2010-01-06 18:13:55 UTC (rev 89) @@ -10,6 +10,7 @@ #include <stdair/basic/BasConst_BookingClass.hpp> #include <stdair/basic/BasConst_Yield.hpp> #include <stdair/basic/BasConst_Period_BOM.hpp> +#include <stdair/basic/BasConst_TravelSolution.hpp> namespace stdair { Modified: trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp 2010-01-06 18:13:55 UTC (rev 89) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // LATUS Common -#include <stdair/basic/BasComTypes.hpp> +#include <stdair/STDAIR_Types.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/AirportDate.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-01-06 18:13:55 UTC (rev 89) @@ -63,12 +63,6 @@ OutboundPathMap_T AirportDate::getOutboundPathMap () const { return _airportDateStructure.getChildrenHolder(); } - - // //////////////////////////////////////////////////////////////////// - OutboundPath* AirportDate:: - getOutboundPath (const OutboundPathKey_T& iKey) const { - return _airportDateStructure.getContentChild (iKey); - } } Modified: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-06 18:13:55 UTC (rev 89) @@ -16,6 +16,11 @@ } // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::AirportDateKey_T (const AirportDateKey_T& iKey) + : _origin (iKey._origin) { + } + + // //////////////////////////////////////////////////////////////////// AirportDateKey_T::~AirportDateKey_T () { } Modified: trunk/stdair/stdair/bom/AirportDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.hpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/AirportDateKey.hpp 2010-01-06 18:13:55 UTC (rev 89) @@ -21,7 +21,7 @@ private: // /////////// Default constructor ////////// - AirportDateKey_T () { }; + AirportDateKey_T (); public: // /////////// Construction /////////// Modified: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/Network.hpp 2010-01-06 18:13:55 UTC (rev 89) @@ -40,9 +40,6 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef NetworkDate ContentChild_T; - - /** Definition allowing to retrieve the specific BookingClass type. */ - typedef BookingClass BookingClassContent_T; // ///////////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/NetworkDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateKey.cpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/NetworkDateKey.cpp 2010-01-06 18:13:55 UTC (rev 89) @@ -17,6 +17,11 @@ } // //////////////////////////////////////////////////////////////////// + NetworkDateKey_T::NetworkDateKey_T (const NetworkDateKey_T& iKey) + : _referenceDate (iKey._referenceDate) { + } + + // //////////////////////////////////////////////////////////////////// NetworkDateKey_T::~NetworkDateKey_T () { } Modified: trunk/stdair/stdair/bom/NetworkDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateKey.hpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/NetworkDateKey.hpp 2010-01-06 18:13:55 UTC (rev 89) @@ -21,7 +21,7 @@ private: // /////////// Default constructor ////////// - NetworkDateKey_T () { }; + NetworkDateKey_T (); public: // /////////// Construction /////////// Modified: trunk/stdair/stdair/bom/OutboundPathContent.cpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathContent.cpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/OutboundPathContent.cpp 2010-01-06 18:13:55 UTC (rev 89) @@ -10,10 +10,10 @@ namespace stdair { // //////////////////////////////////////////////////////////////////// - OutboundPath::OutboundPath (const OutboundPathKey_T& iKey) + OutboundPathContent::OutboundPathContent (const OutboundPathKey_T& iKey) : _key (iKey), _airlineCode (DEFAULT_AIRLINE_CODE), _flightPathCode (DEFAULT_FLIGHTPATH_CODE), - _boardTime (NULL_BOOST_TIME_DURATION) { + _flightTime (NULL_BOOST_TIME_DURATION) { } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/OutboundPathContent.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathContent.hpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/OutboundPathContent.hpp 2010-01-06 18:13:55 UTC (rev 89) @@ -45,22 +45,22 @@ /** Get the number of segments (part of the primary key). */ const NbOfSegments_T& getNbOfSegments() const { - return _key._nbOfSegments; + return _key.getNbOfSegments(); } /** Get the destination (part of the primary key). */ const AirportCode_T& getDestination() const { - return _key._destination; + return _key.getOffPoint(); } /** Get the elapsed time (part of the primary key). */ const Duration_T& getElapsedTime() const { - return _key._elapsed; + return _key.getElapsedTime(); } /** Get the number of airlines (part of the primary key). */ const NbOfAirlines_T& getNbOfAirlines() const { - return _key._nbOfAirlines; + return _key.getNbOfAirlines(); } public: Modified: trunk/stdair/stdair/bom/OutboundPathKey.cpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathKey.cpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/OutboundPathKey.cpp 2010-01-06 18:13:55 UTC (rev 89) @@ -12,10 +12,10 @@ const Duration_T& iElapsedTime, const NbOfSegments_T& iNbOfSegments, const NbOfAirlines_T& iNbOfAirlines) - : destination (iDestination), - elapsed (iElapsedTime), - nbOfSegments (iNbOfSegments), - nbOfAirlines (iNbOfAirlines) { + : _destination (iDestination), + _elapsed (iElapsedTime), + _nbOfSegments (iNbOfSegments), + _nbOfAirlines (iNbOfAirlines) { } // //////////////////////////////////////////////////////////////////// @@ -34,7 +34,8 @@ // //////////////////////////////////////////////////////////////////// const std::string OutboundPathKey_T::toString() const { std::ostringstream oStr; - oStr << _classCode; + oStr << _destination << ", " << _elapsed << ", " + << _nbOfSegments << ", " << _nbOfAirlines; return oStr.str(); } @@ -47,12 +48,12 @@ // ////////////////////////////////////////////////////////////////////// const AirportCode_T& OutboundPathKey_T::getBoardingPoint() const { - return _parentKey.getBoardPoint(); + return _parentKey.getBoardingPoint(); } // ////////////////////////////////////////////////////////////////////// const Date_T& OutboundPathKey_T::getBoardingDate() const { - return _parentKey.getBoardDate(); + return _parentKey.getBoardingDate(); } } Modified: trunk/stdair/stdair/bom/OutboundPathKey.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathKey.hpp 2010-01-06 16:53:49 UTC (rev 88) +++ trunk/stdair/stdair/bom/OutboundPathKey.hpp 2010-01-06 18:13:55 UTC (rev 89) @@ -44,6 +44,11 @@ const NbOfAirlines_T& getNbOfAirlines() const { return _nbOfAirlines; } + + /** Get the elapsed time. */ + const Duration_T& getElapsedTime() const { + return _elapsed; + } /** Get boarding airport. */ const AirportCode_T& getBoardingPoint() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-01-06 16:53:59
|
Revision: 88 http://stdair.svn.sourceforge.net/stdair/?rev=88&view=rev Author: quannaus Date: 2010-01-06 16:53:49 +0000 (Wed, 06 Jan 2010) Log Message: ----------- [Dev] Added Network, NetworkDate, AirportDate and OutboundPath. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/basic/BasConst.cpp trunk/stdair/stdair/basic/sources.mk trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomRootStructure.hpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassKey.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/AirportDateContent.cpp trunk/stdair/stdair/bom/AirportDateContent.hpp trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/AirportDateKey.hpp trunk/stdair/stdair/bom/AirportDateStructure.hpp trunk/stdair/stdair/bom/AirportDateTypes.hpp trunk/stdair/stdair/bom/Network.cpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkContent.cpp trunk/stdair/stdair/bom/NetworkContent.hpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/NetworkDateContent.cpp trunk/stdair/stdair/bom/NetworkDateContent.hpp trunk/stdair/stdair/bom/NetworkDateKey.cpp trunk/stdair/stdair/bom/NetworkDateKey.hpp trunk/stdair/stdair/bom/NetworkDateStructure.hpp trunk/stdair/stdair/bom/NetworkDateTypes.hpp trunk/stdair/stdair/bom/NetworkKey.cpp trunk/stdair/stdair/bom/NetworkKey.hpp trunk/stdair/stdair/bom/NetworkStructure.hpp trunk/stdair/stdair/bom/NetworkTypes.hpp trunk/stdair/stdair/bom/OutboundPath.cpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/OutboundPathContent.cpp trunk/stdair/stdair/bom/OutboundPathContent.hpp trunk/stdair/stdair/bom/OutboundPathKey.cpp trunk/stdair/stdair/bom/OutboundPathKey.hpp trunk/stdair/stdair/bom/OutboundPathStructure.hpp trunk/stdair/stdair/bom/OutboundPathTypes.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -55,6 +55,9 @@ /** Define the type for date (e.g., departure date of a flight). */ typedef boost::gregorian::date Date_T; + /** Define the type for network ID. */ + typedef std::string NetworkID_T; + /** Define the type for airport codes. */ typedef std::string AirportCode_T; Modified: trunk/stdair/stdair/basic/BasConst.cpp =================================================================== --- trunk/stdair/stdair/basic/BasConst.cpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/basic/BasConst.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -93,10 +93,10 @@ // /** Time duration representing a full minute (in seconds).*/ // const int TIME_DURATION_FOR_A_MINUTE_IN_SECONDS = 60; - // /** Null time duration (in boost::time_duration unit).*/ - // const Duration_T NULL_BOOST_TIME_DURATION = - // boost::posix_time::hours(0)+ boost::posix_time::minutes (0) - // + boost::posix_time::seconds (0); + /** Null time duration (in boost::time_duration unit).*/ + const Duration_T NULL_BOOST_TIME_DURATION = + boost::posix_time::hours(0)+ boost::posix_time::minutes (0) + + boost::posix_time::seconds (0); // /** Date duration representing a full day (in boost::date_duration unit).*/ // const DateOffSet_T BOOST_DATE_DURATION_FOR_A_DAY (1); @@ -144,40 +144,40 @@ // const DateTime_T DEFAULT_DEMAND_DATETIME (DEFAULT_WHOLE_DEMAND_UPDATE_DATE, // NULL_BOOST_TIME_DURATION); - // // //////// Fare Rules /////// - // /** Default saturdayStay value (false). */ - // const SaturdayStay_T DEFAULT_SATURDAY_STAY = false; + // //////// Fare Rules /////// + /** Default saturdayStay value (false). */ + const SaturdayStay_T DEFAULT_SATURDAY_STAY = false; + + /** Default change fees value (false). */ + const ChangeFees_T DEFAULT_CHANGE_FEES = false; + + /** Default non refundable value (false). */ + const NonRefundable_T DEFAULT_NON_REFUNDABLE = false; + + /** Default airlineCode value ('XX'). */ + const AirlineCode_T DEFAULT_AIRLINE_CODE = "XX"; - // /** Default change fees value (false). */ - // const ChangeFees_T DEFAULT_CHANGE_FEES = false; + /** Default airlineCode value (''). */ + const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE = ""; - // /** Default non refundable value (false). */ - // const NonRefundable_T DEFAULT_NON_REFUNDABLE = false; + /** Default airportCode value ('XXX'). */ + const AirportCode_T DEFAULT_AIRPORT_CODE = "XXX"; - // /** Default airlineCode value ('XX'). */ - // const AirlineCode_T DEFAULT_AIRLINE_CODE = "XX"; + /** Default family code value ('X'). */ + const ClassCode_T DEFAULT_FAMILY_CODE = "0"; - // /** Default airlineCode value (''). */ - // const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE = ""; + /** Default classCode value ('X'). */ + const ClassCode_T DEFAULT_CLASS_CODE = "X"; - // /** Default airportCode value ('XXX'). */ - // const AirportCode_T DEFAULT_AIRPORT_CODE = "XXX"; + /** Default number of airlines. */ + const NbOfAirlines_T DEFAULT_NBOFAIRLINES = 0; - // /** Default family code value ('X'). */ - // const ClassCode_T DEFAULT_FAMILY_CODE = "0"; + /** Default classCode value (''). */ + const ClassCode_T DEFAULT_NULL_CLASS_CODE = ""; - // /** Default classCode value ('X'). */ - // const ClassCode_T DEFAULT_CLASS_CODE = "X"; + /** Default flightPathCode value (''). */ + const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE = ""; - // /** Default number of airlines. */ - // const NbOfAirlines_T DEFAULT_NBOFAIRLINES = 0; - - // /** Default classCode value (''). */ - // const ClassCode_T DEFAULT_NULL_CLASS_CODE = ""; - - // /** Default flightPathCode value (''). */ - // const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE = ""; - // // //////// DemandFeatures /////// // /** Default SaturdayStay average ratio of demand (value between [0, 100]). */ // const SaturdayStayRatio_T DEFAULT_SATURDAY_STAY_RATIO = 50; @@ -331,21 +331,21 @@ // /** Default remaining futre demand standard deviation for OnD. */ // const NbOfBookings_T DEFAULT_OND_REMAINING_DEMAND_STANDARD_DEVIATION = 0.0; - // // //////// Travel Solutions /////// - // /** Default Minimum connection time. */ - // const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME (0, 30, 0); + // //////// Travel Solutions /////// + /** Default Minimum connection time. */ + const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME (0, 30, 0); - // /** Default Matching Indicator value. */ - // const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR (0.0); + /** Default Matching Indicator value. */ + const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR (0.0); - // /** Default price value (0.0). */ + /** Default price value (0.0). */ // const PriceValue_T DEFAULT_PRICE_VALUE (0.0); - // /** Default currency (euro). */ - // const PriceCurrency_T DEFAULT_CURRENCY ("EUR"); + /** Default currency (euro). */ + const PriceCurrency_T DEFAULT_CURRENCY ("EUR"); - // /** Default availability status for a travel solution. */ - // const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS = false; + /** Default availability status for a travel solution. */ + const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS = false; // // //////// Cancellation /////// // /** Default Fare value */ Added: trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,73 @@ +#ifndef __STDAIR_BAS_BASCONST_TRAVELSOLUTION_HPP +#define __STDAIR_BAS_BASCONST_TRAVELSOLUTION_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// LATUS Common +#include <stdair/basic/BasComTypes.hpp> + +namespace stdair { + + /** Default flight speed (number of kilometers per hour). */ + extern const unsigned int DEFAULT_FLIGHT_SPEED; + + // //////// Travel Solutions /////// + /** Default distance value (kilometers). */ + extern const Distance_T DEFAULT_DISTANCE_VALUE; + + /** Default Minimum connection time. */ + extern const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME; + + /** Null time duration (in boost::time_duration unit).*/ + extern const Duration_T NULL_BOOST_TIME_DURATION; + + /** Default airlineCode value ('XX'). */ + extern const AirlineCode_T DEFAULT_AIRLINE_CODE; + + /** Default epsilon value. */ + extern const double DEFAULT_EPSILON_VALUE; + + /** Default classCode value ('X'). */ + extern const ClassCode_T DEFAULT_CLASS_CODE; + + /** Default flightPathCode value (''). */ + extern const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE; + + /** Default value of Availability. */ + extern const Availability_T DEFAULT_CLASS_AVAILABILITY; + + /** Default availability status for a travel solution. */ + extern const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS; + + /** Default number of bookings. */ + extern const NbOfBookings_T DEFAULT_CLASS_NB_OF_BOOKINGS; + + /** Default value of Fare. */ + extern const Fare_T DEFAULT_CLASS_FARE_VALUE; + + /** Default nember of required seats by the demand. */ + extern const unsigned short DEFAULT_NUMBER_OF_REQUIRED_SEATS; + + /** Default Matching Indicator value between customer requirements + and a fare rule. */ + extern const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR; + + /** Default epsilon value between customer requirements + and a fare rule. */ + extern const double DEFAULT_EPSILON_VALUE; + + /** Default revenue value. */ + extern const Revenue_T DEFAULT_REVENUE_VALUE; + + /** Default currency (euro). */ + extern const PriceCurrency_T DEFAULT_CURRENCY; + + /** Default DICO studied airline. */ + extern const AirlineCode_T DEFAULT_DICO_STUDIED_AIRLINE; + + /** Default DICO studied date. */ + extern const Date_T DEFAULT_DICO_STUDIED_DATE; + +} +#endif // __STDAIR_BAS_BASCONST_TRAVELSOLUTION_HPP Modified: trunk/stdair/stdair/basic/sources.mk =================================================================== --- trunk/stdair/stdair/basic/sources.mk 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/basic/sources.mk 2010-01-06 16:53:49 UTC (rev 88) @@ -4,6 +4,7 @@ $(top_srcdir)/stdair/basic/BasConst_Inventory.hpp \ $(top_srcdir)/stdair/basic/BasConst_BookingClass.hpp \ $(top_srcdir)/stdair/basic/BasConst_Yield.hpp \ - $(top_srcdir)/stdair/basic/BasConst_Period_BOM.hpp + $(top_srcdir)/stdair/basic/BasConst_Period_BOM.hpp \ + $(top_srcdir)/stdair/basic/BasConst_TravelSolution.hpp bas_cc_sources = \ $(top_srcdir)/stdair/basic/BasConst.cpp Copied: trunk/stdair/stdair/bom/AirportDate.cpp (from rev 87, trunk/stdair/stdair/bom/LegDate.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,74 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/AirportDateStructure.hpp> +#include <stdair/bom/AirportDate.hpp> +#include <stdair/bom/OutboundPath.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirportDate::AirportDate (const BomKey_T& iKey, + BomStructure_T& ioAirportStructure) + : AirportDateContent (iKey), _airportDateStructure (ioAirportStructure) { + } + + // //////////////////////////////////////////////////////////////////// + AirportDate::~AirportDate () { + } + + // //////////////////////////////////////////////////////////////////// + void AirportDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void AirportDate::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + std::string AirportDate::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + // Then, browse the children + // [...] (no child for now) + + return oStr.str(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDate::describeKey() const { + return _airportDateStructure.describeKey(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDate::describeShortKey() const { + return _airportDateStructure.describeShortKey(); + } + + // //////////////////////////////////////////////////////////////////// + OutboundPathList_T AirportDate::getOutboundPathList () const { + return _airportDateStructure.getChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// + OutboundPathMap_T AirportDate::getOutboundPathMap () const { + return _airportDateStructure.getChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// + OutboundPath* AirportDate:: + getOutboundPath (const OutboundPathKey_T& iKey) const { + return _airportDateStructure.getContentChild (iKey); + } + +} + Copied: trunk/stdair/stdair/bom/AirportDate.hpp (from rev 87, trunk/stdair/stdair/bom/LegDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,98 @@ +#ifndef __STDAIR_BOM_AIRPORTDATE_HPP +#define __STDAIR_BOM_AIRPORTDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/AirportDateStructure.hpp> +#include <stdair/bom/AirportDateContent.hpp> +#include <stdair/bom/AirportDateTypes.hpp> +#include <stdair/bom/OutboundPathTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct AirportDateKey_T; + struct OutboundPathKey_T; + + /** Class representing the actual functional/business content for a + airport-date. */ + class AirportDate : public AirportDateContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef FlightDate Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef AirportDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirportDateKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef OutboundPath ContentChild_T; + + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn); + + /** Get the serialised version of the Business Object. */ + std::string toString() const; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a OutboundPathList_T for iteration methods. */ + OutboundPathList_T getOutboundPathList () const; + + /** Get a OutboundPathMap_T for iteration methods. */ + OutboundPathMap_T getOutboundPathMap () const; + + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _airportDateStructure; + } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + AirportDate (); + AirportDate (const AirportDate&); + AirportDate (const BomKey_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~AirportDate(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _airportDateStructure; + + }; + +} +#endif // __STDAIR_BOM_AIRPORTDATE_HPP + Copied: trunk/stdair/stdair/bom/AirportDateContent.cpp (from rev 87, trunk/stdair/stdair/bom/LegDateContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateContent.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,21 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/AirportDateContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirportDateContent::AirportDateContent (const BomKey_T& iKey) \ + : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + AirportDateContent::~AirportDateContent () { + } + +} + Copied: trunk/stdair/stdair/bom/AirportDateContent.hpp (from rev 87, trunk/stdair/stdair/bom/LegDateContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateContent.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_AIRPORTDATECONTENT_HPP +#define __STDAIR_BOM_AIRPORTDATECONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/AirportDateKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for an airport-date. */ + class AirportDateContent : public BomContent { + public: + // Type definitions. + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirportDateKey_T BomKey_T; + + public: + // /////////// Getters ///////////// + /** Get the airport-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + virtual void toStream (std::ostream& ioOut) const = 0; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + virtual void fromStream (std::istream& ioIn) = 0; + + /** Get the serialised version of the Business Object. */ + virtual std::string toString() const = 0; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + virtual const std::string describeKey() const = 0; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + virtual const std::string describeShortKey() const = 0; + + + protected: + /** Default constructors. */ + AirportDateContent (const BomKey_T&); + AirportDateContent (const AirportDateContent&); + + /** Destructor. */ + virtual ~AirportDateContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + + }; + +} +#endif // __STDAIR_BOM_AIRPORTDATECONTENT_HPP + Added: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,49 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirportDateKey.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::AirportDateKey_T () : _origin ("ZZZ") { + } + + // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::AirportDateKey_T (const AirportCode_T& iAirportCode) + : _origin (iAirportCode) { + } + + // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::~AirportDateKey_T () { + } + + // //////////////////////////////////////////////////////////////////// + void AirportDateKey_T::toStream (std::ostream& ioOut) const { + ioOut << "AirportDateKey: " << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void AirportDateKey_T::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDateKey_T::toString() const { + std::ostringstream oStr; + oStr << _origin; + return oStr.str(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDateKey_T::describe() const { + std::ostringstream oStr; + oStr << _parentKey.describe() << ", " << toString(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const Date_T& AirportDateKey_T::getBoardingDate() const { + return _parentKey.getReferenceDate(); + } +} Added: trunk/stdair/stdair/bom/AirportDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateKey.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,80 @@ +#ifndef __STDAIR_BOM_AIRPORTDATEKEY_HPP +#define __STDAIR_BOM_AIRPORTDATEKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> +#include <stdair/bom/NetworkDateKey.hpp> + +namespace stdair { + /** Key of airport-date. */ + struct AirportDateKey_T : public BomKey_T { + friend struct OutboundPathKey_T; + + public: + // /////////// Typedefs //////////// + /** Definition allowing to retrieve the parent key type. */ + typedef NetworkDateKey_T ParentKey_T; + + private: + // /////////// Default constructor ////////// + AirportDateKey_T () { }; + + public: + // /////////// Construction /////////// + /** Constructors. */ + AirportDateKey_T (const AirportCode_T& iAirportCode); + AirportDateKey_T (const AirportDateKey_T&); + + /** Destructor. */ + ~AirportDateKey_T (); + + // /////////// Getters ////////// + /** Get boarding date. */ + const Date_T& getBoardingDate() const; + + /** Get boarding airport. */ + const AirportCode_T& getBoardingPoint() const { + return _origin; + } + + // /////////// Display support methods ///////// + /** Dump a Business Object Key into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** Read a Business Object Key from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn); + + /** Get the serialised version of the Business Object Key. + <br>That string is unique, at the level of a given Business Object, + when among children of a given parent Business Object. + <br>For instance, "H" and "K" allow to differentiate among two + marketing classes for the same segment-date. */ + const std::string toString() const; + + /** Display of the key. */ + const std::string describe() const; + + // /////////// Setters ///////////// + /** Set the parent key. */ + void setParentKey (const ParentKey_T& iParentKey) { + _parentKey = iParentKey; + } + + private: + // Attributes + /** Network-date key.*/ + ParentKey_T _parentKey; + + /** The boarding airport. */ + AirportCode_T _origin; + }; + +} + +#endif // __STDAIR_BOM_NETWORKDATEKEY_HPP Copied: trunk/stdair/stdair/bom/AirportDateStructure.hpp (from rev 87, trunk/stdair/stdair/bom/LegDateStructure.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateStructure.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,169 @@ +#ifndef __STDAIR_BOM_AIRPORTDATESTRUCTURE_HPP +#define __STDAIR_BOM_AIRPORTDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> +#include <stdair/bom/OutboundPathStructure.hpp> +#include <stdair/bom/OutboundPathKey.hpp> + +namespace stdair { + // Forward declarations. + template <typename BOM> struct BomMap_T; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific AirportDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class AirportDateStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef typename BOM_CONTENT::BomKey_T BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the child key type. */ + typedef OutboundPathKey_T ChildKey_T; + + /** Define the map of ContentChild_T. */ + typedef BomMap_T<ContentChild_T> ChildrenMap_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <OutboundPathStructure<ContentChild_T>, + BomStopStructure> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; + + /** Definition allowing to retrive the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + + public: + // /////////// Getters ///////////// + /** Get the (parent) NetworkDateStructure object. */ + ParentBomStructure_T* getNetworkDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) NetworkDateStructure object. */ + ParentBomStructure_T& getNetworkDateStructure() const; + + /** Get the airport-date key. */ + const BomKey_T& getKey() const { + assert (_content != NULL); + return _content->getKey(); + } + + /** Get the holder of outbound paths. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + return *_childrenHolder; + } + + /** Get the holder of outbound paths. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; + } + + /** Retrieve, if existing, the outbound path corresponding to the + given key. + <br>If not exissting, return the NULL pointer. */ + ContentChild_T* getContentChild (const ChildKey_T& iKey) const { + ContentChild_T* oContentChild_ptr = NULL; + + ChildrenMap_T lChildrenMap (getChildrenHolder()); + const MapKey_T lMapKey = iKey.toString(); + + typename ChildrenMap_T::iterator itContentChild = + lChildrenMap.find (lMapKey); + + if (itContentChild != lChildrenMap.end()) { + oContentChild_ptr = itContentChild->second; + assert (oContentChild_ptr != NULL); + } + + return oContentChild_ptr; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) NetworkDateStructure object. */ + void setNetworkDateStructure (ParentBomStructure_T& ioNetworkDateStructure) { + _parent = &ioNetworkDateStructure; + } + + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } + + /** Set the outbound path children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; + } + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { } + + /** Get the serialised version of the Business Object. */ + std::string toString() const { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return getKey().toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return getKey().toString(); } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + AirportDateStructure () : _parent (NULL), _content (NULL), + _childrenHolder (NULL) { } + AirportDateStructure (const AirportDateStructure&); + + /** Destructor. */ + virtual ~AirportDateStructure() { } + + private: + // Attributes + /** Parent network-date. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** Holder of outbound paths. */ + ChildrenBomHolder_T* _childrenHolder; + }; + +} +#endif // __STDAIR_BOM_AIRPORTDATESTRUCTURE_HPP Copied: trunk/stdair/stdair/bom/AirportDateTypes.hpp (from rev 87, trunk/stdair/stdair/bom/LegDateTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateTypes.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,36 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_AIRPORTDATETYPES_HPP +#define __STDAIR_BOM_AIRPORTDATETYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class AirportDateStructure; + template <typename BOM> struct BomList_T; + template <typename BOM> struct BomMap_T; + class AirportDate; + + /** Define the AirportDate structure. */ + typedef AirportDateStructure<AirportDate> AirportDateStructure_T; + + /** Define the airport-date structure list. */ + typedef std::vector<AirportDateStructure_T*> AirportDateStructureList_T; + + /** Define the airport-date structure map. */ + typedef std::map<const std::string, AirportDateStructure_T*> AirportDateStructureMap_T; + + /** Define the airport-date list. */ + typedef BomList_T<AirportDate> AirportDateList_T; + + /** Define the airport-date map. */ + typedef BomMap_T<AirportDate> AirportDateMap_T; +} +#endif // __STDAIR_BOM_AIRPORTDATETYPES_HPP + Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -9,6 +9,7 @@ #include <stdair/bom/BomList.hpp> #include <stdair/bom/BomMap.hpp> #include <stdair/bom/Inventory.hpp> +#include <stdair/bom/Network.hpp> namespace stdair { @@ -31,6 +32,17 @@ return _bomRootStructure.getChildrenHolder(); } + // //////////////////////////////////////////////////////////////////// + NetworkList_T BomRoot::getNetworkList () const { + return _bomRootStructure.getSecondChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// + NetworkMap_T BomRoot::getNetworkMap () const { + return _bomRootStructure.getSecondChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// Inventory* BomRoot::getInventory (const AirlineCode_T& iAirlineCode) const { Inventory* oInventory_ptr = NULL; @@ -43,5 +55,19 @@ return oInventory_ptr; } + + // //////////////////////////////////////////////////////////////////// + Network* BomRoot::getNetwork (const NetworkID_T& iNetworkID) const { + Network* oNetwork_ptr = NULL; + + NetworkMap_T lNetworkMap = getNetworkMap (); + NetworkMap_T::iterator itNetwork = lNetworkMap.find (iNetworkID); + + if (itNetwork != lNetworkMap.end()) { + oNetwork_ptr = itNetwork->second; + } + + return oNetwork_ptr; + } } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -11,6 +11,7 @@ #include <stdair/bom/BomRootContent.hpp> #include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> +#include <stdair/bom/NetworkTypes.hpp> namespace stdair { // Forward declarations. @@ -60,6 +61,10 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef Inventory ContentChild_T; + + /** Definition allowing to retrieve the associated second + BOM content child type. */ + typedef Network SecondContentChild_T; // ///////////////////////////////////////////////////////////////////////// @@ -104,6 +109,12 @@ /** Get a InventoryMap_T for iteration methods. */ InventoryMap_T getInventoryMap () const; + + /** Get a NetworkList_T for iteration methods. */ + NetworkList_T getNetworkList () const; + + /** Get a NetworkMap_T for iteration methods. */ + NetworkMap_T getNetworkMap () const; /** Get the reference of the AirlineFeatureSet object. */ const AirlineFeatureSet& getAirlineFeatureSet() const { @@ -115,6 +126,11 @@ given airline code (Inventory key). <br>If not existing, return the NULL pointer. */ Inventory* getInventory (const AirlineCode_T&) const; + + /** Retrieve, if existing, the Network corresponding to the + given airline code (Network key). + <br>If not existing, return the NULL pointer. */ + Network* getNetwork (const NetworkID_T&) const; public: // //////////// Setters ////////////// Modified: trunk/stdair/stdair/bom/BomRootStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRootStructure.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BomRootStructure.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -12,6 +12,7 @@ #include <stdair/bom/BomStopStructure.hpp> #include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/InventoryStructure.hpp> +#include <stdair/bom/NetworkStructure.hpp> namespace stdair { /** Wrapper class aimed at holding the actual content, modeled @@ -30,21 +31,30 @@ /** Definition allowing to retrieve the children type of the BOM_CONTENT. */ typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; - + + /** Definition allowing to retrieve the second children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::SecondContentChild_T SecondContentChild_T; + private: // Type definitions /** Definition allowing to retrieve the associated BOM key type. */ typedef typename BOM_CONTENT::BomKey_T BomKey_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStopStructure> ChildrenBomTypeList_T; - + typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, + NetworkStructure<SecondContentChild_T> > ChildrenBomTypeList_T; + /** Definition allowing to retrive the default children bom holder type. */ typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; - + /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + /** Definition allowing to retrive the second children bom holder type. */ + typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; + + public: // /////////// Getters ///////////// /** Get the BomRootStructure key. */ @@ -59,11 +69,22 @@ return *_childrenHolder; } + /** Get the holder of networks. */ + const SecondChildrenBomHolder_T& getSecondChildrenHolder() const { + assert (_secondChildrenHolder != NULL); + return *_secondChildrenHolder; + } + /** Get the holder of inventories. */ void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { ioChildrenHolder = _childrenHolder; } + /** Get the holder of networks. */ + void getChildrenHolder (SecondChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _secondChildrenHolder; + } + private: /////////////// Setters //////////////// /** Default children holder setter. */ @@ -74,6 +95,11 @@ _childrenHolder = &ioChildrenHolder; } + /** Set the network children holder. */ + void setChildrenHolder (SecondChildrenBomHolder_T& ioChildrenHolder) { + _secondChildrenHolder = &ioChildrenHolder; + } + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @@ -101,7 +127,8 @@ /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ - BomRootStructure () : _content (NULL), _childrenHolder (NULL) { }; + BomRootStructure () : _content (NULL), _childrenHolder (NULL), + _secondChildrenHolder (NULL) { }; BomRootStructure (const BomRootStructure&); /** Destructor. */ @@ -114,6 +141,9 @@ /** Holder of inventories. */ ChildrenBomHolder_T* _childrenHolder; + + /** Holder of networks. */ + SecondChildrenBomHolder_T* _secondChildrenHolder; }; } Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -17,7 +17,7 @@ struct BookingClassKey_T; /** Class representing the actual functional/business content for a - segment-cabin. */ + booking class. */ class BookingClass : public BookingClassContent { friend class FacBomContent; Modified: trunk/stdair/stdair/bom/BookingClassKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -10,7 +10,7 @@ #include <stdair/bom/SegmentCabinKey.hpp> namespace stdair { - /** Key of segment-cabin. */ + /** Key of booking-class. */ struct BookingClassKey_T : public BomKey_T { public: Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -42,8 +42,8 @@ BOM content child type. */ typedef SegmentDate ContentChild_T; - /** Definition allowing to retrieve the associated second - BOM content child type. */ + /** Definition allowing to retrieve the associated second + BOM content child type. */ typedef LegDate SecondContentChild_T; /** Definition allowing to retrieve the specific BookingClass type. */ Added: trunk/stdair/stdair/bom/Network.cpp =================================================================== --- trunk/stdair/stdair/bom/Network.cpp (rev 0) +++ trunk/stdair/stdair/bom/Network.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,68 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkStructure.hpp> +#include <stdair/bom/Network.hpp> +#include <stdair/bom/NetworkDate.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + Network::Network (const BomKey_T& iKey, + BomStructure_T& ioNetworkStructure) + : NetworkContent (iKey), _networkStructure (ioNetworkStructure) { + } + + // //////////////////////////////////////////////////////////////////// + Network::~Network () { + } + + // ////////////////////////////////////////////////////////////////////// + void Network::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void Network::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string Network::toString() const { + std::ostringstream oStr; + oStr << _key.toString(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Network::describeKey() const { + return _networkStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Network::describeShortKey() const { + return _networkStructure.describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + NetworkDateList_T Network::getNetworkDateList () const { + return _networkStructure.getChildrenHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + NetworkDateMap_T Network::getNetworkDateMap () const { + return _networkStructure.getChildrenHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + NetworkDate* Network:: + getNetworkDate (const NetworkDateKey_T& iKey) const { + return _networkStructure.getContentChild (iKey); + } + +} + Added: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp (rev 0) +++ trunk/stdair/stdair/bom/Network.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,109 @@ +#ifndef __STDAIR_BOM_NETWORK_HPP +#define __STDAIR_BOM_NETWORK_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/NetworkStructure.hpp> +#include <stdair/bom/NetworkTypes.hpp> +#include <stdair/bom/NetworkDateTypes.hpp> +#include <stdair/bom/NetworkContent.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct NetworkDateKey_T; + struct NetworkKey_T; + + /** Class representing the actual functional/business content for + a network. */ + class Network : public NetworkContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the BomRoot class, for all + // the types which require to be specified below + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef BomRoot Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef NetworkStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef NetworkKey_T BomKey_T; + + /** Definition allowing to retrieve the associated BOM content child + type. */ + typedef NetworkDate ContentChild_T; + + /** Definition allowing to retrieve the specific BookingClass type. */ + typedef BookingClass BookingClassContent_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn); + + /** Get the serialised version of the Business Object. */ + std::string toString() const; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a NetworkDateList_T for iteration methods. */ + NetworkDateList_T getNetworkDateList () const; + + /** Get a NetworkDateMap_T for iteration methods. */ + NetworkDateMap_T getNetworkDateMap () const; + + /** Retrieve, if existing, the NetworkDate corresponding to the + given network number and network date (NetworkDate key). + <br>If not existing, return the NULL pointer. */ + NetworkDate* getNetworkDate (const NetworkDateKey_T&) const; + + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _networkStructure; + } + + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + Network (); + Network (const Network&); + Network (const BomKey_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~Network(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _networkStructure; + }; + +} +#endif // __STDAIR_BOM_NETWORK_HPP + Copied: trunk/stdair/stdair/bom/NetworkContent.cpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkContent.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,20 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + NetworkContent::NetworkContent (const BomKey_T& iKey) : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + NetworkContent::~NetworkContent () { + } + +} + Copied: trunk/stdair/stdair/bom/NetworkContent.hpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkContent.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_NETWORKCONTENT_HPP +#define __STDAIR_BOM_NETWORKCONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/NetworkKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for an airline network. */ + class NetworkContent : public BomContent { + public : + // Type definitions + /** Definition allowing to retrieve the associated BOM key type. */ + typedef NetworkKey_T BomKey_T; + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + virtual void toStream (std::ostream& ioOut) const = 0; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + virtual void fromStream (std::istream& ioIn) = 0; + + /** Get the serialised version of the Business Object. */ + virtual std::string toString() const = 0; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + virtual const std::string describeKey() const = 0; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + virtual const std::string describeShortKey() const = 0; + + public: + // ////////// Getters //////////// + /** Get the network key. */ + const BomKey_T& getKey() const { + return _key; + } + + + protected: + /** Default constructors. */ + NetworkContent (const BomKey_T&); + NetworkContent (const NetworkContent&); + + /** Destructor. */ + virtual ~NetworkContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + }; + +} +#endif // __STDAIR_BOM_NETWORKCONTENT_HPP + Copied: trunk/stdair/stdair/bom/NetworkDate.cpp (from rev 87, trunk/stdair/stdair/bom/Inventory.cpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,62 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkDateStructure.hpp> +#include <stdair/bom/NetworkDate.hpp> +#include <stdair/bom/AirportDate.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + NetworkDate::NetworkDate (const BomKey_T& iKey, + BomStructure_T& ioNetworkDateStructure) + : NetworkDateContent (iKey), _networkDateStructure (ioNetworkDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + NetworkDate::~NetworkDate () { + } + + // ////////////////////////////////////////////////////////////////////// + void NetworkDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void NetworkDate::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string NetworkDate::toString() const { + std::ostringstream oStr; + oStr << _key.toString(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string NetworkDate::describeKey() const { + return _networkDateStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string NetworkDate::describeShortKey() const { + return _networkDateStructure.describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + AirportDateList_T NetworkDate::getAirportDateList () const { + return _networkDateStructure.getChildrenHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + AirportDateMap_T NetworkDate::getAirportDateMap () const { + return _networkDateStructure.getChildrenHolder(); + } + +} + Added: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,104 @@ +#ifndef __STDAIR_BOM_NETWORKDATE_HPP +#define __STDAIR_BOM_NETWORKDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/NetworkDateStructure.hpp> +#include <stdair/bom/NetworkDateTypes.hpp> +#include <stdair/bom/AirportDateTypes.hpp> +#include <stdair/bom/BookingClassTypes.hpp> +#include <stdair/bom/NetworkDateContent.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct AirportDateKey_T; + struct NetworkDateKey_T; + + /** Class representing the actual functional/business content for + a network-date. */ + class NetworkDate : public NetworkDateContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the BomRoot class, for all + // the types which require to be specified below + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef BomRoot Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef NetworkDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef NetworkDateKey_T BomKey_T; + + /** Definition allowing to retrieve the associated BOM content child + type. */ + typedef AirportDate ContentChild_T; + + /** Definition allowing to retrieve the specific BookingClass type. */ + typedef BookingClass BookingClassContent_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn); + + /** Get the serialised version of the Business Object. */ + std::string toString() const; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a AirportDateList_T for iteration methods. */ + AirportDateList_T getAirportDateList () const; + + /** Get a AirportDateMap_T for iteration methods. */ + AirportDateMap_T getAirportDateMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _networkDateStructure; + } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + NetworkDate (); + NetworkDate (const NetworkDate&); + NetworkDate (const BomKey_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~NetworkDate(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _networkDateStructure; + + }; + +} +#endif // __STDAIR_BOM_NETWORKDATE_HPP + Copied: trunk/stdair/stdair/bom/NetworkDateContent.cpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDateContent.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,20 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkDateContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + NetworkDateContent::NetworkDateContent (const BomKey_T& iKey) : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + NetworkDateContent::~NetworkDateContent () { + } + +} + Copied: trunk/stdair/stdair/bom/NetworkDateContent.hpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDateContent.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_NETWORKDATECONTENT_HPP +#define __STDAIR_BOM_NETWORKDATECONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/NetworkDateKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for a network-date. */ + class NetworkDateContent : public ... [truncated message content] |
From: <den...@us...> - 2010-01-04 20:06:51
|
Revision: 87 http://stdair.svn.sourceforge.net/stdair/?rev=87&view=rev Author: denis_arnaud Date: 2010-01-04 20:06:45 +0000 (Mon, 04 Jan 2010) Log Message: ----------- [Dev] Fixed a compilation issue within the BomManager::display() utility. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.hpp Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-01-04 20:03:11 UTC (rev 86) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-04 20:06:45 UTC (rev 87) @@ -11,6 +11,13 @@ // Forward declarations class BomRoot; + class Inventory; + class FlightDate; + class LegDate; + class LegCabin; + class SegmentDate; + class SegmentCabin; + class BookingClass; /** Utility class for StdAir objects. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-04 20:03:17
|
Revision: 86 http://stdair.svn.sourceforge.net/stdair/?rev=86&view=rev Author: denis_arnaud Date: 2010-01-04 20:03:11 +0000 (Mon, 04 Jan 2010) Log Message: ----------- [Dev] Improved the granularity of the BomManager::display() utility. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-01-04 17:13:25 UTC (rev 85) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-01-04 20:03:11 UTC (rev 86) @@ -23,66 +23,124 @@ // ////////////////////////////////////////////////////////////////////// void BomManager::display (std::ostream& oStream, const BomRoot& iBomRoot) { - // Browse the Inventory objects - const InventoryList_T lInventoryList= iBomRoot.getInventoryList (); + const InventoryList_T& lInventoryList= iBomRoot.getInventoryList (); for (InventoryList_T::iterator itInv = lInventoryList.begin(); itInv != lInventoryList.end(); ++itInv) { const Inventory& lCurrentInventory = *itInv; - oStream << "Inventory: " << lCurrentInventory.toString(); - // Browse the FlightDate objects - const FlightDateList_T lFDList = - lCurrentInventory.getFlightDateList (); - for (FlightDateList_T::iterator itFD = lFDList.begin(); - itFD != lFDList.end(); ++itFD) { - const FlightDate& lCurrentFD = *itFD; - oStream << "Flight-date: " << lCurrentFD.toString(); + // Call recursively the display() method on the children objects + display (oStream, lCurrentInventory); + } - // Browse the LegDate objects - const LegDateList_T lLDList = lCurrentFD.getLegDateList(); - for (LegDateList_T::iterator itLD = lLDList.begin(); - itLD != lLDList.end(); ++itLD) { - const LegDate& lCurrentLD = *itLD; - oStream << "Leg-date: " << lCurrentLD.toString(); - - // Browse the LegCabin objects - const LegCabinList_T lLCList = lCurrentLD.getLegCabinList(); - for (LegCabinList_T::iterator itLC = lLCList.begin(); - itLC != lLCList.end(); ++itLC) { - const LegCabin& lCurrentLC = *itLC; - oStream << "Leg-cabin: " << lCurrentLC.toString(); - } - } - - // Browse the SegmentDate objects - const SegmentDateList_T lSDList = - lCurrentFD.getSegmentDateList(); - for (SegmentDateList_T::iterator itSD = lSDList.begin(); - itSD != lSDList.end(); ++itSD) { - const SegmentDate& lCurrentSD = *itSD; - oStream << "Segment-date: " << lCurrentSD.toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, const Inventory& iInventory) { + // Inventory level + oStream << "Inventory: " << iInventory.toString(); + + // Browse the FlightDate objects + const FlightDateList_T& lFDList = iInventory.getFlightDateList (); + for (FlightDateList_T::iterator itFD = lFDList.begin(); + itFD != lFDList.end(); ++itFD) { + const FlightDate& lCurrentFD = *itFD; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentFD); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const FlightDate& iFlightDate) { + // Flight-date level + oStream << "Flight-date: " << iFlightDate.toString(); + + // Browse the LegDate objects + const LegDateList_T& lLDList = iFlightDate.getLegDateList(); + for (LegDateList_T::iterator itLD = lLDList.begin(); + itLD != lLDList.end(); ++itLD) { + const LegDate& lCurrentLD = *itLD; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentLD); + } + + // Browse the SegmentDate objects + const SegmentDateList_T& lSDList = iFlightDate.getSegmentDateList(); + for (SegmentDateList_T::iterator itSD = lSDList.begin(); + itSD != lSDList.end(); ++itSD) { + const SegmentDate& lCurrentSD = *itSD; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentSD); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const LegDate& iLegDate) { + // Leg-date level + oStream << "Leg-date: " << iLegDate.toString(); + + // Browse the LegCabin objects + const LegCabinList_T& lLCList = iLegDate.getLegCabinList(); + for (LegCabinList_T::iterator itLC = lLCList.begin(); + itLC != lLCList.end(); ++itLC) { + const LegCabin& lCurrentLC = *itLC; - // Browse the SegmentCabin objects - const SegmentCabinList_T lSCList = - lCurrentSD.getSegmentCabinList(); - for (SegmentCabinList_T::iterator itSC = lSCList.begin(); - itSC != lSCList.end(); ++itSC) { - const SegmentCabin& lCurrentSC = *itSC; - oStream << "Segment-cabin: " << lCurrentSC.toString(); + // Call recursively the display() method on the children objects + display (oStream, lCurrentLC); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const LegCabin& iLegCabin) { + // Leg-cabin level + oStream << "Leg-cabin: " << iLegCabin.toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const SegmentDate& iSegmentDate) { + // Segment-date level + oStream << "Segment-date: " << iSegmentDate.toString(); - // Browse the BookingClass objects - const BookingClassList_T lBCList = - lCurrentSC.getBookingClassList (); - for (BookingClassList_T::iterator itBC = lBCList.begin(); - itBC != lBCList.end(); ++itBC) { - const BookingClass& lCurrentBC = *itBC; - oStream << "Booking class: " << lCurrentBC.toString(); - } - } - } - } + // Browse the SegmentCabin objects + const SegmentCabinList_T& lSCList = iSegmentDate.getSegmentCabinList(); + for (SegmentCabinList_T::iterator itSC = lSCList.begin(); + itSC != lSCList.end(); ++itSC) { + const SegmentCabin& lCurrentSC = *itSC; + + // Call recursively the display() method on the children objects + display (oStream, lCurrentSC); } - } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const SegmentCabin& iSegmentCabin) { + // Segment-cabin level + oStream << "Segment-cabin: " << iSegmentCabin.toString(); + + // Browse the BookingClass objects + const BookingClassList_T& lBCList = iSegmentCabin.getBookingClassList (); + for (BookingClassList_T::iterator itBC = lBCList.begin(); + itBC != lBCList.end(); ++itBC) { + const BookingClass& lCurrentBC = *itBC; + // Call recursively the display() method on the children objects + display (oStream, lCurrentBC); + } + } + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, + const BookingClass& iBookingClass) { + // Booking-class level + oStream << "Booking class: " << iBookingClass.toString(); + } + } Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-01-04 17:13:25 UTC (rev 85) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-04 20:03:11 UTC (rev 86) @@ -16,12 +16,62 @@ /** Utility class for StdAir objects. */ class BomManager { public: + // //////////////// Display support methods ///////////////// /** Recursively display (dump in the underlying output log stream) the objects of the given BOM tree. @param std::ostream& Output stream in which the BOM tree should be logged/dumped. @param const BomRoot& Root of the BOM tree to be displayed. */ static void display (std::ostream&, const BomRoot&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const Inventory& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const Inventory&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const FlightDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const FlightDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const LegDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const LegDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const LegCabin& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const LegCabin&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const SegmentDate& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const SegmentDate&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const SegmentCabin& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const SegmentCabin&); + + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const BookingClass& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const BookingClass&); }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-01-04 17:13:31
|
Revision: 85 http://stdair.svn.sourceforge.net/stdair/?rev=85&view=rev Author: quannaus Date: 2010-01-04 17:13:25 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Seperate the linkage phase from the initialisation phase of the content child. Modified Paths: -------------- trunk/stdair/stdair/factory/FacBomContent.hpp Modified: trunk/stdair/stdair/factory/FacBomContent.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomContent.hpp 2010-01-04 10:55:59 UTC (rev 84) +++ trunk/stdair/stdair/factory/FacBomContent.hpp 2010-01-04 17:13:25 UTC (rev 85) @@ -45,22 +45,29 @@ <br>A structure object is created, under the hood, with the given key. That structure object then gets a pointer on the content object. */ template <typename BOM_CONTENT_CHILD> - BOM_CONTENT_CHILD& create (typename BOM_CONTENT_CHILD::Parent_T& ioContentParent, typename BOM_CONTENT_CHILD::BomKey_T& ioKey) { + BOM_CONTENT_CHILD& create (typename BOM_CONTENT_CHILD::BomKey_T& ioKey) { + + // Create the child structure object for the given key + BOM_CONTENT_CHILD& lBomContentChild = + createInternal<BOM_CONTENT_CHILD> (ioKey); - // Define the parent key type. + return lBomContentChild; + } + + /** Link a child content objet with his parent. */ + template <typename BOM_CONTENT_CHILD> + static void linkWithParent (BOM_CONTENT_CHILD& ioContentChild, typename BOM_CONTENT_CHILD::Parent_T& ioContentParent) { + + // Define the key types. typedef typename BOM_CONTENT_CHILD::Parent_T::BomKey_T ParentKey_T; - + // Finish the construction of the child key by setting its parent. const ParentKey_T& lParentKey = ioContentParent.getKey(); - ioKey.setParentKey (lParentKey); + ioContentChild._key.setParentKey (lParentKey); - // Create the child structure object for the given key - BOM_CONTENT_CHILD& lBomContentChild = - createInternal<BOM_CONTENT_CHILD> (ioKey); - // Retrieve the child structure object typename BOM_CONTENT_CHILD::BomStructure_T& lBomStructureChild = - lBomContentChild.getBomStructure (); + ioContentChild.getBomStructure (); // Type for the parent Bom content typedef typename BOM_CONTENT_CHILD::Parent_T PARENT_CONTENT_T; @@ -83,8 +90,6 @@ if (hasLinkBeenSuccessful == false) { throw new MemoryAllocationException(); } - - return lBomContentChild; } private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-01-04 10:56:05
|
Revision: 84 http://stdair.svn.sourceforge.net/stdair/?rev=84&view=rev Author: quannaus Date: 2010-01-04 10:55:59 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Some small changes in the airline code. Modified Paths: -------------- trunk/stdair/test/samples/schedule01.csv Modified: trunk/stdair/test/samples/schedule01.csv =================================================================== --- trunk/stdair/test/samples/schedule01.csv 2010-01-04 10:52:57 UTC (rev 83) +++ trunk/stdair/test/samples/schedule01.csv 2010-01-04 10:55:59 UTC (rev 84) @@ -3,6 +3,6 @@ // ElapsedTime; LegCabins; // LegCabins: CabinCode; Capacity; // Segments: Specific; -AA; 117; 2009-01-15; 2009-01-28; 1111100; LHR; JFK; 08:20; 11:00; 07:40; Y; 300; 0; Y; YM; -AA; 117; 2009-01-15; 2009-01-28; 0000011; LHR; JFK; 09:20; 12:00; 07:40; Y; 200; 0; Y; YM; +BA; 117; 2009-01-15; 2009-01-28; 1111100; LHR; JFK; 08:20; 11:00; 07:40; Y; 300; 0; Y; YM; +BA; 117; 2009-01-15; 2009-01-28; 0000011; LHR; JFK; 09:20; 12:00; 07:40; Y; 200; 0; Y; YM; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-01-04 10:53:03
|
Revision: 83 http://stdair.svn.sourceforge.net/stdair/?rev=83&view=rev Author: quannaus Date: 2010-01-04 10:52:57 +0000 (Mon, 04 Jan 2010) Log Message: ----------- [Dev] Some small changes in the type definition. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-02 01:12:19 UTC (rev 82) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-04 10:52:57 UTC (rev 83) @@ -167,6 +167,9 @@ /** Define the number of seats required by a demand. */ typedef unsigned short NbOfSeats_T; + /** Number of passengers (in a group) for a booking. */ + typedef unsigned short PartySize_T; + /** Define a mean value (e.g., 20.2). */ typedef double MeanValue_T; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-02 01:12:26
|
Revision: 82 http://stdair.svn.sourceforge.net/stdair/?rev=82&view=rev Author: denis_arnaud Date: 2010-01-02 01:12:19 +0000 (Sat, 02 Jan 2010) Log Message: ----------- [Dev] Added the implementation of both BookingRequestStruct and TravelSolutionStruct. There is still work to do, though, for those objects. Modified Paths: -------------- trunk/stdair/stdair/bom/BookingRequestStruct.hpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/BookingRequestStruct.cpp trunk/stdair/stdair/bom/TravelSolutionStruct.cpp Added: trunk/stdair/stdair/bom/BookingRequestStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.cpp (rev 0) +++ trunk/stdair/stdair/bom/BookingRequestStruct.cpp 2010-01-02 01:12:19 UTC (rev 82) @@ -0,0 +1,28 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +#include <istream> +#include <ostream> +#include <sstream> +// StdAir +#include <stdair/bom/BookingRequestStruct.hpp> + +namespace stdair { + + // ////////////////////////////////////////////////////////////////////// + void BookingRequestStruct::toStream (std::ostream& ioOut) const { + ioOut << describe(); + } + + // ////////////////////////////////////////////////////////////////////// + void BookingRequestStruct::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string BookingRequestStruct::describe() const { + return ""; + } + +} Modified: trunk/stdair/stdair/bom/BookingRequestStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-01 19:02:08 UTC (rev 81) +++ trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-02 01:12:19 UTC (rev 82) @@ -9,33 +9,96 @@ #include <string> // StdAir #include <stdair/bom/StructAbstract.hpp> +#include <stdair/STDAIR_Types.hpp> namespace stdair { /** Structure holding the elements of a booking request. */ struct BookingRequestStruct : public StructAbstract { public: + // /////////////// Getters ///////////////// + /** Get the requested origin. */ + const AirportCode_T& getOrigin() const { + return _origin; + } + /** Get the requested destination. */ + const AirportCode_T& getDestination() const { + return _destination; + } + + /** Get the requested departure date. */ + const Date_T& getDepartureDate() const { + return _departureDate; + } + + /** Get the passenger type. */ + const PassengerType_T& getPaxType() const { + return _paxType; + } + + /** Get the party size. */ + const NbOfSeats_T& getPartySize() const { + return _partySize; + } + + + // /////////////// Setters ///////////////// + /** Set the requested origin. */ + void setOrigin (const AirportCode_T& iOrigin) { + _origin = iOrigin; + } + + /** Set the requested destination. */ + void setDestination (const AirportCode_T& iDestination) { + _destination = iDestination; + } + + /** Set the requested departure date. */ + void setDepartureDate (const Date_T& iDepartureDate) { + _departureDate = iDepartureDate; + } + + /** Set the passenger type. */ + void setPaxType (const PassengerType_T& iPaxType) { + _paxType = iPaxType; + } + + /** Set the party size. */ + void setPartySize (const NbOfSeats_T& iPartySize) { + _partySize = iPartySize; + } + + // /////////// Display support method ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const { - ioOut << describe(); - } + void toStream (std::ostream& ioOut) const; /** Read a Business Object from an input stream. @param istream& the input stream. */ - void fromStream (std::istream& ioIn) { - } + void fromStream (std::istream& ioIn); /** Display of the structure. */ - const std::string describe() const { - return ""; - } + const std::string describe() const; - + private: + // /////////////// Attributes ///////////////// + /** Origin. */ + AirportCode_T _origin; + /** Destination. */ + AirportCode_T _destination; + + /** Departure date. */ + Date_T _departureDate; + + /** Passenger type. */ + PassengerType_T _paxType; + + /** Party size. */ + NbOfSeats_T _partySize; }; } Added: trunk/stdair/stdair/bom/TravelSolutionStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.cpp (rev 0) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-01-02 01:12:19 UTC (rev 82) @@ -0,0 +1,28 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +#include <istream> +#include <ostream> +#include <sstream> +// StdAir +#include <stdair/bom/TravelSolutionStruct.hpp> + +namespace stdair { + + // ////////////////////////////////////////////////////////////////////// + void TravelSolutionStruct::toStream (std::ostream& ioOut) const { + ioOut << describe(); + } + + // ////////////////////////////////////////////////////////////////////// + void TravelSolutionStruct::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string TravelSolutionStruct::describe() const { + return ""; + } + +} Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-01-01 19:02:08 UTC (rev 81) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-01-02 01:12:19 UTC (rev 82) @@ -19,19 +19,14 @@ // /////////// Display support method ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const { - ioOut << describe(); - } + void toStream (std::ostream& ioOut) const; /** Read a Business Object from an input stream. @param istream& the input stream. */ - void fromStream (std::istream& ioIn) { - } + void fromStream (std::istream& ioIn); /** Display of the structure. */ - const std::string describe() const { - return ""; - } + const std::string describe() const; private: Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-01-01 19:02:08 UTC (rev 81) +++ trunk/stdair/stdair/bom/sources.mk 2010-01-02 01:12:19 UTC (rev 82) @@ -98,5 +98,6 @@ $(top_srcdir)/stdair/bom/AirlineFeatureContent.cpp \ $(top_srcdir)/stdair/bom/OptimizerStruct.cpp \ $(top_srcdir)/stdair/bom/DoWStruct.cpp \ + $(top_srcdir)/stdair/bom/TravelSolutionStruct.cpp \ + $(top_srcdir)/stdair/bom/BookingRequestStruct.cpp \ $(top_srcdir)/stdair/bom/BomManager.cpp - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-01 19:43:33
|
Revision: 80 http://stdair.svn.sourceforge.net/stdair/?rev=80&view=rev Author: denis_arnaud Date: 2010-01-01 18:55:41 +0000 (Fri, 01 Jan 2010) Log Message: ----------- [Test samples] Added a line in the input schedule file. Modified Paths: -------------- trunk/stdair/test/samples/schedule01.csv Modified: trunk/stdair/test/samples/schedule01.csv =================================================================== --- trunk/stdair/test/samples/schedule01.csv 2009-12-30 16:47:56 UTC (rev 79) +++ trunk/stdair/test/samples/schedule01.csv 2010-01-01 18:55:41 UTC (rev 80) @@ -3,4 +3,6 @@ // ElapsedTime; LegCabins; // LegCabins: CabinCode; Capacity; // Segments: Specific; -AA; 117; 2009-01-15; 2009-01-28; 1000000; LHR; JFK; 08:20; 11:00; 07:40; Y; 300; 0; Y; YM; \ No newline at end of file +AA; 117; 2009-01-15; 2009-01-28; 1111100; LHR; JFK; 08:20; 11:00; 07:40; Y; 300; 0; Y; YM; +AA; 117; 2009-01-15; 2009-01-28; 0000011; LHR; JFK; 09:20; 12:00; 07:40; Y; 200; 0; Y; YM; + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-01-01 19:42:49
|
Revision: 81 http://stdair.svn.sourceforge.net/stdair/?rev=81&view=rev Author: denis_arnaud Date: 2010-01-01 19:02:08 +0000 (Fri, 01 Jan 2010) Log Message: ----------- [Struct] Added the BomManager, BookingRequestStruct and TravelSolutionStruct structures. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/AirlineFeatureSet.cpp trunk/stdair/stdair/bom/AirlineFeatureSet.hpp trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp trunk/stdair/stdair/bom/BomContent.hpp trunk/stdair/stdair/bom/BomKey.hpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomStopStructure.hpp trunk/stdair/stdair/bom/BomStructure.hpp trunk/stdair/stdair/bom/StructAbstract.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/BookingRequestStruct.hpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -342,6 +342,12 @@ /** Define the total revenue of an unconstrained policy. */ typedef double PolicyRevenue_T; + + // ///////////// Technical //////////////// + /** File or directory name. + <br>It may contain paths, relative or absolute (e.g., /foo/bar + or C:\foo\bar). */ + typedef std::string Filename_T; } #endif // __STDAIR_STDAIR_TYPES_HPP Modified: trunk/stdair/stdair/bom/AirlineFeature.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-01-01 19:02:08 UTC (rev 81) @@ -1,8 +1,11 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> +// STL +#include <cassert> +#include <istream> +#include <ostream> +#include <sstream> // STDAIR #include <stdair/bom/AirlineFeatureStructure.hpp> #include <stdair/bom/AirlineFeature.hpp> Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> // STDAIR #include <stdair/bom/AirlineFeatureSet.hpp> #include <stdair/bom/AirlineFeatureStructure.hpp> @@ -12,17 +15,20 @@ #include <stdair/bom/AirlineFeatureTypes.hpp> namespace stdair { + // Forward declarations class FacBomContent; struct AirlineFeatureKey_T; + /** Class representing the actual functional/business content for a segment-cabin. */ class AirlineFeature : public AirlineFeatureContent { friend class FacBomContent; + public: - // Type definitions + // //////////// Type definitions ////////////// /** Definition allowing to retrieve the associated parent BOM content type. */ typedef AirlineFeatureSet Parent_T; @@ -36,15 +42,17 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef AirlineFeature ContentChild_T; + public: - // //////////// Setters ////////// - /** Intialization method. */ + // //////////// Setters ///////////// + /** Intialisation method. */ void init (const ForecasterMode_T&, const HistoricalDataLimit_T&, const OptimizerStruct_T&, const ControlMode_T&); + public: - // /////////// Display support methods ///////// + // /////////// Display support methods ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ void toStream (std::ostream& ioOut) const; @@ -67,13 +75,16 @@ /** Give a description of the structure (for display purposes). */ const std::string describe() const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { return _airlineFeatureStructure; } + protected: + // ///////////////// Constructors and destructors ///////////////// /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ @@ -84,8 +95,9 @@ /** Destructor. */ virtual ~AirlineFeature(); + protected: - // Attributes + // ////////////////////// Attributes /////////////////////////// /** Reference structure. */ BomStructure_T& _airlineFeatureStructure; }; Modified: trunk/stdair/stdair/bom/AirlineFeatureSet.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2010-01-01 19:02:08 UTC (rev 81) @@ -3,6 +3,9 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> +#include <istream> +#include <ostream> +#include <sstream> // STDAIR #include <stdair/bom/AirlineFeatureSetStructure.hpp> #include <stdair/bom/AirlineFeatureSet.hpp> @@ -25,6 +28,30 @@ } // ////////////////////////////////////////////////////////////////////// + void AirlineFeatureSet::toStream (std::ostream& ioOut) const { + ioOut << toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void AirlineFeatureSet::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string AirlineFeatureSet::toString() const { + return describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeatureSet::describeKey() const { + return std::string (""); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeatureSet::describeShortKey() const { + return std::string (""); + } + + // ////////////////////////////////////////////////////////////////////// const std::string AirlineFeatureSet::display() const { // Store current formatting flags of std::cout std::ios::fmtflags oldFlags = std::cout.flags(); Modified: trunk/stdair/stdair/bom/AirlineFeatureSet.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,9 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> // STDAIR #include <stdair/bom/AirlineFeatureSetStructure.hpp> #include <stdair/bom/AirlineFeatureSetContent.hpp> @@ -11,16 +14,19 @@ #include <stdair/bom/AirlineFeatureTypes.hpp> namespace stdair { + // Forward declarations. class FacBomContent; class AirlineFeature; struct AirlineFeatureKey_T; struct AirlineFeatureSetKey_T; + /** Class representing the actual functional/business content for the Bom root. */ class AirlineFeatureSet : public AirlineFeatureSetContent { friend class FacBomContent; + public: // ///////////////////////////////////////////////////////////////////////// @@ -35,29 +41,31 @@ typedef AirlineFeature ContentChild_T; // ///////////////////////////////////////////////////////////////////////// + public: - // /////////// Display support methods ///////// + // /////////// Display support methods ///////////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const { ioOut << toString(); } + void toStream (std::ostream& ioOut) const; /** Read a Business Object from an input stream. @param istream& the input stream. */ - void fromStream (std::istream& ioIn) { } + void fromStream (std::istream& ioIn); - /** Get the serialised version of the Business Object. */ - std::string toString() const { return describeKey(); } + /** Get the serialised version of the Business Object. */ + std::string toString() const; /** Get a string describing the whole key (differentiating two objects at any level). */ - const std::string describeKey() const { return std::string (""); } + const std::string describeKey() const; /** Get a string describing the short key (differentiating two objects at the same level). */ - const std::string describeShortKey() const { return std::string (""); } + const std::string describeShortKey() const; /** Display the full context of the set of airline features. */ const std::string display() const; + public: // /////////// Getters ///////////// @@ -72,13 +80,16 @@ /** Get a AirlineFeatureMap_T for iteration methods. */ AirlineFeatureMap_T getAirlineFeatureMap () const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { return _bomStructure; } - + + protected: + // ///////////////// Constructors and destructors ///////////////// /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ @@ -88,8 +99,9 @@ /** Destructor. */ virtual ~AirlineFeatureSet(); + private: - // Attributes + // ////////////////////// Attributes /////////////////////////// /** Reference structure. */ BomStructure_T& _bomStructure; }; Modified: trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> // MPL #include <boost/mpl/vector.hpp> // STDAIR @@ -105,7 +107,6 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - }; } Modified: trunk/stdair/stdair/bom/BomContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BomContent.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomContent.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -5,9 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <istream> -#include <ostream> -#include <sstream> +#include <iosfwd> #include <string> namespace stdair { Modified: trunk/stdair/stdair/bom/BomKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BomKey.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomKey.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -5,9 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <istream> -#include <ostream> -#include <sstream> +#include <iosfwd> #include <string> namespace stdair { Added: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp (rev 0) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,88 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +#include <ostream> +// STDAIR +#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/Inventory.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/BookingClass.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> +#include <stdair/bom/AirlineFeatureSet.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/BomManager.hpp> + +namespace stdair { + + // ////////////////////////////////////////////////////////////////////// + void BomManager::display (std::ostream& oStream, const BomRoot& iBomRoot) { + + // Browse the Inventory objects + const InventoryList_T lInventoryList= iBomRoot.getInventoryList (); + for (InventoryList_T::iterator itInv = lInventoryList.begin(); + itInv != lInventoryList.end(); ++itInv) { + const Inventory& lCurrentInventory = *itInv; + oStream << "Inventory: " << lCurrentInventory.toString(); + + // Browse the FlightDate objects + const FlightDateList_T lFDList = + lCurrentInventory.getFlightDateList (); + for (FlightDateList_T::iterator itFD = lFDList.begin(); + itFD != lFDList.end(); ++itFD) { + const FlightDate& lCurrentFD = *itFD; + oStream << "Flight-date: " << lCurrentFD.toString(); + + // Browse the LegDate objects + const LegDateList_T lLDList = lCurrentFD.getLegDateList(); + for (LegDateList_T::iterator itLD = lLDList.begin(); + itLD != lLDList.end(); ++itLD) { + const LegDate& lCurrentLD = *itLD; + oStream << "Leg-date: " << lCurrentLD.toString(); + + // Browse the LegCabin objects + const LegCabinList_T lLCList = lCurrentLD.getLegCabinList(); + for (LegCabinList_T::iterator itLC = lLCList.begin(); + itLC != lLCList.end(); ++itLC) { + const LegCabin& lCurrentLC = *itLC; + oStream << "Leg-cabin: " << lCurrentLC.toString(); + } + } + + // Browse the SegmentDate objects + const SegmentDateList_T lSDList = + lCurrentFD.getSegmentDateList(); + for (SegmentDateList_T::iterator itSD = lSDList.begin(); + itSD != lSDList.end(); ++itSD) { + const SegmentDate& lCurrentSD = *itSD; + oStream << "Segment-date: " << lCurrentSD.toString(); + + // Browse the SegmentCabin objects + const SegmentCabinList_T lSCList = + lCurrentSD.getSegmentCabinList(); + for (SegmentCabinList_T::iterator itSC = lSCList.begin(); + itSC != lSCList.end(); ++itSC) { + const SegmentCabin& lCurrentSC = *itSC; + oStream << "Segment-cabin: " << lCurrentSC.toString(); + + // Browse the BookingClass objects + const BookingClassList_T lBCList = + lCurrentSC.getBookingClassList (); + for (BookingClassList_T::iterator itBC = lBCList.begin(); + itBC != lBCList.end(); ++itBC) { + const BookingClass& lCurrentBC = *itBC; + oStream << "Booking class: " << lCurrentBC.toString(); + } + } + } + } + } + } + +} Added: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp (rev 0) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,28 @@ +#ifndef __STDAIR_BOM_BOMMANAGER_HPP +#define __STDAIR_BOM_BOMMANAGER_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> + +namespace stdair { + + // Forward declarations + class BomRoot; + + + /** Utility class for StdAir objects. */ + class BomManager { + public: + /** Recursively display (dump in the underlying output log stream) + the objects of the given BOM tree. + @param std::ostream& Output stream in which the BOM tree should be + logged/dumped. + @param const BomRoot& Root of the BOM tree to be displayed. */ + static void display (std::ostream&, const BomRoot&); + }; + +} +#endif // __STDAIR_BOM_BOMMANAGER_HPP Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> // STDAIR #include <stdair/bom/BomRootStructure.hpp> #include <stdair/bom/BomRootContent.hpp> Modified: trunk/stdair/stdair/bom/BomStopStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStopStructure.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomStopStructure.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,6 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <iostream> // STDAIR #include <stdair/bom/BomStructure.hpp> #include <stdair/bom/BomKey.hpp> Modified: trunk/stdair/stdair/bom/BomStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStructure.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/BomStructure.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -4,12 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> // STL -#include <istream> -#include <ostream> -#include <sstream> +#include <iosfwd> #include <string> namespace stdair { Added: trunk/stdair/stdair/bom/BookingRequestStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingRequestStruct.hpp (rev 0) +++ trunk/stdair/stdair/bom/BookingRequestStruct.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,42 @@ +#ifndef __STDAIR_BOM_BOOKINGREQUESTSTRUCT_HPP +#define __STDAIR_BOM_BOOKINGREQUESTSTRUCT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> +// StdAir +#include <stdair/bom/StructAbstract.hpp> + +namespace stdair { + + /** Structure holding the elements of a booking request. */ + struct BookingRequestStruct : public StructAbstract { + public: + + // /////////// Display support method ///////////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << describe(); + } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { + } + + /** Display of the structure. */ + const std::string describe() const { + return ""; + } + + + private: + + }; + +} +#endif // __STDAIR_BOM_BOOKINGREQUESTSTRUCT_HPP Modified: trunk/stdair/stdair/bom/StructAbstract.hpp =================================================================== --- trunk/stdair/stdair/bom/StructAbstract.hpp 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/StructAbstract.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -5,8 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <iostream> -#include <sstream> +#include <iosfwd> namespace stdair { Added: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp (rev 0) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-01-01 19:02:08 UTC (rev 81) @@ -0,0 +1,42 @@ +#ifndef __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP +#define __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +#include <string> +// StdAir +#include <stdair/bom/StructAbstract.hpp> + +namespace stdair { + + /** Structure holding the elements of a travel solution. */ + struct TravelSolutionStruct : public StructAbstract { + public: + + // /////////// Display support method ///////////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << describe(); + } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { + } + + /** Display of the structure. */ + const std::string describe() const { + return ""; + } + + + private: + + }; + +} +#endif // __STDAIR_BOM_TRAVELSOLUTIONSTRUCT_HPP Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-01-01 18:55:41 UTC (rev 80) +++ trunk/stdair/stdair/bom/sources.mk 2010-01-01 19:02:08 UTC (rev 81) @@ -61,7 +61,10 @@ $(top_srcdir)/stdair/bom/BomChildrenHolderImp.hpp \ $(top_srcdir)/stdair/bom/BomIterator.hpp \ $(top_srcdir)/stdair/bom/OptimizerStruct.hpp \ - $(top_srcdir)/stdair/bom/DoWStruct.hpp + $(top_srcdir)/stdair/bom/DoWStruct.hpp \ + $(top_srcdir)/stdair/bom/TravelSolutionStruct.hpp \ + $(top_srcdir)/stdair/bom/BookingRequestStruct.hpp \ + $(top_srcdir)/stdair/bom/BomManager.hpp bom_cc_sources = \ $(top_srcdir)/stdair/bom/BomRootKey.cpp \ $(top_srcdir)/stdair/bom/InventoryKey.cpp \ @@ -94,5 +97,6 @@ $(top_srcdir)/stdair/bom/AirlineFeature.cpp \ $(top_srcdir)/stdair/bom/AirlineFeatureContent.cpp \ $(top_srcdir)/stdair/bom/OptimizerStruct.cpp \ - $(top_srcdir)/stdair/bom/DoWStruct.cpp + $(top_srcdir)/stdair/bom/DoWStruct.cpp \ + $(top_srcdir)/stdair/bom/BomManager.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-30 16:48:08
|
Revision: 79 http://stdair.svn.sourceforge.net/stdair/?rev=79&view=rev Author: denis_arnaud Date: 2009-12-30 16:47:56 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Test] Changed a comment. Modified Paths: -------------- trunk/stdair/test/stdair/Makefile.am Modified: trunk/stdair/test/stdair/Makefile.am =================================================================== --- trunk/stdair/test/stdair/Makefile.am 2009-12-30 15:17:23 UTC (rev 78) +++ trunk/stdair/test/stdair/Makefile.am 2009-12-30 16:47:56 UTC (rev 79) @@ -1,4 +1,4 @@ -## test sub-directory +## test/stdair sub-directory include $(top_srcdir)/Makefile.common MAINTAINERCLEANFILES = Makefile.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-30 15:17:29
|
Revision: 78 http://stdair.svn.sourceforge.net/stdair/?rev=78&view=rev Author: denis_arnaud Date: 2009-12-30 15:17:23 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Test-Samples] Added a schedule input file. Modified Paths: -------------- trunk/stdair/test/samples/Makefile.am Added Paths: ----------- trunk/stdair/test/samples/schedule02.csv Modified: trunk/stdair/test/samples/Makefile.am =================================================================== --- trunk/stdair/test/samples/Makefile.am 2009-12-30 15:04:25 UTC (rev 77) +++ trunk/stdair/test/samples/Makefile.am 2009-12-30 15:17:23 UTC (rev 78) @@ -6,5 +6,6 @@ ## SUBDIRS = -EXTRA_DIST = schedule01.csv +EXTRA_DIST = schedule01.csv schedule02.csv ## + Added: trunk/stdair/test/samples/schedule02.csv =================================================================== --- trunk/stdair/test/samples/schedule02.csv (rev 0) +++ trunk/stdair/test/samples/schedule02.csv 2009-12-30 15:17:23 UTC (rev 78) @@ -0,0 +1,6 @@ +// Flights: AirlineCode; FlightNumber; Date-Range; ; DOW; Legs; Segments; +// Legs: BoardPoint; OffPoint; BoardTime; ArrivalDateOffSet; ArrivalTime; +// ElapsedTime; LegCabins; +// LegCabins: CabinCode; Capacity; +// Segments: Specific; +BA; 117; 2009-01-15; 2009-01-28; 1000000; LHR; JFK; 08:20; 11:00; 07:40; Y; 300; 0; Y; YM; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-30 15:04:34
|
Revision: 77 http://stdair.svn.sourceforge.net/stdair/?rev=77&view=rev Author: denis_arnaud Date: 2009-12-30 15:04:25 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Test] Added a directory for the samples. Modified Paths: -------------- trunk/stdair/test/samples/Makefile.am Modified: trunk/stdair/test/samples/Makefile.am =================================================================== --- trunk/stdair/test/samples/Makefile.am 2009-12-30 15:03:52 UTC (rev 76) +++ trunk/stdair/test/samples/Makefile.am 2009-12-30 15:04:25 UTC (rev 77) @@ -1,4 +1,4 @@ -## test sub-directory +## test/samples sub-directory include $(top_srcdir)/Makefile.common MAINTAINERCLEANFILES = Makefile.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-30 15:04:21
|
Revision: 76 http://stdair.svn.sourceforge.net/stdair/?rev=76&view=rev Author: denis_arnaud Date: 2009-12-30 15:03:52 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Test] Added a directory for the samples. Modified Paths: -------------- trunk/stdair/configure.ac trunk/stdair/test/Makefile.am Added Paths: ----------- trunk/stdair/test/samples/ trunk/stdair/test/samples/Makefile.am trunk/stdair/test/samples/schedule01.csv Modified: trunk/stdair/configure.ac =================================================================== --- trunk/stdair/configure.ac 2009-12-30 14:21:42 UTC (rev 75) +++ trunk/stdair/configure.ac 2009-12-30 15:03:52 UTC (rev 76) @@ -202,6 +202,7 @@ doc/sourceforge/howto_release_stdair.html extracppunit/Makefile test/Makefile + test/samples/Makefile test/inheritance/Makefile test/mpl/Makefile test/mpl/contrib/Makefile Modified: trunk/stdair/test/Makefile.am =================================================================== --- trunk/stdair/test/Makefile.am 2009-12-30 14:21:42 UTC (rev 75) +++ trunk/stdair/test/Makefile.am 2009-12-30 15:03:52 UTC (rev 76) @@ -4,7 +4,7 @@ MAINTAINERCLEANFILES = Makefile.in ## -SUBDIRS = inheritance mpl stdair +SUBDIRS = samples inheritance mpl stdair EXTRA_DIST = ## Property changes on: trunk/stdair/test/samples ___________________________________________________________________ Added: svn:ignore + .deps .libs Makefile.in Makefile Copied: trunk/stdair/test/samples/Makefile.am (from rev 73, trunk/stdair/test/Makefile.am) =================================================================== --- trunk/stdair/test/samples/Makefile.am (rev 0) +++ trunk/stdair/test/samples/Makefile.am 2009-12-30 15:03:52 UTC (rev 76) @@ -0,0 +1,10 @@ +## test sub-directory +include $(top_srcdir)/Makefile.common + +MAINTAINERCLEANFILES = Makefile.in + +## +SUBDIRS = + +EXTRA_DIST = schedule01.csv +## Added: trunk/stdair/test/samples/schedule01.csv =================================================================== --- trunk/stdair/test/samples/schedule01.csv (rev 0) +++ trunk/stdair/test/samples/schedule01.csv 2009-12-30 15:03:52 UTC (rev 76) @@ -0,0 +1,6 @@ +// Flights: AirlineCode; FlightNumber; Date-Range; ; DOW; Legs; Segments; +// Legs: BoardPoint; OffPoint; BoardTime; ArrivalDateOffSet; ArrivalTime; +// ElapsedTime; LegCabins; +// LegCabins: CabinCode; Capacity; +// Segments: Specific; +AA; 117; 2009-01-15; 2009-01-28; 1000000; LHR; JFK; 08:20; 11:00; 07:40; Y; 300; 0; Y; YM; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-30 14:21:51
|
Revision: 75 http://stdair.svn.sourceforge.net/stdair/?rev=75&view=rev Author: denis_arnaud Date: 2009-12-30 14:21:42 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Conf] Added a few Autotools (M4) macro files. Added Paths: ----------- trunk/stdair/config/ax_boost_base.m4 trunk/stdair/config/ax_boost_date_time.m4 Removed Paths: ------------- trunk/stdair/config/ax_boost_date-time.m4 Added: trunk/stdair/config/ax_boost_base.m4 =================================================================== --- trunk/stdair/config/ax_boost_base.m4 (rev 0) +++ trunk/stdair/config/ax_boost_base.m4 2009-12-30 14:21:42 UTC (rev 75) @@ -0,0 +1,201 @@ +# $Id: ax_boost_base.m4,v 1.2 2007/06/23 01:51:22 mloskot Exp $ +# +##### http://autoconf-archive.cryp.to/ax_boost_base.html +# +# SYNOPSIS +# +# AX_BOOST_BASE([MINIMUM-VERSION]) +# +# DESCRIPTION +# +# Test for the Boost C++ libraries of a particular version (or newer) +# +# If no path to the installed boost library is given the macro +# searchs under /usr, /usr/local, and /opt, and evaluates the +# $BOOST_ROOT environment variable. Further documentation is +# available at <http://randspringer.de/boost/index.html>. +# +# This macro calls: +# +# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) +# +# And sets: +# +# HAVE_BOOST +# +# LAST MODIFICATION +# +# 2007-03-15 +# +# COPYLEFT +# +# Copyright (c) 2007 Thomas Porschberg <th...@ra...> +# +# Copying and distribution of this file, with or without +# modification, are permitted in any medium without royalty provided +# the copyright notice and this notice are preserved. + +AC_DEFUN([AX_BOOST_BASE], +[ +AC_ARG_WITH( + [boost], + AS_HELP_STRING([--with-boost@<:@=ARG@:>@], [use Boost @<:@default=yes@:>@, optionally specify path to Boost root directory]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ac_boost_path="" + else + want_boost="yes" + ac_boost_path="$withval" + fi + ], + [want_boost="yes"]) + +if test "x$want_boost" = "xyes"; then + boost_lib_version_req=ifelse([$1], ,1.20.0,$1) + boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` + boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` + boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$boost_lib_version_req_sub_minor" = "x" ; then + boost_lib_version_req_sub_minor="0" + fi + WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` + AC_MSG_CHECKING(for Boost base libraries >= $boost_lib_version_req) + succeeded=no + + dnl first we check the system location for boost libraries + dnl this location ist chosen if boost libraries are installed with the --layout=system option + dnl or if you install boost with RPM + if test "$ac_boost_path" != ""; then + BOOST_LDFLAGS="-L$ac_boost_path/lib" + BOOST_CPPFLAGS="-I$ac_boost_path/include" + else + for ac_boost_path_tmp in /usr /usr/local /opt ; do + if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then + BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib" + BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" + break; + fi + done + fi + + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include <boost/version.hpp> + ]], [[ + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + succeeded=yes + found_system=yes + ],[ + ]) + AC_LANG_POP([C++]) + + + + dnl if we found no boost with system layout we search for boost libraries + dnl built and installed without the --layout=system option or for a staged(not installed) version + if test "x$succeeded" != "xyes"; then + _version=0 + if test "$ac_boost_path" != ""; then + BOOST_LDFLAGS="-L$ac_boost_path/lib" + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + fi + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" + done + fi + else + for ac_boost_path in /usr /usr/local /opt ; do + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + best_path=$ac_boost_path + fi + done + fi + done + + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" + BOOST_LDFLAGS="-L$best_path/lib" + + if test "x$BOOST_ROOT" != "x"; then + if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then + version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` + stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` + stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` + V_CHECK=`expr $stage_version_shorten \>\= $_version` + if test "$V_CHECK" = "1" ; then + AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) + BOOST_CPPFLAGS="-I$BOOST_ROOT" + BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib" + fi + fi + fi + fi + + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include <boost/version.hpp> + ]], [[ + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + succeeded=yes + found_system=yes + ],[ + ]) + AC_LANG_POP([C++]) + fi + + if test "$succeeded" != "yes" ; then + if test "$_version" = "0" ; then + AC_MSG_ERROR([[We could not detect the Boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged Boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]]) + else + AC_MSG_NOTICE([Your Boost libraries seems too old (version $_version).]) + fi + else + AC_SUBST(BOOST_CPPFLAGS) + AC_SUBST(BOOST_LDFLAGS) + AC_DEFINE(HAVE_BOOST, [1], [define if the Boost library is available]) + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" +fi + +]) Deleted: trunk/stdair/config/ax_boost_date-time.m4 =================================================================== --- trunk/stdair/config/ax_boost_date-time.m4 2009-12-30 13:45:29 UTC (rev 74) +++ trunk/stdair/config/ax_boost_date-time.m4 2009-12-30 14:21:42 UTC (rev 75) @@ -1,43 +0,0 @@ -dnl @synopsis AX_BOOST_DATE_TIME -dnl -dnl This macro checks to see if the Boost.DateTime library is -dnl installed. It also attempts to guess the currect library name using -dnl several attempts. It tries to build the library name using a user -dnl supplied name or suffix and then just the raw library. -dnl -dnl If the library is found, HAVE_BOOST_DATE_TIME is defined and -dnl BOOST_DATE_TIME_LIB is set to the name of the library. -dnl -dnl This macro calls AC_SUBST(BOOST_DATE_TIME_LIB). -dnl -dnl @category InstalledPackages -dnl @author Michael Tindal <mt...@pa...> -dnl @version 2004-09-20 -dnl @license GPLWithACException - -AC_DEFUN([AX_BOOST_DATE_TIME], -[AC_REQUIRE([AC_CXX_NAMESPACES])dnl -AC_CACHE_CHECK(whether the Boost::DateTime library is available, -ax_cv_boost_date_time, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <boost/date_time/gregorian/gregorian_types.hpp>]], - [[using namespace boost::gregorian; date d(2002,Jan,10); return 0;]]), - ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) - AC_LANG_RESTORE -]) -if test "$ax_cv_boost_date_time" = yes; then - AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::DateTime library is available]) - dnl Now determine the appropriate file names - AC_ARG_WITH([boost-date-time],AS_HELP_STRING([--with-boost-date-time], - [specify the boost date-time library or suffix to use]), - [if test "x$with_boost_date_time" != "xno"; then - ax_date_time_lib=$with_boost_date_time - ax_boost_date_time_lib=boost_date_time-$with_boost_date_time - fi]) - for ax_lib in $ax_date_time_lib $ax_boost_date_time_lib boost_date_time boost_date_time-gcc; do - AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB=$ax_lib break]) - done - AC_SUBST(BOOST_DATE_TIME_LIB) -fi -])dnl Copied: trunk/stdair/config/ax_boost_date_time.m4 (from rev 73, trunk/stdair/config/ax_boost_date-time.m4) =================================================================== --- trunk/stdair/config/ax_boost_date_time.m4 (rev 0) +++ trunk/stdair/config/ax_boost_date_time.m4 2009-12-30 14:21:42 UTC (rev 75) @@ -0,0 +1,43 @@ +dnl @synopsis AX_BOOST_DATE_TIME +dnl +dnl This macro checks to see if the Boost.DateTime library is +dnl installed. It also attempts to guess the currect library name using +dnl several attempts. It tries to build the library name using a user +dnl supplied name or suffix and then just the raw library. +dnl +dnl If the library is found, HAVE_BOOST_DATE_TIME is defined and +dnl BOOST_DATE_TIME_LIB is set to the name of the library. +dnl +dnl This macro calls AC_SUBST(BOOST_DATE_TIME_LIB). +dnl +dnl @category InstalledPackages +dnl @author Michael Tindal <mt...@pa...> +dnl @version 2004-09-20 +dnl @license GPLWithACException + +AC_DEFUN([AX_BOOST_DATE_TIME], +[AC_REQUIRE([AC_CXX_NAMESPACES])dnl +AC_CACHE_CHECK(whether the Boost::DateTime library is available, +ax_cv_boost_date_time, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <boost/date_time/gregorian/gregorian_types.hpp>]], + [[using namespace boost::gregorian; date d(2002,Jan,10); return 0;]]), + ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) + AC_LANG_RESTORE +]) +if test "$ax_cv_boost_date_time" = yes; then + AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::DateTime library is available]) + dnl Now determine the appropriate file names + AC_ARG_WITH([boost-date-time],AS_HELP_STRING([--with-boost-date-time], + [specify the boost date-time library or suffix to use]), + [if test "x$with_boost_date_time" != "xno"; then + ax_date_time_lib=$with_boost_date_time + ax_boost_date_time_lib=boost_date_time-$with_boost_date_time + fi]) + for ax_lib in $ax_date_time_lib $ax_boost_date_time_lib boost_date_time boost_date_time-gcc; do + AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB=$ax_lib break]) + done + AC_SUBST(BOOST_DATE_TIME_LIB) +fi +])dnl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-30 14:01:26
|
Revision: 74 http://stdair.svn.sourceforge.net/stdair/?rev=74&view=rev Author: denis_arnaud Date: 2009-12-30 13:45:29 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Conf] Added a few Autotools (M4) macro files. Added Paths: ----------- trunk/stdair/config/ax_cxx_toolset.m4 trunk/stdair/config/ax_firebird.m4 trunk/stdair/config/ax_icu.m4 trunk/stdair/config/ax_mysql.m4 trunk/stdair/config/ax_odbc.m4 trunk/stdair/config/ax_oracle_oci.m4 trunk/stdair/config/ax_postgresql.m4 trunk/stdair/config/ax_sqlite3.m4 Added: trunk/stdair/config/ax_cxx_toolset.m4 =================================================================== --- trunk/stdair/config/ax_cxx_toolset.m4 (rev 0) +++ trunk/stdair/config/ax_cxx_toolset.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,163 @@ +dnl $Id: ax_cxx_toolset.m4,v 1.2 2006/08/30 14:28:55 mloskot Exp $ +dnl +dnl @synopsis AX_CXX_TOOLSET([]) +dnl +dnl The AC_CXX_TOOLSET_INFO macro runs simple tests to detect C++ compiler. +dnl It sets four variables with compiler vendor name, abbreviation, +dnl toolset (based on toolset names used in Boost library) +dnl and compiler command. +dnl +dnl Currently, only GNU C/C++ and Microsoft Visual C++ are supported. +dnl +dnl This macro does not take any parameters. +dnl +dnl This macro sets following variables: +dnl +dnl CXX_TOOLSET_VENDOR +dnl CXX_TOOLSET_FULLNAME +dnl CXX_TOOLSET_NAME +dnl CXX_TOOLSET_COMMAND +dnl +dnl No AC_SUBST are called. +dnl +dnl The idea of this macro is based on AX_COMPILER_VENDOR macro +dnl developed and copyrighted by Ludovic Courtès <lu...@ch...> +dnl Source: http://autoconf-archive.cryp.to/ac_cxx_compiler_vendor.html +dnl +dnl @category CXX +dnl @author Mateusz Loskot <ma...@lo...> +dnl @version 2006-08-30 +dnl @license AllPermissive + +dnl +dnl Generic compiler detector +dnl +AC_DEFUN([AX_C_IFDEF], +[ + AC_COMPILE_IFELSE( + [#ifndef $1 + #error "Compiler definition macro $1 is undefined!" + #endif], [$2], [$3]) +]) + +dnl +dnl Visual C++ compiler detector +dnl +dnl TODO - mloskot: It has not been tested with Autoconf + Visual C++. +dnl I even don't know if it's feasible and well-working to use +dnl Autoconf with Visual C++ toolset. +dnl If anyone knows how to test it, please give me a note. Thanks! +dnl +AC_DEFUN([AX_C_IFDEF_MSVC], +[ + AC_COMPILE_IFELSE( + [ + #ifndef $1 + #error "Compiler definition macro $1 is undefined!" + #endif + ], + [ + AC_COMPILE_IFELSE([#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 + #error "Macro test _MSC_VER < 1300 is false, it is not VC++ 6.0!" + #endif + ], + [ + ac_cxx_msvc_toolset=vc60 + $2 + ], + [ + AC_COMPILE_IFELSE([#if _MSC_VER <= 1300 // 1300 == VC++ 7.0 + #error "Macro test _MSC_VER <= 1300 is false, it is not VC++ 7.0!" + #endif + ], + [ + dnl Visual C++ 6.0 detected + ac_cxx_msvc_toolset=vc70 + $2 + ], + [ + AC_COMPILE_IFELSE([#if _MSC_VER <= 1300 // 1300 == VC++ 7.0 + #error "Macro test _MSC_VER <= 1300 is false, it is not VC++ 7.0!" + #endif + ], + [ + dnl Visual C++ 7.0 detected + ac_cxx_msvc_toolset=vc70 + $2 + ], + [ + AC_COMPILE_IFELSE([#if _MSC_VER < 1310 // 1310 == VC++ 7.1 + #error "Macro test _MSC_VER < 1310 is false, it is not VC++ 7.1!" + #endif + ], + [ + dnl Visual C++ 7.1 detected + ac_cxx_msvc_toolset=vc71 + $2 + ], + [ + AC_COMPILE_IFELSE([#if _MSC_VER <= 1400 // 1400 == VC++ 8.0 + #error "Macro test _MSC_VER < 1400 is false, it is not VC++ 8.0!" + #endif + ], + [ + dnl Visual C++ 8.0 detected + ac_cxx_msvc_toolset=vc80 + $2 + ], + [$3]) + ]) + ]) + ]) + ]) + ], + [$3]) +]) + +AC_DEFUN([AX_CXX_TOOLSET], +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_CXXCPP]) + + AC_CACHE_CHECK([the C++ compiler vendor], + [ac_cxx_toolset_vendor], + [ + AC_LANG_PUSH([C++]) + + dnl GNU C/C++ + AX_C_IFDEF([__GNUG__], + [ + ac_cxx_toolset_vendor="Free Software Foundation" + ac_cxx_toolset_fullname="GNU C/C++ Compiler" + ac_cxx_toolset_name="gcc" + ac_cxx_toolset_cmd="g++" + ], + [ + dnl Microsoft Visual C++ + AX_C_IFDEF_MSVC([_MSC_VER], + [ + ac_cxx_toolset_vendor="Microsoft" + ac_cxx_toolset_fullname="Visual C++" + ac_cxx_toolset_name=$ac_cxx_msvc_toolset + ac_cxx_toolset_cmd="cl" + ], + [ + ac_cxx_toolset_vendor=unknown + ac_cxx_toolset_fullname=unknown + ac_cxx_toolset_name=unknown + ac_cxx_toolset_cmd=unknown + ]) + ]) + + AC_LANG_POP() + ]) + + dnl + dnl Output variables + dnl + CXX_TOOLSET_VENDOR=$ac_cxx_toolset_vendor + CXX_TOOLSET_FULLNAME=$ac_cxx_toolset_fullname + CXX_TOOLSET_NAME=$ac_cxx_toolset_name + CXX_TOOLSET_COMMAND=$ac_cxx_toolset_cmd + +]) Added: trunk/stdair/config/ax_firebird.m4 =================================================================== --- trunk/stdair/config/ax_firebird.m4 (rev 0) +++ trunk/stdair/config/ax_firebird.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,165 @@ +dnl $Id: ax_firebird.m4,v 1.3 2007/06/23 01:51:22 mloskot Exp $ +dnl +dnl @synopsis AX_LIB_FIREBIRD([MINIMUM-VERSION]) +dnl +dnl Test for the Firebird client library of a particular version (or newer) +dnl +dnl This macro takes only one optional argument, required version +dnl of Firebird library. If required version is not +dnl passed, then 1.5.0 is used in test of existance of Firebird +dnl client library. +dnl +dnl For more information about Firebird API versioning check: +dnl API Identifies Client Version +dnl http://www.firebirdsql.org/rlsnotes20/rnfbtwo-apiods.html +dnl +dnl If no intallation prefix to the installed Firebird library is given +dnl the macro searches under /usr, /usr/local, and /opt. +dnl +dnl This macro calls: +dnl +dnl AC_SUBST(FIREBIRD_CFLAGS) +dnl AC_SUBST(FIREBIRD_LDFLAGS) +dnl AC_SUBST(FIREBIRD_VERSION) +dnl +dnl And sets: +dnl +dnl HAVE_FIREBIRD +dnl +dnl @category InstalledPackages +dnl @category Cxx +dnl @author Mateusz Loskot <ma...@lo...> +dnl @version $Date: 2007/06/23 01:51:22 $ +dnl @license AllPermissive +dnl +dnl $Id: ax_firebird.m4,v 1.3 2007/06/23 01:51:22 mloskot Exp $ +dnl +AC_DEFUN([AX_LIB_FIREBIRD], +[ + AC_ARG_WITH([firebird], + AC_HELP_STRING( + [--with-firebird=@<:@ARG@:>@], + [use Firebird client library @<:@default=yes@:>@, optionally specify the prefix for firebird library] + ), + [ + if test "$withval" = "no"; then + WANT_FIREBIRD="no" + elif test "$withval" = "yes"; then + WANT_FIREBIRD="yes" + ac_firebird_path="" + else + WANT_FIREBIRD="yes" + ac_firebird_path="$withval" + fi + ], + [WANT_FIREBIRD="yes"] + ) + + FIREBIRD_CFLAGS="" + FIREBIRD_LDFLAGS="" + FIREBIRD_VERSION="" + + if test "x$WANT_FIREBIRD" = "xyes"; then + + ac_firebird_header="ibase.h" + + firebird_version_req=ifelse([$1], [], [3.0.0], [$1]) + firebird_version_req_shorten=`expr $firebird_version_req : '\([[0-9]]*\.[[0-9]]*\)'` + firebird_version_req_major=`expr $firebird_version_req : '\([[0-9]]*\)'` + firebird_version_req_minor=`expr $firebird_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + firebird_version_req_micro=`expr $firebird_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$firebird_version_req_micro" = "x" ; then + firebird_version_req_micro="0" + fi + + dnl FB_API_VER represents the version of Firebird as follows: + dnl - Any version of Interbase, or Firebird 1.0.x: 10 + dnl - Firebird 1.5.x: 15 + dnl - Firebird 2.0.x: 20 + + firebird_version_req_number=`expr $firebird_version_req_major \+ $firebird_version_req_minor` + + AC_MSG_CHECKING([for Firebird client library >= $firebird_version_req]) + + if test "$ac_firebird_path" != ""; then + ac_firebird_ldflags="-L$ac_firebird_path/lib" + ac_firebird_cppflags="-I$ac_firebird_path/include" + else + for ac_firebird_path_tmp in /usr /usr/local /opt ; do + if test -f "$ac_firebird_path_tmp/include/$ac_firebird_header" \ + && test -r "$ac_firebird_path_tmp/include/$ac_firebird_header"; then + ac_firebird_path=$ac_firebird_path_tmp + ac_firebird_cppflags="-I$ac_firebird_path_tmp/include" + ac_firebird_ldflags="-L$ac_firebird_path_tmp/lib" + break; + fi + done + fi + + ac_firebird_header_path="$ac_firebird_path/include/$ac_firebird_header" + + if test ! -f "$ac_firebird_header_path"; then + AC_MSG_RESULT([no]) + success="no" + else + + ac_firebird_ldflags="$ac_firebird_ldflags -lfbclient -lpthread" + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_firebird_cppflags" + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM([[@%:@include <ibase.h>]], + [[ +#if (FB_API_VER >= $firebird_version_req_number) +// Everything is okay +#else +# error Firebird version is too old +#endif + ]] + ) + ], + [ + AC_MSG_RESULT([yes]) + success="yes" + ], + [ + AC_MSG_RESULT([not found]) + succees="no" + ] + ) + AC_LANG_POP([C++]) + + CPPFLAGS="$saved_CPPFLAGS" + + if test "$success" = "yes"; then + + FIREBIRD_CFLAGS="$ac_firebird_cppflags" + FIREBIRD_LDFLAGS="$ac_firebird_ldflags" + + dnl Retrieve Firebird release version + + ac_firebird_version=`cat $ac_firebird_header_path | \ + grep '#define.*FB_API_VER.*' | \ + sed -e 's/.* //'` + + if test -n "$ac_firebird_version"; then + ac_firebird_version_major=`expr $ac_firebird_version \/ 10` + ac_firebird_version_minor=`expr $ac_firebird_version \% 10` + + FIREBIRD_VERSION="$ac_firebird_version_major.$ac_firebird_version_minor.x" + else + AC_MSG_WARN([Could not find FB_API_VER macro in $ac_firebird_header to get Firebird version.]) + fi + + AC_SUBST([FIREBIRD_CFLAGS]) + AC_SUBST([FIREBIRD_LDFLAGS]) + AC_SUBST([FIREBIRD_VERSION]) + AC_DEFINE([HAVE_FIREBIRD], [1], [Define to 1 if FireBird libraries are available]) + fi + fi + fi +]) + Added: trunk/stdair/config/ax_icu.m4 =================================================================== --- trunk/stdair/config/ax_icu.m4 (rev 0) +++ trunk/stdair/config/ax_icu.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,160 @@ +dnl @synopsis AX_ICU +dnl +dnl This macro tries to find Icu C API header and library locations. +dnl +dnl We define the following configure script flags: +dnl +dnl --with-icu: Give prefix for both library and headers, and try +dnl to guess subdirectory names for each. (e.g. Tack /lib and +dnl /include onto given dir name, and other common schemes.) +dnl --with-icu-lib: Similar to --with-icu, but for library only. +dnl --with-icu-include: Similar to --with-icu, but for headers +dnl only. +dnl +dnl @version 1.2, 2007/02/20 +dnl @author Warren Young <ic...@et...> + +AC_DEFUN([AX_ICU], +[ + # + # Set up configure script macros + # + AC_ARG_WITH(icu, + [ --with-icu=<path> root directory path of Icu installation], + [ICU_lib_check="$with_icu/lib64/icu $with_icu/lib/icu $with_icu/lib64 $with_icu/lib" + ICU_inc_check="$with_icu/include $with_icu/include/icu" + ICU_bin_check="$with_icu/bin"], + [ICU_lib_check="/usr/lib64 /usr/lib /usr/lib64/icu /usr/lib/icu /usr/local/lib64 /usr/local/lib /usr/local/lib/icu /usr/local/icu/lib /usr/local/icu/lib/icu /opt/icu/lib /opt/icu/lib/icu" + ICU_inc_check="/usr/include /usr/local/include /usr/local/icu/include /opt/icu/include" + ICU_bin_check="/usr/bin /usr/local/bin /usr/local/icu/bin"]) + + AC_ARG_WITH(icu-lib, + [ --with-icu-lib=<path> directory path of Icu library installation], + [ICU_lib_check="$with_icu_lib $with_icu_lib/lib64 $with_icu_lib/lib $with_icu_lib/lib64/icu $with_icu_lib/lib/icu"]) + + AC_ARG_WITH(icu-include, + [ --with-icu-include=<path> directory path of Icu header installation], + [ICU_inc_check="$with_icu_include $with_icu_include/include $with_icu_include/include/icu"]) + + + # + # Look for Icu Configuration Script + # + AC_MSG_CHECKING([for Icu configuration script]) + ICU_CONFIG= + ICU_bindir= + for m in $ICU_bin_check + do + if test -d "$m" && test -f "$m/icu-config" + then + ICU_CONFIG=$m/icu-config + ICU_bindir=$m + break + fi + done + + if test -z "$ICU_bindir" + then + AC_MSG_ERROR([Didn't find $ICU_CONFIG binary in '$ICU_bin_check']) + fi + + case "$ICU_bindir" in + /* ) ;; + * ) AC_MSG_ERROR([The Icu binary directory ($ICU_bindir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$ICU_bindir]) + + AC_PATH_PROG(ICU_CONFIG, icu-config, $ICU_bindir) + + if test "x${ICU_CONFIG+set}" != xset + then + ICU_VERSION=`${ICU_CONFIG} --version` + ICU_CFLAGS=`${ICU_CONFIG} --cppflags` + ICU_LIBS=`${ICU_CONFIG} --ldflags` + else + # + # Look for Icu C API library + # + AC_MSG_CHECKING([for Icu library directory]) + ICU_libdir= + ICU_IO_LIB=icuio + for m in $ICU_lib_check + do + if test -d "$m" && \ + (test -f "$m/lib$ICU_IO_LIB.so" \ + || test -f "$m/lib$ICU_IO_LIB.a") + then + ICU_libdir=$m + break + fi + done + + if test -z "$ICU_libdir" + then + AC_MSG_ERROR([Didn't find $ICU_IO_LIB library in '$ICU_lib_check']) + fi + + case "$ICU_libdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Icu library directory ($ICU_libdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$ICU_libdir]) + + case "$ICU_libdir" in + /usr/lib64) ;; + /usr/lib) ;; + *) LDFLAGS="$LDFLAGS -L${ICU_libdir}" ;; + esac + + # + # Look for Icu C API headers + # + AC_MSG_CHECKING([for Icu include directory]) + ICU_incdir= + for m in $ICU_inc_check + do + if test -d "$m" && test -f "$m/unicode/utf8.h" + then + ICU_incdir=$m + break + fi + done + + if test -z "$ICU_incdir" + then + AC_MSG_ERROR([Didn't find the Icu include dir in '$ICU_inc_check']) + fi + + case "$ICU_incdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Icu include directory ($ICU_incdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$ICU_incdir]) + + ICU_CFLAGS="-D_REENTRANT -I${ICU_incdir}" + ICU_LIBS="-licui18n -licuuc -licudata -lpthread -lm" + + case "$ICU_libdir" in + /usr/lib64) ;; + /usr/lib) ;; + *) ICU_LIBS="-L${ICU_libdir} $ICU_LIBS" ;; + esac + fi + + AC_SUBST(ICU_VERSION) + AC_SUBST(ICU_CFLAGS) + AC_SUBST(ICU_LIBS) + + save_LIBS="$LIBS" + LIBS="$LIBS $ICU_LIBS" +# AC_CHECK_LIB($ICU_IO_LIB, utext_isWritable, +# [], +# [AC_MSG_ERROR([Could not find working Icu client library!])] +# ) + ICU_IO_LIB="-l${ICU_IO_LIB}" + AC_SUBST(ICU_IO_LIB) + LIBS="$save_LIBS" +]) dnl AX_ICU Added: trunk/stdair/config/ax_mysql.m4 =================================================================== --- trunk/stdair/config/ax_mysql.m4 (rev 0) +++ trunk/stdair/config/ax_mysql.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,163 @@ +dnl @synopsis AX_MYSQL +dnl +dnl This macro tries to find MySQL C API header and library locations. +dnl +dnl We define the following configure script flags: +dnl +dnl --with-mysql: Give prefix for both library and headers, and try +dnl to guess subdirectory names for each. (e.g. Tack /lib and +dnl /include onto given dir name, and other common schemes.) +dnl --with-mysql-lib: Similar to --with-mysql, but for library only. +dnl --with-mysql-include: Similar to --with-mysql, but for headers +dnl only. +dnl +dnl @version 1.2, 2007/02/20 +dnl @author Warren Young <my...@et...> + +AC_DEFUN([AX_MYSQL], +[ + # + # Set up configure script macros + # + AC_ARG_WITH(mysql, + [ --with-mysql=<path> root directory path of MySQL installation], + [MYSQL_lib_check="$with_mysql/lib64/mysql $with_mysql/lib/mysql $with_mysql/lib64 $with_mysql/lib" + MYSQL_inc_check="$with_mysql/include $with_mysql/include/mysql" + MYSQL_bin_check="$with_mysql/bin"], + [MYSQL_lib_check="/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /opt/mysql/lib /opt/mysql/lib/mysql" + MYSQL_inc_check="/usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /opt/mysql/include/mysql" + MYSQL_bin_check="/usr/bin /usr/local/bin /usr/local/mysql/bin"]) + + AC_ARG_WITH(mysql-lib, + [ --with-mysql-lib=<path> directory path of MySQL library installation], + [MYSQL_lib_check="$with_mysql_lib $with_mysql_lib/lib64 $with_mysql_lib/lib $with_mysql_lib/lib64/mysql $with_mysql_lib/lib/mysql"]) + + AC_ARG_WITH(mysql-include, + [ --with-mysql-include=<path> directory path of MySQL header installation], + [MYSQL_inc_check="$with_mysql_include $with_mysql_include/include $with_mysql_include/include/mysql"]) + + + # + # Look for MySQL Configuration Script + # + AC_MSG_CHECKING([for MySQL configuration script]) + MYSQL_CONFIG= + MYSQL_bindir= + for m in $MYSQL_bin_check + do + if test -d "$m" && test -f "$m/mysql_config" + then + MYSQL_CONFIG=$m/mysql_config + MYSQL_bindir=$m + break + fi + done + + if test -z "$MYSQL_bindir" + then + AC_MSG_ERROR([Didn't find $MYSQL_CONFIG binary in '$MYSQL_bin_check']) + fi + + case "$MYSQL_bindir" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL binary directory ($MYSQL_bindir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MYSQL_bindir]) + +# AC_PATH_PROG(MYSQL_CONFIG, mysql_config, $MYSQL_bindir) + + # + # Decide which C API library to use, based on thread support + # + if test "x$acx_pthread_ok" = xyes + then + MYSQL_C_LIB=mysqlclient_r + MYSQL_LIB_OPTION=libs_r + else + MYSQL_C_LIB=mysqlclient + MYSQL_LIB_OPTION=libs + fi + + if test "x${MYSQL_CONFIG+set}" != xset + then + MYSQL_VERSION=`${MYSQL_CONFIG} --version` + MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags` + MYSQL_LIBS=`${MYSQL_CONFIG} --${MYSQL_LIB_OPTION}` + else + # + # Look for MySQL C API library + # + AC_MSG_CHECKING([for MySQL library directory]) + MYSQL_libdir= + for m in $MYSQL_lib_check + do + if test -d "$m" && \ + (test -f "$m/lib$MYSQL_C_LIB.so" \ + || test -f "$m/lib$MYSQL_C_LIB.a") + then + MYSQL_libdir=$m + break + fi + done + + if test -z "$MYSQL_libdir" + then + AC_MSG_ERROR([Didn't find $MYSQL_C_LIB library in '$MYSQL_lib_check']) + fi + + case "$MYSQL_libdir" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MYSQL_libdir]) + +# case "$MYSQL_libdir" in +# /usr/lib) ;; +# *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;; +# esac + + # + # Look for MySQL C API headers + # + AC_MSG_CHECKING([for MySQL include directory]) + MYSQL_incdir= + for m in $MYSQL_inc_check + do + if test -d "$m" && test -f "$m/mysql.h" + then + MYSQL_incdir=$m + break + fi + done + + if test -z "$MYSQL_incdir" + then + AC_MSG_ERROR([Didn't find the MySQL include dir in '$MYSQL_inc_check']) + fi + + case "$MYSQL_incdir" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MYSQL_incdir]) + + MYSQL_CFLAGS="-I${MYSQL_incdir}" + MYSQL_LIBS="-L${MYSQL_libdir} -l${MYSQL_C_LIB}" + fi + + AC_SUBST(MYSQL_VERSION) + AC_SUBST(MYSQL_CFLAGS) + AC_SUBST(MYSQL_LIBS) + + save_LIBS="$LIBS" + LIBS="$LIBS $MYSQL_LIBS" + AC_CHECK_LIB($MYSQL_C_LIB, mysql_store_result, + [], + [AC_MSG_ERROR([Could not find working MySQL client library!])] + ) + AC_SUBST(MYSQL_C_LIB) + LIBS="$save_LIBS" +]) dnl AX_MYSQL Added: trunk/stdair/config/ax_odbc.m4 =================================================================== --- trunk/stdair/config/ax_odbc.m4 (rev 0) +++ trunk/stdair/config/ax_odbc.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,135 @@ +dnl $Id: ax_odbc.m4,v 1.1 2008/05/12 13:16:58 mloskot Exp $ +dnl +dnl @synopsis AX_LIB_ODBC([MINIMUM-VERSION]) +dnl +dnl Test for the ODBC library of a particular version (or newer) +dnl +dnl This macro takes only one optional argument, required version +dnl of ODBC implementation, for instance 0x0351. +dnl If required version is not passed, 0x0300 is used. +dnl +dnl If no intallation prefix to the installed ODBC library is given +dnl the macro searches under /usr, /usr/local, and /opt. +dnl +dnl This macro calls: +dnl +dnl AC_SUBST(ODBC_CFLAGS) +dnl AC_SUBST(ODBC_LDFLAGS) +dnl AC_SUBST(ODBC_VERSION) +dnl +dnl And sets: +dnl +dnl HAVE_ODBC +dnl +dnl @category InstalledPackages +dnl @category Cxx +dnl @author Mateusz Loskot <ma...@lo...> +dnl @version $Date: 2008/05/12 13:16:58 $ +dnl @license AllPermissive +dnl +AC_DEFUN([AX_LIB_ODBC], +[ + AC_ARG_WITH([odbc], + AC_HELP_STRING( + [--with-odbc=@<:@ARG@:>@], + [use ODBC library @<:@default=yes@:>@, optionally specify ODBC installation prefix] + ), + [ + if test "$withval" = "no"; then + WANT_ODBC="no" + elif test "$withval" = "yes"; then + WANT_ODBC="yes" + ac_odbc_path="" + else + WANT_ODBC="yes" + ac_odbc_path="$withval" + fi + ], + [WANT_ODBC="yes"] + ) + + ODBC_CFLAGS="" + ODBC_LDFLAGS="" + ODBC_VERSION="" + + if test "x$WANT_ODBC" = "xyes"; then + + ac_odbc_header="sql.h" + + odbc_version_req=ifelse([$1], [], [0x0300], [$1]) + + AC_MSG_CHECKING([for ODBC implementation >= $odbc_version_req]) + + if test "$ac_odbc_path" != ""; then + ac_odbc_ldflags="-L$ac_odbc_path/lib" + ac_odbc_cppflags="-I$ac_odbc_path/include" + else + for ac_odbc_path_tmp in /usr /usr/local /opt ; do + if test -f "$ac_odbc_path_tmp/include/$ac_odbc_header" \ + && test -r "$ac_odbc_path_tmp/include/$ac_odbc_header"; then + ac_odbc_path=$ac_odbc_path_tmp + ac_odbc_ldflags="-I$ac_odbc_path_tmp/include" + ac_odbc_cppflags="-L$ac_odbc_path_tmp/lib" + break; + fi + done + fi + + ac_odbc_ldflags="$ac_odbc_ldflags -lodbc" + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_odbc_cppflags" + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM([[@%:@include <sql.h>]], + [[ +#if (ODBCVER >= $odbc_version_req) +// Everything is okay +#else +# error ODBC version is too old +#endif + ]] + ) + ], + [ + AC_MSG_RESULT([yes]) + success="yes" + ], + [ + AC_MSG_RESULT([not found]) + succees="no" + ] + ) + AC_LANG_POP([C++]) + + CPPFLAGS="$saved_CPPFLAGS" + + if test "$success" = "yes"; then + + ODBC_CFLAGS="$ac_odbc_cppflags" + ODBC_LDFLAGS="$ac_odbc_ldflags" + + ac_odbc_header_path="$ac_odbc_path/include/$ac_odbc_header" + + dnl Retrieve ODBC release version + if test "x$ac_odbc_header_path" != "x"; then + ac_odbc_version=`cat $ac_odbc_header_path \ + | grep '#define.*ODBCVER.*' | sed -e 's/.*#define ODBCVER.//'` + if test $ac_odbc_version != ""; then + ODBC_VERSION=$ac_odbc_version + else + AC_MSG_WARN([Can not find ODBCVER macro in sql.h header to retrieve ODBC version!]) + + fi + fi + + AC_SUBST([ODBC_CFLAGS]) + AC_SUBST([ODBC_LDFLAGS]) + AC_SUBST([ODBC_VERSION]) + AC_DEFINE([HAVE_ODBC], [1], [Define to 1 if ODBC library is available]) + fi + fi +]) + Added: trunk/stdair/config/ax_oracle_oci.m4 =================================================================== --- trunk/stdair/config/ax_oracle_oci.m4 (rev 0) +++ trunk/stdair/config/ax_oracle_oci.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,286 @@ +dnl $Id: ax_oracle_oci.m4,v 1.11 2008/04/28 19:58:54 mloskot Exp $ +dnl +dnl @synopsis AX_LIB_ORACLE_OCI([MINIMUM-VERSION]) +dnl +dnl This macro provides tests of availability of Oracle OCI API +dnl of particular version or newer. +dnl This macros checks for Oracle OCI headers and libraries +dnl and defines compilation flags +dnl +dnl Macro supports following options and their values: +dnl 1) Single-option usage: +dnl --with-oracle - path to ORACLE_HOME directory +dnl 2) Two-options usage (both options are required): +dnl --with-oracle-include - path to directory with OCI headers +dnl --with-oracle-lib - path to directory with OCI libraries +dnl +dnl NOTE: These options described above does not take yes|no values. +dnl If 'yes' value is passed, then WARNING message will be displayed, +dnl 'no' value, as well as the --without-oracle* variations will cause +dnl the macro won't check enything. +dnl +dnl This macro calls: +dnl +dnl AC_SUBST(ORACLE_OCI_CFLAGS) +dnl AC_SUBST(ORACLE_OCI_LDFLAGS) +dnl AC_SUBST(ORACLE_OCI_VERSION) +dnl +dnl And sets: +dnl +dnl HAVE_ORACLE +dnl +dnl @category InstalledPackages +dnl @category Cxx +dnl @author Mateusz Loskot <ma...@lo...> +dnl @version $Date: 2008/04/28 19:58:54 $ +dnl @license AllPermissive +dnl +dnl $Id: ax_oracle_oci.m4,v 1.11 2008/04/28 19:58:54 mloskot Exp $ +dnl +AC_DEFUN([AX_LIB_ORACLE_OCI], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_ARG_WITH([oracle], + AC_HELP_STRING([--with-oracle=@<:@DIR@:>@], + [use Oracle OCI API from given path to Oracle home directory] + ), + [ + if test "$withval" = "yes"; then + if test -n "$ORACLE_HOME"; then + oracle_home_dir="$ORACLE_HOME" + else + oracle_home_dir="" + fi + fi + ], + [ + if test -n "$ORACLE_HOME"; then + oracle_home_dir="$ORACLE_HOME" + else + oracle_home_dir="" + fi + ] + ) + + AC_ARG_WITH([oracle-include], + AC_HELP_STRING([--with-oracle-include=@<:@DIR@:>@], + [use Oracle OCI API headers from given path] + ), + [oracle_home_include_dir="$withval"], + [oracle_home_include_dir=""] + ) + AC_ARG_WITH([oracle-lib], + AC_HELP_STRING([--with-oracle-lib=@<:@DIR@:>@], + [use Oracle OCI API libraries from given path] + ), + [oracle_home_lib_dir="$withval"], + [oracle_home_lib_dir=""] + ) + + ORACLE_OCI_CFLAGS="" + ORACLE_OCI_LDFLAGS="" + ORACLE_OCI_VERSION="" + + dnl + dnl Collect include/lib paths + dnl + want_oracle_but_no_path="no" + + if test -n "$oracle_home_dir"; then + + if test "$oracle_home_dir" != "no" -a "$oracle_home_dir" != "yes"; then + dnl ORACLE_HOME path provided + + dnl Primary path to OCI headers, available in Oracle>=10 + oracle_include_dir="$oracle_home_dir/rdbms/public" + + dnl Secondary path to OCI headers used by older versions + oracle_include_dir2="$oracle_home_dir/rdbms/demo" + + dnl Library path + oracle_lib_dir="$oracle_home_dir/lib" + elif test "$oracle_home_dir" = "yes"; then + want_oracle_but_no_path="yes" + fi + + elif test -n "$oracle_home_include_dir" -o -n "$oracle_home_lib_dir"; then + + if test "$oracle_home_include_dir" != "no" -a "$oracle_home_include_dir" != "yes"; then + oracle_include_dir="$oracle_home_include_dir" + elif test "$oracle_home_include_dir" = "yes"; then + want_oracle_but_no_path="yes" + fi + + if test "$oracle_home_lib_dir" != "no" -a "$oracle_home_lib_dir" != "yes"; then + oracle_lib_dir="$oracle_home_lib_dir" + elif test "$oracle_home_lib_dir" = "yes"; then + want_oracle_but_no_path="yes" + fi + fi + + if test "$want_oracle_but_no_path" = "yes"; then + AC_MSG_WARN([Oracle support is requested but no Oracle paths have been provided. \ +Please, locate Oracle directories using --with-oracle or \ +--with-oracle-include and --with-oracle-lib options.]) + fi + + dnl + dnl Check OCI files + dnl + if test -n "$oracle_include_dir" -a -n "$oracle_lib_dir"; then + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$oracle_include_dir" + + dnl Additional path for older Oracle installations + if test -n "$oracle_include_dir2"; then + CPPFLAGS="$CPPFLAGS -I$oracle_include_dir2" + fi + + # Figure out if we are building on win32. + case $host_os in + *mingw32* ) WIN32=yes ;; + *cygwin* ) WIN32=yes ;; + *) WIN32=no ;; + esac + + if test "$WIN32" = "no" + then + oci_libs="-lclntsh -lnnz11" + else + oci_libs="-loci" + fi + + saved_LDFLAGS="$LDFLAGS" + saved_LIBS="$LIBS" + oci_ldflags="-L$oracle_lib_dir" + LDFLAGS="$LDFLAGS $oci_ldflags" + LIBS="$LIBS $oci_libs" + + dnl + dnl Check OCI headers + dnl + AC_MSG_CHECKING([for Oracle OCI headers in $oracle_include_dir]) + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[@%:@include <oci.h>]], + [[ +#if defined(OCI_MAJOR_VERSION) +#if OCI_MAJOR_VERSION == 10 && OCI_MINOR_VERSION == 2 +// Oracle 10.2 detected +#endif +#elif defined(OCI_V7_SYNTAX) +// OK, older Oracle detected +// TODO - mloskot: find better macro to check for older versions; +#else +# error Oracle oci.h header not found +#endif + ]] + )], + [ + ORACLE_OCI_CFLAGS="-I$oracle_include_dir" + + if test -n "$oracle_include_dir2"; then + ORACLE_OCI_CFLAGS="$ORACLE_OCI_CFLAGS -I$oracle_include_dir2" + fi + + oci_header_found="yes" + AC_MSG_RESULT([yes]) + ], + [ + oci_header_found="no" + AC_MSG_RESULT([not found]) + ] + ) + AC_LANG_POP([C++]) + + dnl + dnl Check OCI libraries + dnl + if test "$oci_header_found" = "yes"; then + + AC_MSG_CHECKING([for Oracle OCI libraries in $oracle_lib_dir]) + + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[@%:@include <oci.h>]], + [[ +OCIEnv* envh = 0; +OCIEnvCreate(&envh, OCI_DEFAULT, 0, 0, 0, 0, 0, 0); +if (envh) OCIHandleFree(envh, OCI_HTYPE_ENV); + ]] + )], + [ + ORACLE_OCI_LDFLAGS="$oci_ldflags $oci_libs" + oci_lib_found="yes" + AC_MSG_RESULT([yes]) + ], + [ + oci_lib_found="no" + AC_MSG_RESULT([not found]) + ] + ) + AC_LANG_POP([C++]) + fi + + CPPFLAGS="$saved_CPPFLAGS" + LDFLAGS="$saved_LDFLAGS" + LIBS="$saved_LIBS" + fi + + dnl + dnl Check required version of Oracle is available + dnl + oracle_version_req=ifelse([$1], [], [], [$1]) + + if test "$oci_header_found" = "yes" -a "$oci_lib_found" = "yes" -a \ + -n "$oracle_version_req"; then + + oracle_version_major=`cat $oracle_include_dir/oci.h \ + | grep '#define.*OCI_MAJOR_VERSION.*' \ + | sed -e 's/#define OCI_MAJOR_VERSION *//' \ + | sed -e 's/ *\/\*.*\*\///'` + + oracle_version_minor=`cat $oracle_include_dir/oci.h \ + | grep '#define.*OCI_MINOR_VERSION.*' \ + | sed -e 's/#define OCI_MINOR_VERSION *//' \ + | sed -e 's/ *\/\*.*\*\///'` + + AC_MSG_CHECKING([if Oracle OCI version is >= $oracle_version_req]) + + if test -n "$oracle_version_major" -a -n $"oracle_version_minor"; then + + ORACLE_OCI_VERSION="$oracle_version_major.$oracle_version_minor" + + dnl Decompose required version string of Oracle + dnl and calculate its number representation + oracle_version_req_major=`expr $oracle_version_req : '\([[0-9]]*\)'` + oracle_version_req_minor=`expr $oracle_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + + oracle_version_req_number=`expr $oracle_version_req_major \* 1000000 \ + \+ $oracle_version_req_minor \* 1000` + + dnl Calculate its number representation + oracle_version_number=`expr $oracle_version_major \* 1000000 \ + \+ $oracle_version_minor \* 1000` + + oracle_version_check=`expr $oracle_version_number \>\= $oracle_version_req_number` + if test "$oracle_version_check" = "1"; then + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_ORACLE, [1], [Define to 1 if the Oracle OCI library is available]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Oracle $ORACLE_OCI_VERSION found, but required version is $oracle_version_req]) + fi + else + ORACLE_OCI_VERSION="UNKNOWN" + AC_MSG_RESULT([no]) + AC_MSG_WARN([Oracle version unknown, probably OCI older than 10.2 is available]) + fi + fi + + AC_SUBST([ORACLE_OCI_VERSION]) + AC_SUBST([ORACLE_OCI_CFLAGS]) + AC_SUBST([ORACLE_OCI_LDFLAGS]) +]) Added: trunk/stdair/config/ax_postgresql.m4 =================================================================== --- trunk/stdair/config/ax_postgresql.m4 (rev 0) +++ trunk/stdair/config/ax_postgresql.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,171 @@ +dnl $Id: ax_postgresql.m4,v 1.3 2007/06/23 01:51:22 mloskot Exp $ +dnl +dnl @synopsis AX_LIB_POSTGRESQL([MINIMUM-VERSION]) +dnl +dnl This macro provides tests of availability of PostgreSQL 'libpq' library +dnl of particular version or newer. +dnl +dnl AX_LIB_POSTGRESQL macro takes only one argument which is optional. If there is no +dnl required version passed, then macro does not run version test. +dnl +dnl The --with-postgresql option takes one of three possible values: +dnl no - do not check for PostgreSQL client library +dnl yes - do check for PostgreSQL library in standard locations +dnl (pg_config should be in the PATH) +dnl path - complete path to pg_config utility, use this option +dnl if pg_config can't be found in the PATH +dnl +dnl This macro calls: +dnl +dnl AC_SUBST(POSTGRESQL_CFLAGS) +dnl AC_SUBST(POSTGRESQL_LDFLAGS) +dnl AC_SUBST(POSTGRESQL_VERSION) +dnl +dnl And sets: +dnl +dnl HAVE_POSTGRESQL +dnl +dnl @category InstalledPackages +dnl @category Cxx +dnl @author Mateusz Loskot <ma...@lo...> +dnl @version $Date: 2007/06/23 01:51:22 $ +dnl @license AllPermissive +dnl +dnl $Id: ax_postgresql.m4,v 1.3 2007/06/23 01:51:22 mloskot Exp $ +dnl +AC_DEFUN([AX_LIB_POSTGRESQL], +[ + AC_ARG_WITH([postgresql], + AC_HELP_STRING([--with-postgresql=@<:@ARG@:>@], + [use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config] + ), + [ + POSTGRESQL_inc_check="$with_postgresql/include" + if test "$withval" = "no"; then + want_postgresql="no" + elif test "$withval" = "yes"; then + want_postgresql="yes" + else + want_postgresql="yes" + PG_CONFIG="$withval" + fi + ], + [want_postgresql="yes" + POSTGRESQL_inc_check="/usr/include /usr/local /opt"] + ) + + POSTGRESQL_CFLAGS="" + POSTGRESQL_LDFLAGS="" + POSTGRESQL_POSTGRESQL="" + + dnl + dnl Check PostgreSQL libraries (libpq) + dnl + + if test "$want_postgresql" = "yes"; then + + if test -z "$PG_CONFIG" -o test; then + AC_PATH_PROG([PG_CONFIG], [pg_config], []) + fi + + if test ! -x "$PG_CONFIG"; then + AC_MSG_ERROR([$PG_CONFIG does not exist or it is not an exectuable file]) + PG_CONFIG="no" + found_postgresql="no" + fi + + if test "$PG_CONFIG" != "no"; then + # + # Look for Postgresql C API headers + # + AC_MSG_CHECKING([for Postgresql include directory]) + POSTGRESQL_incdir= + for postgresql_inc_dir in $POSTGRESQL_inc_check + do + if test -d "$postgresql_inc_dir" \ + && test -f "$postgresql_inc_dir/postgres_ext.h" + then + POSTGRESQL_incdir=$postgresql_inc_dir + break + fi + done + + if test -z "$POSTGRESQL_incdir" + then + AC_MSG_ERROR([Didn't find the Postgresql include dir in '$POSTGRESQL_inc_check']) + fi + + case "$POSTGRESQL_incdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Postgresql include directory ($POSTGRESQL_incdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$POSTGRESQL_incdir]) + + if test "$POSTGRESQL_incdir" = "/usr/include"; then + POSTGRESQL_CFLAGS="" + else + POSTGRESQL_CFLAGS="-I${POSTGRESQL_incdir}" + fi + + POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq" + + POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'` + + AC_DEFINE([HAVE_POSTGRESQL], [1], [Define to 1 if PostgreSQL libraries are available]) + + found_postgresql="yes" + else + found_postgresql="no" + fi + fi + + dnl + dnl Check if required version of PostgreSQL is available + dnl + + + postgresql_version_req=ifelse([$1], [], [], [$1]) + + if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then + + AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req]) + + dnl Decompose required version string of PostgreSQL + dnl and calculate its number representation + postgresql_version_req_major=`expr $postgresql_version_req : '\([[0-9]]*\)'` + postgresql_version_req_minor=`expr $postgresql_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + postgresql_version_req_micro=`expr $postgresql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$postgresql_version_req_micro" = "x"; then + postgresql_version_req_micro="0" + fi + + postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \ + \+ $postgresql_version_req_minor \* 1000 \ + \+ $postgresql_version_req_micro` + + dnl Decompose version string of installed PostgreSQL + dnl and calculate its number representation + postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([[0-9]]*\)'` + postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` + postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$postgresql_version_micro" = "x"; then + postgresql_version_micro="0" + fi + + postgresql_version_number=`expr $postgresql_version_major \* 1000000 \ + \+ $postgresql_version_minor \* 1000 \ + \+ $postgresql_version_micro` + + postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number` + if test "$postgresql_version_check" = "1"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi + + AC_SUBST([POSTGRESQL_VERSION]) + AC_SUBST([POSTGRESQL_CFLAGS]) + AC_SUBST([POSTGRESQL_LDFLAGS]) +]) Added: trunk/stdair/config/ax_sqlite3.m4 =================================================================== --- trunk/stdair/config/ax_sqlite3.m4 (rev 0) +++ trunk/stdair/config/ax_sqlite3.m4 2009-12-30 13:45:29 UTC (rev 74) @@ -0,0 +1,148 @@ +dnl $Id: ax_sqlite3.m4,v 1.3 2007/06/23 01:51:22 mloskot Exp $ +dnl +dnl @synopsis AX_LIB_SQLITE3([MINIMUM-VERSION]) +dnl +dnl Test for the SQLite 3 library of a particular version (or newer) +dnl +dnl This macro takes only one optional argument, required version +dnl of SQLite 3 library. If required version is not passed, +dnl 3.0.0 is used in the test of existance of SQLite 3. +dnl +dnl If no intallation prefix to the installed SQLite library is given +dnl the macro searches under /usr, /usr/local, and /opt. +dnl +dnl This macro calls: +dnl +dnl AC_SUBST(SQLITE3_CFLAGS) +dnl AC_SUBST(SQLITE3_LDFLAGS) +dnl AC_SUBST(SQLITE3_VERSION) +dnl +dnl And sets: +dnl +dnl HAVE_SQLITE3 +dnl +dnl @category InstalledPackages +dnl @category Cxx +dnl @author Mateusz Loskot <ma...@lo...> +dnl @version $Date: 2007/06/23 01:51:22 $ +dnl @license AllPermissive +dnl +dnl $Id: ax_sqlite3.m4,v 1.3 2007/06/23 01:51:22 mloskot Exp $ +dnl +AC_DEFUN([AX_LIB_SQLITE3], +[ + AC_ARG_WITH([sqlite3], + AC_HELP_STRING( + [--with-sqlite3=@<:@ARG@:>@], + [use SQLite 3 library @<:@default=yes@:>@, optionally specify the prefix for sqlite3 library] + ), + [ + if test "$withval" = "no"; then + WANT_SQLITE3="no" + elif test "$withval" = "yes"; then + WANT_SQLITE3="yes" + ac_sqlite3_path="" + else + WANT_SQLITE3="yes" + ac_sqlite3_path="$withval" + fi + ], + [WANT_SQLITE3="yes"] + ) + + SQLITE3_CFLAGS="" + SQLITE3_LDFLAGS="" + SQLITE3_VERSION="" + + if test "x$WANT_SQLITE3" = "xyes"; then + + ac_sqlite3_header="sqlite3.h" + + sqlite3_version_req=ifelse([$1], [], [3.0.0], [$1]) + sqlite3_version_req_shorten=`expr $sqlite3_version_req : '\([[0-9]]*\.[[0-9]]*\)'` + sqlite3_version_req_major=`expr $sqlite3_version_req : '\([[0-9]]*\)'` + sqlite3_version_req_minor=`expr $sqlite3_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + sqlite3_version_req_micro=`expr $sqlite3_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$sqlite3_version_req_micro" = "x" ; then + sqlite3_version_req_micro="0" + fi + + sqlite3_version_req_number=`expr $sqlite3_version_req_major \* 1000000 \ + \+ $sqlite3_version_req_minor \* 1000 \ + \+ $sqlite3_version_req_micro` + + AC_MSG_CHECKING([for SQLite3 library >= $sqlite3_version_req]) + + if test "$ac_sqlite3_path" != ""; then + ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib" + ac_sqlite3_cppflags="-I$ac_sqlite3_path/include" + else + for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do + if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \ + && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then + ac_sqlite3_path=$ac_sqlite3_path_tmp + ac_sqlite3_ldflags="-I$ac_sqlite3_path_tmp/include" + ac_sqlite3_cppflags="-L$ac_sqlite3_path_tmp/lib" + break; + fi + done + fi + + ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3" + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags" + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM([[@%:@include <sqlite3.h>]], + [[ +#if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number) +// Everything is okay +#else +# error SQLite version is too old +#endif + ]] + ) + ], + [ + AC_MSG_RESULT([yes]) + success="yes" + ], + [ + AC_MSG_RESULT([not found]) + succees="no" + ] + ) + AC_LANG_POP([C++]) + + CPPFLAGS="$saved_CPPFLAGS" + + if test "$success" = "yes"; then + + SQLITE3_CFLAGS="$ac_sqlite3_cppflags" + SQLITE3_LDFLAGS="$ac_sqlite3_ldflags" + + ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header" + + dnl Retrieve SQLite release version + if test "x$ac_sqlite3_header_path" != "x"; then + ac_sqlite3_version=`cat $ac_sqlite3_header_path \ + | grep '#define.*SQLITE_VERSION.*\"' | sed -e 's/.* "//' \ + | sed -e 's/"//'` + if test $ac_sqlite3_version != ""; then + SQLITE3_VERSION=$ac_sqlite3_version + else + AC_MSG_WARN([Can not find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!]) + fi + fi + + AC_SUBST([SQLITE3_CFLAGS]) + AC_SUBST([SQLITE3_LDFLAGS]) + AC_SUBST([SQLITE3_VERSION]) + AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if SQLite 3 library is available]) + fi + fi +]) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-29 13:56:44
|
Revision: 73 http://stdair.svn.sourceforge.net/stdair/?rev=73&view=rev Author: denis_arnaud Date: 2009-12-29 13:56:36 +0000 (Tue, 29 Dec 2009) Log Message: ----------- [Test] Re-worked the Boost.MPL tests. Removed Paths: ------------- trunk/stdair/test/mpl/book/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-29 13:51:40
|
Revision: 72 http://stdair.svn.sourceforge.net/stdair/?rev=72&view=rev Author: denis_arnaud Date: 2009-12-29 13:51:34 +0000 (Tue, 29 Dec 2009) Log Message: ----------- [Test] Re-worked the Boost.MPL tests. Modified Paths: -------------- trunk/stdair/configure.ac trunk/stdair/test/Makefile.am trunk/stdair/test/mpl/Makefile.am trunk/stdair/test/stdair/Makefile.am Added Paths: ----------- trunk/stdair/test/mpl/contrib/ trunk/stdair/test/mpl/contrib/Makefile.am trunk/stdair/test/mpl/mpl_book_ch_01.cpp trunk/stdair/test/stdair/mpled_bom.cpp Removed Paths: ------------- trunk/stdair/test/com/ trunk/stdair/test/mpl/book/Makefile.am trunk/stdair/test/mpl/book/ch_01.cpp trunk/stdair/test/mpl/book/contrib/ trunk/stdair/test/mpl/mpl.cpp trunk/stdair/test/mpl/test_mpl.sh Property Changed: ---------------- trunk/stdair/test/mpl/ trunk/stdair/test/mpl/book/ trunk/stdair/test/stdair/ Modified: trunk/stdair/configure.ac =================================================================== --- trunk/stdair/configure.ac 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/configure.ac 2009-12-29 13:51:34 UTC (rev 72) @@ -204,7 +204,7 @@ test/Makefile test/inheritance/Makefile test/mpl/Makefile - test/mpl/book/Makefile + test/mpl/contrib/Makefile test/stdair/Makefile ) AC_OUTPUT Modified: trunk/stdair/test/Makefile.am =================================================================== --- trunk/stdair/test/Makefile.am 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/Makefile.am 2009-12-29 13:51:34 UTC (rev 72) @@ -4,7 +4,7 @@ MAINTAINERCLEANFILES = Makefile.in ## -SUBDIRS = com inheritance mpl +SUBDIRS = inheritance mpl stdair EXTRA_DIST = ## Property changes on: trunk/stdair/test/mpl ___________________________________________________________________ Modified: svn:ignore - .deps .libs Makefile.in Makefile mpl + .deps .libs Makefile.in Makefile mpl_book_ch_?? Modified: trunk/stdair/test/mpl/Makefile.am =================================================================== --- trunk/stdair/test/mpl/Makefile.am 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/mpl/Makefile.am 2009-12-29 13:51:34 UTC (rev 72) @@ -3,12 +3,15 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = book +# +SUBDIRS = contrib -check_PROGRAMS = mpl +EXTRA_DIST = -mpl_SOURCES = mpl.cpp -mpl_CXXFLAGS = $(BOOST_CFLAGS) -mpl_LDADD = $(BOOST_LIB) +# +check_PROGRAMS = mpl_book_ch_01 -EXTRA_DIST = test_mpl.sh +# +mpl_book_ch_01_SOURCES = mpl_book_ch_01.cpp +mpl_book_ch_01_CXXFLAGS = $(BOOST_CFLAGS) +mpl_book_ch_01_LDADD = $(BOOST_LIBS) Property changes on: trunk/stdair/test/mpl/book ___________________________________________________________________ Modified: svn:ignore - .deps .libs Makefile.in Makefile ch?? + .deps .libs Makefile.in Makefile Deleted: trunk/stdair/test/mpl/book/Makefile.am =================================================================== --- trunk/stdair/test/mpl/book/Makefile.am 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/mpl/book/Makefile.am 2009-12-29 13:51:34 UTC (rev 72) @@ -1,12 +0,0 @@ -## command sub-directory -include $(top_srcdir)/Makefile.common - -MAINTAINERCLEANFILES = Makefile.in - -check_PROGRAMS = ch01 - -ch01_SOURCES = ch_01.cpp -ch01_CXXFLAGS = $(BOOST_CFLAGS) -ch01_LDADD = $(BOOST_LIB) - -EXTRA_DIST = Deleted: trunk/stdair/test/mpl/book/ch_01.cpp =================================================================== --- trunk/stdair/test/mpl/book/ch_01.cpp 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/mpl/book/ch_01.cpp 2009-12-29 13:51:34 UTC (rev 72) @@ -1,13 +0,0 @@ -// STL -#include <iostream> -// Book on Boost MPL -#include "contrib/binary.hpp" - -// ///////////// M A I N ////////////// -int main (int argc, char* argv[]) { - - const long l42 = binary<101010>::value; - std::cout << "The 101010 binary number is equal to: " << l42 << std::endl; - - return 0; -} Property changes on: trunk/stdair/test/mpl/contrib ___________________________________________________________________ Added: svn:ignore + .deps .libs Makefile.in Makefile Copied: trunk/stdair/test/mpl/contrib/Makefile.am (from rev 70, trunk/stdair/test/mpl/book/Makefile.am) =================================================================== --- trunk/stdair/test/mpl/contrib/Makefile.am (rev 0) +++ trunk/stdair/test/mpl/contrib/Makefile.am 2009-12-29 13:51:34 UTC (rev 72) @@ -0,0 +1,8 @@ +## test/boost/mpl/contrib sub-directory +include $(top_srcdir)/Makefile.common + +MAINTAINERCLEANFILES = Makefile.in + +check_PROGRAMS = + +EXTRA_DIST = binary.hpp Deleted: trunk/stdair/test/mpl/mpl.cpp =================================================================== --- trunk/stdair/test/mpl/mpl.cpp 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/mpl/mpl.cpp 2009-12-29 13:51:34 UTC (rev 72) @@ -1,82 +0,0 @@ -// STL -#include <iostream> -#include <sstream> -#include <string> -#include <vector> -// MPL -#include <boost/mpl/push_back.hpp> -#include <boost/mpl/vector.hpp> -#include <boost/mpl/at.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/type_traits/is_same.hpp> - -// ////////////////////////////////////////////////////////////////// -namespace STDAIR { - - /** BookingClass */ - struct BookingClass { - std::string _classCode; - /** Constructor. */ - BookingClass (const std::string& iClassCode) - : _classCode (iClassCode) { - } - - /** Display .*/ - std::string toString() const { - std::ostringstream oStr; - oStr << _classCode; - return oStr.str(); - } - }; - - /** Cabin */ - struct Cabin { - BookingClass _bookingClass; - Cabin (const BookingClass& iBkgClass) - : _bookingClass (iBkgClass) { - } - - /** Display .*/ - std::string toString() const { - std::ostringstream oStr; - oStr << _bookingClass._classCode; - return oStr.str(); - } - - /** Child type. */ - typedef BookingClass child; - }; - -} - -// /////////// M A I N //////////////// -int main (int argc, char* argv[]) { - - typedef boost::mpl::vector<STDAIR::BookingClass> MPL_BookingClass; - typedef boost::mpl::push_back<MPL_BookingClass, STDAIR::Cabin>::type types; - - const STDAIR::BookingClass lA ("A"); - const STDAIR::Cabin lCabin (lA); - - // lCabin::type - if (boost::is_same<STDAIR::BookingClass, STDAIR::Cabin::child>::value) { - std::cout << "The type of the child of a Cabin is a BookingClass" - << std::endl; - - } else { - std::cout << "The type of " << lCabin.toString() << " is unknown" - << std::endl; - } - - if (boost::is_same<boost::mpl::at_c<types, 1>::type, STDAIR::Cabin>::value) { - std::cout << "The 2nd type is STDAIR::Cabin" << std::endl; - - } else { - std::cout << "Problem!" << std::endl; - } - - BOOST_MPL_ASSERT ((boost::is_same<boost::mpl::at_c<types, 1>::type, - STDAIR::Cabin>)); - - return 0; -} Copied: trunk/stdair/test/mpl/mpl_book_ch_01.cpp (from rev 70, trunk/stdair/test/mpl/book/ch_01.cpp) =================================================================== --- trunk/stdair/test/mpl/mpl_book_ch_01.cpp (rev 0) +++ trunk/stdair/test/mpl/mpl_book_ch_01.cpp 2009-12-29 13:51:34 UTC (rev 72) @@ -0,0 +1,13 @@ +// STL +#include <iostream> +// Book on Boost MPL +#include "contrib/binary.hpp" + +// ///////////// M A I N ////////////// +int main (int argc, char* argv[]) { + + const long l42 = binary<101010>::value; + std::cout << "The 101010 binary number is equal to: " << l42 << std::endl; + + return 0; +} Deleted: trunk/stdair/test/mpl/test_mpl.sh =================================================================== --- trunk/stdair/test/mpl/test_mpl.sh 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/mpl/test_mpl.sh 2009-12-29 13:51:34 UTC (rev 72) @@ -1,25 +0,0 @@ -#!/bin/sh - -INSTALL_DIR=`grep "^prefix =" ../Makefile | cut -d"=" -d" " -f3` -TST_PROG=./mpl -LATUS_API_VERSION=`grep "^LATUS_API_VERSION =" ../Makefile | cut -d"=" -d" " -f3` -LATUS_LIBRARY_NAME=`grep "^LATUS_LIBRARY_NAME =" ../Makefile | cut -d"=" -d" " -f3` -LATUS_LIB=lib${LATUS_LIBRARY_NAME}-${LATUS_API_VERSION}.so - -if [ ! -x ${TST_PROG} ]; -then - echo "The sample program does not seem to have been compiled. Try 'make check' first." - exit -1 -fi - -if [ "$1" = "-h" -o "$1" = "-H" -o "$1" = "--h" -o "$1" = "--help" ]; -then - echo "Usage: $0 [<String to be parsed>]" - echo " The list to be parsed should contain floating point numbers" - echo " separated by commas, and should not contain spaces." - echo " Example: 10.2,5.4" - echo "The program parses a line and fills a flight-period structure." - exit 0 -fi - -${TST_PROG} $1 Property changes on: trunk/stdair/test/stdair ___________________________________________________________________ Modified: svn:ignore - .deps .libs Makefile.in Makefile StandardAirlineITTestSuite StandardAirlineITTestSuite.log StandardAirlineITTestSuite_results.xml + .deps .libs Makefile.in Makefile mpled_bom StandardAirlineITTestSuite StandardAirlineITTestSuite.log StandardAirlineITTestSuite_results.xml Modified: trunk/stdair/test/stdair/Makefile.am =================================================================== --- trunk/stdair/test/stdair/Makefile.am 2009-12-29 10:48:15 UTC (rev 71) +++ trunk/stdair/test/stdair/Makefile.am 2009-12-29 13:51:34 UTC (rev 72) @@ -9,10 +9,16 @@ EXTRA_DIST = ## -check_PROGRAMS = StandardAirlineITTestSuite +check_PROGRAMS = mpled_bom StandardAirlineITTestSuite TESTS = $(check_PROGRAMS) XFAIL_TESTS = #IndexBuildingTestSuite +# +mpled_bom_SOURCES = mpled_bom.cpp +mpled_bom_CXXFLAGS = $(BOOST_CFLAGS) +mpled_bom_LDADD = $(BOOST_LIB) + +# StandardAirlineITTestSuite_SOURCES = StandardAirlineITTestSuite.hpp \ StandardAirlineITTestSuite.cpp StandardAirlineITTestSuite_CXXFLAGS= $(BOOST_CFLAGS) $(CPPUNIT_CFLAGS) Copied: trunk/stdair/test/stdair/mpled_bom.cpp (from rev 70, trunk/stdair/test/mpl/mpl.cpp) =================================================================== --- trunk/stdair/test/stdair/mpled_bom.cpp (rev 0) +++ trunk/stdair/test/stdair/mpled_bom.cpp 2009-12-29 13:51:34 UTC (rev 72) @@ -0,0 +1,82 @@ +// STL +#include <iostream> +#include <sstream> +#include <string> +#include <vector> +// MPL +#include <boost/mpl/push_back.hpp> +#include <boost/mpl/vector.hpp> +#include <boost/mpl/at.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/type_traits/is_same.hpp> + +// ////////////////////////////////////////////////////////////////// +namespace STDAIR { + + /** BookingClass */ + struct BookingClass { + std::string _classCode; + /** Constructor. */ + BookingClass (const std::string& iClassCode) + : _classCode (iClassCode) { + } + + /** Display .*/ + std::string toString() const { + std::ostringstream oStr; + oStr << _classCode; + return oStr.str(); + } + }; + + /** Cabin */ + struct Cabin { + BookingClass _bookingClass; + Cabin (const BookingClass& iBkgClass) + : _bookingClass (iBkgClass) { + } + + /** Display .*/ + std::string toString() const { + std::ostringstream oStr; + oStr << _bookingClass._classCode; + return oStr.str(); + } + + /** Child type. */ + typedef BookingClass child; + }; + +} + +// /////////// M A I N //////////////// +int main (int argc, char* argv[]) { + + typedef boost::mpl::vector<STDAIR::BookingClass> MPL_BookingClass; + typedef boost::mpl::push_back<MPL_BookingClass, STDAIR::Cabin>::type types; + + const STDAIR::BookingClass lA ("A"); + const STDAIR::Cabin lCabin (lA); + + // lCabin::type + if (boost::is_same<STDAIR::BookingClass, STDAIR::Cabin::child>::value) { + std::cout << "The type of the child of a Cabin is a BookingClass" + << std::endl; + + } else { + std::cout << "The type of " << lCabin.toString() << " is unknown" + << std::endl; + } + + if (boost::is_same<boost::mpl::at_c<types, 1>::type, STDAIR::Cabin>::value) { + std::cout << "The 2nd type is STDAIR::Cabin" << std::endl; + + } else { + std::cout << "Problem!" << std::endl; + } + + BOOST_MPL_ASSERT ((boost::is_same<boost::mpl::at_c<types, 1>::type, + STDAIR::Cabin>)); + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-12-29 10:48:25
|
Revision: 71 http://stdair.svn.sourceforge.net/stdair/?rev=71&view=rev Author: denis_arnaud Date: 2009-12-29 10:48:15 +0000 (Tue, 29 Dec 2009) Log Message: ----------- [Conf] Standardised the configuration directory. Modified Paths: -------------- trunk/stdair/config/ax_boost.m4 Added Paths: ----------- trunk/stdair/config/ac_pkg_swig.m4 trunk/stdair/config/am_tools.m4 trunk/stdair/config/coin-flopcpp.m4 trunk/stdair/config/coin-osi.m4 trunk/stdair/config/cppunit.m4 trunk/stdair/config/extracc.m4 trunk/stdair/config/glpk.m4 trunk/stdair/config/gsl.m4 trunk/stdair/config/gsoap.m4 trunk/stdair/config/librt.m4 trunk/stdair/config/mpich2.m4 trunk/stdair/config/mysql++.m4 trunk/stdair/config/mysql.m4 trunk/stdair/config/openmpi.m4 trunk/stdair/config/python.m4 trunk/stdair/config/rmol.m4 trunk/stdair/config/soci.m4 trunk/stdair/config/swig_enable_cxx.m4 trunk/stdair/config/travelccm.m4 trunk/stdair/config/xapian.m4 trunk/stdair/config/xerces.m4 Property Changed: ---------------- trunk/stdair/config/ Property changes on: trunk/stdair/config ___________________________________________________________________ Modified: svn:ignore - ltsugar.m4 ltversion.m4 lt~obsolete.m4 ltoptions.m4 libtool.m4 ltmain.sh install-sh depcomp missing config.sub config.guess + depcomp config.guess config.sub ltmain.sh missing install-sh mdate-sh texinfo.tex lib-link.m4 printf-posix.m4 config.rpath libtool.m4 uintmax_t.m4 signed.m4 lt~obsolete.m4 iconv.m4 inttypes.m4 longlong.m4 glibc21.m4 inttypes_h.m4 codeset.m4 longdouble.m4 nls.m4 intmax.m4 lib-prefix.m4 mkinstalldirs xsize.m4 lib-ld.m4 lcmessage.m4 ulonglong.m4 wint_t.m4 inttypes-pri.m4 progtest.m4 stdint_h.m4 intdiv0.m4 po.m4 isc-posix.m4 size_max.m4 ltsugar.m4 gettext.m4 ltversion.m4 wchar_t.m4 ltoptions.m4 Added: trunk/stdair/config/ac_pkg_swig.m4 =================================================================== --- trunk/stdair/config/ac_pkg_swig.m4 (rev 0) +++ trunk/stdair/config/ac_pkg_swig.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,59 @@ +AC_DEFUN([AC_PROG_SWIG],[ + AC_PATH_PROG([SWIG],[swig]) + if test -z "$SWIG" ; then + AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) + SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' + elif test -n "$1" ; then + AC_MSG_CHECKING([for SWIG version]) + [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] + AC_MSG_RESULT([$swig_version]) + if test -n "$swig_version" ; then + # Calculate the required version number components + [required=$1] + [required_major=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_major" ; then + [required_major=0] + fi + [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required_minor=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_minor" ; then + [required_minor=0] + fi + [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required_patch=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_patch" ; then + [required_patch=0] + fi + # Calculate the available version number components + [available=$swig_version] + [available_major=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_major" ; then + [available_major=0] + fi + [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] + [available_minor=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_minor" ; then + [available_minor=0] + fi + [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] + [available_patch=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_patch" ; then + [available_patch=0] + fi + if test $available_major -ne $required_major \ + -o $available_minor -ne $required_minor \ + -o $available_patch -lt $required_patch ; then + AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) + SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + else + AC_MSG_NOTICE([SWIG executable is '$SWIG']) + SWIG_LIB=`$SWIG -swiglib` + AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) + fi + else + AC_MSG_WARN([cannot determine SWIG version]) + SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + fi + fi + AC_SUBST([SWIG_LIB]) +]) Added: trunk/stdair/config/am_tools.m4 =================================================================== --- trunk/stdair/config/am_tools.m4 (rev 0) +++ trunk/stdair/config/am_tools.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,125 @@ +dnl +dnl Macro to genarte common generic layer Makfiles and its sources.mk +dnl Christophe LACOMBE <cla...@am...>, August 2009 +dnl +dnl AM_GEN_COMMON_LAYER_MAKEFILE: +dnl ============================= +dnl This macro will generate the Makefile.am in the path given in first agument +dnl If a sources.mk file does not exist or has been just generated by this lib +dnl without beeing modified, then it will be generated with files (.h .hpp .c .cpp) +dnl present in the layer directory. This file can then be kept (and then regenerated +dnl if file list change) or be custumized. +dnl The macro can have as parameter(s): +dnl 1 - The relative path to the layer where to generate files (Mandatory) +dnl 2 - The name of the lib to generate for this layer +dnl If not specified, it will be the path to the layer without / +dnl 3 - Additional cxxflags to add for the compilation of the layer +dnl 4 - Additional ldflags to add for the link of the layer +dnl 5 - Additional libadd to add for the link of the layer +dnl 6 - Additional cxxflags to add for the debug compilation of the layer (set to non-debug value if empty) +dnl 7 - Additional ldflags to add for the debug link of the layer (set to non-debug value if empty) +dnl 8 - Additional libadd to add for the debug link of the layer (set to non-debug value if empty) +dnl sources.mk can defined variable: +dnl - <layer_lib_name>_h_sources +dnl - <layer_lib_name>_cc_sources + +AC_DEFUN([AM_GEN_COMMON_LAYER_MAKEFILE], +[ + dnl ############################# + dnl Here we use a syscmd in order to generate the files (Makefile.am and sources.mk) + dnl under the autoconf step, in order to have them when automake is called by autoconf + dnl ############################# + syscmd([ + layer_dir="$1" + layer_lib_name="$2" + layer_lib_cxxflags="$3" + layer_lib_ldflags="$4" + layer_lib_libflags="$5" + layer_lib_debug_cxxflags="$6" + layer_lib_debug_ldflags="$7" + layer_lib_debug_libflags="$8" + + #layer_dir is mandatory + [ -d "${layer_dir}" ] || exit 11 + + # If layer_lib_name is not defined, use the layer_dir without / + [ -z "${layer_lib_name}" ] && layer_lib_name=$(echo ${layer_dir} | tr -d '/') + + #Set debug vqriqble to non-debug one if not specified + [ -z "${layer_lib_debug_cxxflags}" ] && layer_lib_debug_cxxflags=${layer_lib_cxxflags} + [ -z "${layer_lib_debug_ldflags}" ] && layer_lib_debug_ldflags=${layer_lib_ldflags} + [ -z "${layer_lib_debug_libflags}" ] && layer_lib_debug_libflags=${layer_lib_libflags} + + #Compute the list of direct sub-layer - it is the list of sub-folders that have a Makefile.am + layer_sub_layer=$(find ${layer_dir} -mindepth 2 -maxdepth 2 -name Makefile.am -exec dirname {} \; | xargs -rn1 basename) + + #For each sub-layer get the list of sub-lib and compute the relative path - the variable will contain libs separated by new-line + layer_sub_lib=$(for l in $(echo ${layer_sub_layer}); do grep 'noinst_LTLIBRARIES.*=' ${layer_dir}/$l/Makefile.am | cut -d'=' -f2 | xargs -rn1 echo $l/ | tr -d ' '; done) + + # ############################# + # if it does not exist generate a default sources.mk from all files in the layer directory + # in case the file exist but has not been modified since it has been generated, then it will + # be regenerated + # to know if the file has been modified, we compare the date printed in the file with the last + # modified date of this file - they must be equal or differ just by 1 + # ############################# + # we add a 0 in front of the result of the second date operation as it might return nothing if the file + # has been modified and the date is not detected + if [ ! -r ${layer_dir}/sources.mk ] || [ $(( \ + $(date '+%s' -r ${layer_dir}/sources.mk) \ + - \ + $(date '+%s' -d "$(head -1 ${layer_dir}/sources.mk | cut -d'@' -f2)" 2>/dev/null) \ + +0)) -le 1 \ + ]; then { + echo "## Generate by AM""_GEN_COMMON_LAYER_MAKEFILE @ $(date)" + echo -n "${layer_lib_name}_h_sources =" + for f in $(cd ${layer_dir} 2>/dev/null && ls *.h *.hpp 2>/dev/null); do echo " \\"; echo -n " $(basename $f)"; done + echo + echo -n "${layer_lib_name}_cc_sources =" + for f in $(cd ${layer_dir} 2>/dev/null && ls *.c *.cpp 2>/dev/null); do echo " \\"; echo -n ' $(srcdir)/'"$f"; done + echo + } > ${layer_dir}/sources.mk || exit 12 + fi + + # ############################# + # generate the makefile.am for the given layer + # ############################# + echo '## Generate by AM'"_GEN_COMMON_LAYER_MAKEFILE @ $(date) +## This file should not be modified as it will be regenerated at each autoreconf + +include \$(top_srcdir)/Makefile.common +include \$(srcdir)/sources.mk + +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = $(echo ${layer_sub_layer} | tr '\n' ' ') + +noinst_LTLIBRARIES = lib${layer_lib_name}.la +if ENABLE_DEBUG +noinst_LTLIBRARIES += lib${layer_lib_name}_debug.la +endif + +lib${layer_lib_name}_la_SOURCES = \$(${layer_lib_name}_h_sources) \$(${layer_lib_name}_cc_sources) +lib${layer_lib_name}_la_CXXFLAGS = ${layer_lib_cxxflags} +lib${layer_lib_name}_la_LDFLAGS = ${layer_lib_ldflags} +lib${layer_lib_name}_la_LIBADD = ${layer_lib_libflags}$(echo "${layer_sub_lib}" | grep -v _debug | xargs -rn1 echo -n ' \ + ') + +lib${layer_lib_name}_debug_la_SOURCES = \$(${layer_lib_name}_h_sources) \$(${layer_lib_name}_cc_sources) +lib${layer_lib_name}_debug_la_CXXFLAGS = ${layer_lib_debug_cxxflags} +lib${layer_lib_name}_debug_la_LDFLAGS = ${layer_lib_debug_ldflags} +lib${layer_lib_name}_debug_la_LIBADD = ${layer_lib_debug_libflags}$(echo "${layer_sub_lib}" | grep _debug | xargs -rn1 echo -n ' \ + ') +" > ${layer_dir}/Makefile.am || exit 13 + ]) + + dnl ############################# + dnl If error, print error message else print ok message and + dnl return the Makefile to be generated by AC_CONFIG_FILES + dnl like that the macro AM_GEN_COMMON_LAYER_MAKEFILE is to be taken + dnl as an agument of AC_CONFIG_FILES + dnl ############################# + ifelse(sysval, [0], [$1/Makefile], [errprint([cannot generate Makefile.am for layer $1 : error ]sysval[ +]) ]) + +]) Modified: trunk/stdair/config/ax_boost.m4 =================================================================== --- trunk/stdair/config/ax_boost.m4 2009-12-28 16:08:25 UTC (rev 70) +++ trunk/stdair/config/ax_boost.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -19,6 +19,10 @@ dnl AC_SUBST(BOOST_SIGNALS_LIB) dnl AC_SUBST(BOOST_DATE_TIME_LIB) dnl AC_SUBST(BOOST_REGEX_LIB) +dnl AC_SUBST(BOOST_PYTHON_LIB) +dnl AC_SUBST(BOOST_ASIO_LIB) +dnl AC_SUBST(BOOST_MPI_LIB) +dnl AC_SUBST(BOOST_MPI_PYTHON_LIB) dnl AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) dnl dnl And sets: @@ -33,6 +37,10 @@ dnl HAVE_BOOST_SIGNALS dnl HAVE_BOOST_DATE_TIME dnl HAVE_BOOST_REGEX +dnl HAVE_BOOST_PYTHON +dnl HAVE_BOOST_ASIO +dnl HAVE_BOOST_MPI +dnl HAVE_BOOST_MPI_PYTHON dnl HAVE_BOOST_UNIT_TEST_FRAMEWORK dnl dnl @category InstalledPackages @@ -234,6 +242,9 @@ AC_SUBST(BOOST_LIBS) AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) +# +# Boost::Filesystem +# AC_CACHE_CHECK([whether the Boost::Filesystem library is available], ax_cv_boost_filesystem, [AC_LANG_SAVE @@ -261,6 +272,9 @@ fi fi +# +# Boost::System +# AC_CACHE_CHECK([whether the Boost::System library is available], ax_cv_boost_system, [AC_LANG_SAVE @@ -287,6 +301,9 @@ fi fi +# +# Boost::Program_Options +# AC_CACHE_CHECK([whether the Boost::Program_Options library is available], ax_cv_boost_program_options, [AC_LANG_SAVE @@ -314,6 +331,9 @@ fi fi +# +# Boost::Threads +# AC_CACHE_CHECK(whether the Boost::Thread library is available, ax_cv_boost_thread, [AC_LANG_SAVE @@ -346,7 +366,8 @@ AC_SUBST(BOOST_CFLAGS) AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::THREAD library is available]) BN=boost_thread - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ + for ax_lib in $BN $BN-mt $BN-$CC $BN-$CC-mt \ + $BN-$CC-mt-s $BN-$CC-s \ lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ $BN-mgw-mt-s $BN-mgw-s \ @@ -359,6 +380,9 @@ fi fi +# +# Boost::IOStreams +# AC_CACHE_CHECK(whether the Boost::IOStreams library is available, ax_cv_boost_iostreams, [AC_LANG_SAVE @@ -390,6 +414,9 @@ fi fi +# +# Boost::Serialization +# AC_CACHE_CHECK(whether the Boost::Serialization library is available, ax_cv_boost_serialization, [AC_LANG_SAVE @@ -432,6 +459,9 @@ fi fi +# +# Boost::Signals +# AC_CACHE_CHECK(whether the Boost::Signals library is available, ax_cv_boost_signals, [AC_LANG_SAVE @@ -452,14 +482,17 @@ lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ $BN-mgw-mt-s $BN-mgw-s \ $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do - AC_CHECK_LIB($ax_lib, main, [BOOST_SIGNALS_LIB="-l$ax_lib" AC_SUBST(BOOST_SIGNALS_LIB) link_thread="yes" break], - [link_thread="no"]) + AC_CHECK_LIB($ax_lib, main, [BOOST_SIGNALS_LIB="-l$ax_lib" AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes" break], + [link_signals="no"]) done - if test "x$link_thread" = "xno"; then + if test "x$link_signals" = "xno"; then AC_MSG_NOTICE(Could not link against $ax_lib !) fi fi +# +# Boost::Date_Time +# AC_CACHE_CHECK(whether the Boost::Date_Time library is available, ax_cv_boost_date_time, [AC_LANG_SAVE @@ -480,14 +513,17 @@ lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ $BN-mgw-mt-s $BN-mgw-s \ $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do - AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_thread="yes" break], - [link_thread="no"]) + AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], + [link_date_time="no"]) done - if test "x$link_thread"="no" = "xno"; then + if test "x$link_date_time"="no" = "xno"; then AC_MSG_NOTICE(Could not link against $ax_lib !) fi fi +# +# Boost::Regex +# AC_CACHE_CHECK(whether the Boost::Regex library is available, ax_cv_boost_regex, [AC_LANG_SAVE @@ -514,6 +550,141 @@ fi fi +# +# Boost::ASIO: it needs Boost.System, Boost.Regex, Boost.Thread and +# Boost.DateTime, but does not produce any (other) library. +# + AC_CACHE_CHECK(whether the Boost::Asio library is available, + ax_cv_boost_asio, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/asio.hpp>]], + [[boost::asio::io_service io; + boost::system::error_code timer_result; + boost::asio::deadline_timer t(io); + t.cancel(); + io.run_one(); + return 0; + ]]), + ax_cv_boost_asio=yes, ax_cv_boost_asio=no) + AC_LANG_RESTORE + ]) + if test "x$ax_cv_boost_asio" = "xyes"; then + AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::Asio library is available]) + BOOST_ASIO_LIB="${BOOST_SYSTEM_LIB} ${BOOST_THREAD_LIB}" + BOOST_ASIO_LIB="${BOOST_ASIO_LIB} ${BOOST_DATE_TIME_LIB}" + BOOST_ASIO_LIB="${BOOST_ASIO_LIB} ${BOOST_REGEX_LIB}" + BOOST_ASIO_LIB="${BOOST_ASIO_LIB} ${BOOST_SERIALIZATION_LIB}" + fi + +# +# Support for Python and MPI (MPICH2, Boost::MPI, Boost::Python, +# Boost::Serialization, Boost::MPI_Python) +# Note: on some distributions (e.g., Debian), Boost.MPI uses OpenMPI rather +# than MPICH2 +# + CPPFLAGS_ORIG="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${MPICH2_CFLAGS}" +# CPPFLAGS="${CPPFLAGS} ${PYTHON_CFLAGS} ${OPENMPI_CFLAGS}" + LDFLAGS_ORIG="${LDFLAGS}" + LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${MPICH2_LIBS}" +# LDFLAGS="${LDFLAGS} ${PYTHON_LIBS} ${PYTHON_ADD_LIBS} ${OPENMPI_LIBS}" + +# +# Boost::Python +# + AC_CACHE_CHECK(whether the Boost::Python library is available, + ax_cv_boost_python, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/python.hpp> + char const* greet() { return "hello"; } + BOOST_PYTHON_MODULE(hello_ext) { boost::python::def("greet", greet);} + ]]), + ax_cv_boost_python=yes, ax_cv_boost_python=no) + AC_LANG_RESTORE + ]) + + BOOST_PYTHON_LIB="-lboost_python" + AC_SUBST(BOOST_PYTHON_LIB) + +# +# Boost::MPI +# + AC_CACHE_CHECK(whether the Boost::Mpi library is available, + ax_cv_boost_mpi, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/mpi.hpp>]], + [[ + return 0; + ]]), + ax_cv_boost_mpi=yes, ax_cv_boost_mpi=no) + AC_LANG_RESTORE + ]) + if test "x$ax_cv_boost_mpi" = "xyes"; then + AC_DEFINE(HAVE_BOOST_MPI,,[define if the Boost::Mpi library is available]) + BN=boost_mpi + for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt $BN-mgw-mt-s \ + $BN-mgw-s $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do + + AC_CHECK_LIB($ax_lib, main, [BOOST_MPI_LIB="-l$ax_lib" AC_SUBST(BOOST_MPI_LIB) link_mpi="yes" break], + [link_mpi="no"]) + done + if test "x$link_mpi" = "xno"; then + AC_MSG_NOTICE(Could not link against $ax_lib !) + else + BOOST_MPI_LIB="${BOOST_MPI_LIB} ${BOOST_SERIALIZATION_LIB}" + fi + fi + +# +# Boost::MPI_Python +# + AC_CACHE_CHECK(whether the Boost::Mpi_Python library is available, + ax_cv_boost_mpi_python, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/mpi/python/serialize.hpp> + ]], + [[ + return 0; + ]]), + ax_cv_boost_mpi_python=yes, ax_cv_boost_mpi_python=no) + AC_LANG_RESTORE + ]) + if test "x$ax_cv_boost_mpi_python" = "xyes"; then + AC_DEFINE(HAVE_BOOST_MPI_PYTHON,,[define if the Boost::Mpi_Python library is available]) + BN=boost_mpi_python +# BN=boost_mpi_python-py25 + for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt $BN-mgw-mt-s \ + $BN-mgw-s $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do + AC_CHECK_LIB($ax_lib, main, [BOOST_MPI_PYTHON_LIB="-l$ax_lib" AC_SUBST(BOOST_MPI_PYTHON_LIB) link_mpi_python="yes" break], + [link_mpi_python="no"]) + done + if test "x$link_mpi_python" = "xno"; then + AC_MSG_NOTICE(Could not link against $ax_lib !) + else + BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_SERIALIZATION_LIB}" + BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_PYTHON_LIB}" + BOOST_MPI_PYTHON_LIB="${BOOST_MPI_PYTHON_LIB} ${BOOST_MPI_LIB}" + fi + fi + +# +# End of section on support for MPI +# + CPPFLAGS="${CPPFLAGS_ORIG}" + LDFLAGS="${LDFLAGS_ORIG}" + +# +# Boost::UnitTestFramework +# AC_CACHE_CHECK(whether the Boost::UnitTestFramework library is available, ax_cv_boost_unit_test_framework, [AC_LANG_SAVE @@ -555,8 +726,12 @@ AC_MSG_NOTICE(Could not link against $ax_lib !) fi fi - fi + + + fi dnl endif test "$succeeded" + CPPFLAGS="$CPPFLAGS_SAVED" LDFLAGS="$LDFLAGS_SAVED" - fi + + fi dnl endif test "x$want_boost" ]) Added: trunk/stdair/config/coin-flopcpp.m4 =================================================================== --- trunk/stdair/config/coin-flopcpp.m4 (rev 0) +++ trunk/stdair/config/coin-flopcpp.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,72 @@ +dnl +dnl Test for Flopc++ +dnl +dnl author: Christophe-marie Duquesne <chm...@gm...> +dnl +dnl This macro enables the "--with-coin-flopcpp=" user switch. If the +dnl user does not use the switch, it tries to find flopcpp headers in the +dnl default path. It stops the configure process if not found. +dnl +dnl It assumes you're checking by yourself that coin osi is installed. +dnl +dnl Usage: just put in your configure.ac: +dnl +dnl AX_COIN_FLOPCPP +dnl +dnl You can then use COIN_FLOPCPP_CFLAGS and COIN_FLOPCPP_LDFLAGS in your +dnl Makefile.am, and the flag HAVE_COIN_FLOPCPP is defined in your +dnl config.h +dnl + +AC_DEFUN([AX_COIN_FLOPCPP], +[ + save_CFLAGS=$CFLAGS + save_CPPFLAGS=$CPPFLAGS + + AC_LANG([C++]) + + AC_ARG_WITH(coin-flopcpp, + AC_HELP_STRING([--with-coin-flopcpp=DIR], + [COIN FLOPC++ home (if installed in a non-standard dir)]), + [FLOPCPP_HOME="$withval"], + [FLOPCPP_HOME=] + ) + + AC_MSG_CHECKING([for COIN FLOPC++]) + + if test "x${FLOPCPP_HOME}" = "xno" -o "x${FLOPCPP_HOME}" = "x" ; then + COIN_FLOPCPP_CFLAGS="" + COIN_FLOPCPP_LDFLAGS="" + else + COIN_FLOPCPP_CFLAGS="-I${FLOPCPP_HOME}/include" + COIN_FLOPCPP_LDFLAGS="-L${FLOPCPP_HOME}/lib" + fi + + CFLAGS="$COIN_FLOPCPP_CFLAGS" + CPPFLAGS="$COIN_FLOPCPP_CFLAGS" + + AC_CHECK_HEADER( + [coin/flopc.hpp], + [], + [ + AC_MSG_ERROR( + [Could not find COIN FLOPC++ headers] + ) + ] + ) + + HAVE_COIN_FLOPCPP=1 + + AC_DEFINE([HAVE_COIN_FLOPCPP],[],[Define this if COIN FLOPCPP is installed]) + + AC_SUBST([COIN_FLOPCPP_CFLAGS]) + AC_SUBST([COIN_FLOPCPP_LDFLAGS]) + + AC_MSG_RESULT([using flags $COIN_FLOPCPP_LDFLAGS]) + + AM_CONDITIONAL(HAVE_COIN_FLOPCPP,test "x$HAVE_COIN_FLOPCPP" = "x1" ) + + CFLAGS=$save_CFLAGS + CPPFLAGS=$save_CPPFLAGS +]) + Added: trunk/stdair/config/coin-osi.m4 =================================================================== --- trunk/stdair/config/coin-osi.m4 (rev 0) +++ trunk/stdair/config/coin-osi.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,75 @@ +dnl +dnl Test for OSI. +dnl +dnl author: chr...@am... +dnl +dnl This macro enables the "--with-coin-osi=" user switch. +dnl If the user does not use the switch, it tries to find osi headers in the default path. +dnl It stops the configure process if not found. +dnl + +AC_DEFUN([AX_COIN_OSI], +[ + save_CFLAGS=$CFLAGS + save_CPPFLAGS=$CFLAGS + + AC_LANG([C++]) + + AC_ARG_WITH(coin-osi, + AC_HELP_STRING([--with-coin-osi=DIR], + [COIN OSI home (if you installed OSI in a non-standard dir)]), + [OSI_HOME="$withval"], + [OSI_HOME=] + ) + + AC_MSG_CHECKING([for COIN-OR OSI]) + + if test "x${OSI_HOME}" = "xno" -o "x${OSI_HOME}" = "x" ; then + COIN_OSI_CFLAGS= + COIN_OSI_LDFLAGS="-lOsi -lCoinUtils" + else + COIN_OSI_CFLAGS="-I${OSI_HOME}/include" + COIN_OSI_LDFLAGS="-L${OSI_HOME}/lib -lOsi -lCoinUtils" + fi + + AC_ARG_WITH(coin-osi-solvers, + AC_HELP_STRING([--with-coin-osi-solvers=SOLVERNAMES], + [List of COIN-OR OSI solvers (Cpl, Glpk, Bcp, Cplex, ...) to use separated by commas. (Default = Clp)]), + [OSI_SOLVERLIST="$withval"], + [OSI_SOLVERLIST="Clp"] + ) + + for solver in $(echo $OSI_SOLVERLIST | tr ',' ' '); do + COIN_OSI_LDFLAGS+=" -lOsi${solver}" + # Add the solver lib if delivered by COIN-OR + test "${solver}" = "Clp" -o "${solver}" = "Dylp" -o "${solver}" = "Vol" && COIN_OSI_LDFLAGS+=" -l${solver}" + done + + CFLAGS="$COIN_OSI_CFLAGS" + CPPFLAGS="$COIN_OSI_CFLAGS" + + AC_CHECK_HEADER( + [coin/OsiSolverInterface.hpp], + [], + [ + AC_MSG_ERROR( + [Could not find OSI headers] + ) + ] + ) + + HAVE_COIN_OR_OSI=1 + + AC_DEFINE([HAVE_COIN_OR_OSI],[],[Define this if osi is installed]) + + AC_SUBST([COIN_OSI_CFLAGS]) + AC_SUBST([COIN_OSI_LDFLAGS]) + + AC_MSG_RESULT([using flags $COIN_OSI_LDFLAGS]) + + AM_CONDITIONAL(HAVE_COIN_OR_OSI,test "x$HAVE_COIN_OR_OSI" = "x1" ) + + CFLAGS=$save_CFLAGS + CPPFLAGS=$save_CFLAGS +]) + Added: trunk/stdair/config/cppunit.m4 =================================================================== --- trunk/stdair/config/cppunit.m4 (rev 0) +++ trunk/stdair/config/cppunit.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,93 @@ +dnl +dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([AM_PATH_CPPUNIT], +[ + +AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)], + cppunit_config_prefix="$withval", cppunit_config_prefix="") +AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)], + cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="") + + if test x$cppunit_config_exec_prefix != x ; then + cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config + fi + fi + if test x$cppunit_config_prefix != x ; then + cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config + fi + fi + + AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) + cppunit_version_min=$1 + + AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min) + no_cppunit="" + if test "$CPPUNIT_CONFIG" = "no" ; then + AC_MSG_RESULT(no) + no_cppunit=yes + else + CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` + CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` + CPPUNIT_VERSION=`$CPPUNIT_CONFIG --version` + + cppunit_major_version=`echo $CPPUNIT_VERSION | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + cppunit_minor_version=`echo $CPPUNIT_VERSION | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + cppunit_micro_version=`echo $CPPUNIT_VERSION | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + + cppunit_major_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + if test "x${cppunit_major_min}" = "x" ; then + cppunit_major_min=0 + fi + + cppunit_minor_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + if test "x${cppunit_minor_min}" = "x" ; then + cppunit_minor_min=0 + fi + + cppunit_micro_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x${cppunit_micro_min}" = "x" ; then + cppunit_micro_min=0 + fi + + cppunit_version_proper=`expr \ + $cppunit_major_version \> $cppunit_major_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \> $cppunit_minor_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \= $cppunit_minor_min \& \ + $cppunit_micro_version \>= $cppunit_micro_min ` + + if test "$cppunit_version_proper" = "1" ; then + AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) + else + AC_MSG_RESULT(no) + no_cppunit=yes + fi + fi + + if test "x$no_cppunit" = x ; then + ifelse([$2], , :, [$2]) + else + CPPUNIT_CFLAGS="" + CPPUNIT_LIBS="" + ifelse([$3], , :, [$3]) + fi + + AC_SUBST(CPPUNIT_CFLAGS) + AC_SUBST(CPPUNIT_LIBS) + AC_SUBST(CPPUNIT_VERSION) +]) + + + Added: trunk/stdair/config/extracc.m4 =================================================================== --- trunk/stdair/config/extracc.m4 (rev 0) +++ trunk/stdair/config/extracc.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,69 @@ +# +# Configure path for the EXTRACC library. +# Denis Arnaud <den...@us...>, July 2008 +# +# Note: as the EXTRACC library depends upon BOOST to build, +# your configure.ac must define appropriately the BOOST_CFLAGS +# variable. +# + + +AC_DEFUN([AM_PATH_EXTRACC], +[ + AC_LANG_SAVE + AC_LANG([C++]) + + AC_ARG_WITH(extracc, + [ --with-extracc=PFX Prefix where EXTRACC is installed (optional, default /usr/local)], + extracc_dir_check="$withval", + extracc_dir_check="/usr/local /usr") + + AC_MSG_CHECKING([for Extracc configuration script]) + extracc_dir= + for m in $extracc_dir_check + do + echo "test $m" + if test -x "$m/bin/extracc-config" + then + extracc_dir=$m + break + fi + done + + + EXTRACC_CONFIG="$extracc_dir/bin/extracc-config" + + AS_IF([test -x "$EXTRACC_CONFIG"], + [], + [AC_MSG_FAILURE([--with-extracc must be a valid directory where EXTRACC is installed (default /usr/local /usr)])]) + + EXTRACC_VERSION=`$EXTRACC_CONFIG --version` + EXTRACC_CFLAGS=`$EXTRACC_CONFIG --cflags` + EXTRACC_LIBS=`$EXTRACC_CONFIG --libs` + + AC_SUBST([EXTRACC_VERSION]) + AC_SUBST([EXTRACC_CFLAGS]) + AC_SUBST([EXTRACC_LIBS]) + + EXTRACC_EXTRACPPUNIT_INCLUDE=`$EXTRACC_CONFIG --extracppunit-makefile-include` + AC_SUBST([EXTRACC_EXTRACPPUNIT_INCLUDE]) + + extracc_major_version=`echo $EXTRACC_VERSION | sed 's/^\([[0-9]]*\).*/\1/'` + if test "x${extracc_major_version}" = "x" ; then + extracc_major_version=0 + fi + + extracc_minor_version=`echo $EXTRACC_VERSION | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'` + if test "x${extracc_minor_version}" = "x" ; then + extracc_minor_version=0 + fi + + extracc_micro_version=`echo $EXTRACC_VERSION | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'` + if test "x${extracc_micro_version}" = "x" ; then + extracc_micro_version=0 + fi + +AC_LANG_RESTORE +]) Added: trunk/stdair/config/glpk.m4 =================================================================== --- trunk/stdair/config/glpk.m4 (rev 0) +++ trunk/stdair/config/glpk.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,166 @@ +# Configure path for the GNU Scientific Library +# Christopher R. Gabriel <cga...@li...>, April 2000 + + +AC_DEFUN([AM_PATH_GLPK], +[ +AC_ARG_WITH(glpk,[ --with-glpk=PFX Prefix where GLPK is installed (optional)], + glpk_prefix="$withval", glpk_prefix="/usr") +AC_ARG_ENABLE(glpktest, [ --disable-glpktest Do not try to compile and run a test GLPK program], + , enable_glpktest=yes) + + if test "x${GLPK_CONFIG+set}" != xset ; then + if test "x$glpk_prefix" != x ; then + GLPK_CONFIG="$glpk_prefix/bin/glpsol" + fi + fi + + AC_PATH_PROG(GLPK_CONFIG, glpsol, no) + min_glpk_version=ifelse([$1], ,0.2.5,$1) + AC_MSG_CHECKING(for GLPK - version >= $min_glpk_version) + no_glpk="" + if test "$GLPK_CONFIG" = "no" ; then + no_glpk=yes + else + GLPK_CFLAGS="-I$glpk_prefix/include" + GLPK_LIBS="-L$glpk_prefix/lib -lglpk" + + glpk_major_version=`$GLPK_CONFIG --version | \ + cut -d\ -f 5 | grep 4 | \ + sed 's/^\([[0-9]]*\).*/\1/'` + if test "x${glpk_major_version}" = "x" ; then + glpk_major_version=0 + fi + + glpk_minor_version=`$GLPK_CONFIG --version | \ + cut -d\ -f 5 | grep 4 | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'` + if test "x${glpk_minor_version}" = "x" ; then + glpk_minor_version=0 + fi + + glpk_micro_version=`$GLPK_CONFIG --version | \ + cut -d\ -f 5 | grep 4 | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'` + if test "x${glpk_micro_version}" = "x" ; then + glpk_micro_version=0 + fi + + if test "x$enable_glpktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLPK_CFLAGS" + LIBS="$LIBS $GLPK_LIBS" + + rm -f conf.glpktest + AC_TRY_RUN([ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +char* my_strdup (const char *str); + +char* +my_strdup (const char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (void) +{ + int major = 0, minor = 0, micro = 0; + int n; + char *tmp_version; + + system ("touch conf.glpktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_glpk_version"); + + n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) ; + + if (n != 2 && n != 3) { + printf("%s, bad version string\n", "$min_glpk_version"); + exit(1); + } + + if (($glpk_major_version > major) || + (($glpk_major_version == major) && ($glpk_minor_version > minor)) || + (($glpk_major_version == major) && ($glpk_minor_version == minor) && ($glpk_micro_version >= micro))) + { + exit(0); + } + else + { + printf("\n*** 'glpk-config --version' returned %d.%d.%d, but the minimum version\n", $glpk_major_version, $glpk_minor_version, $glpk_micro_version); + printf("*** of GLPK required is %d.%d.%d. If glpk-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If glpk-config was wrong, set the environment variable GLPK_CONFIG\n"); + printf("*** to point to the correct copy of glpk-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + exit(1); + } +} + +],, no_glpk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glpk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GLPK_CONFIG" = "no" ; then + echo "*** The glpk-config script installed by GLPK could not be found" + echo "*** If GLPK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GLPK_CONFIG environment variable to the" + echo "*** full path to glpk-config." + else + if test -f conf.glpktest ; then + : + else + echo "*** Could not run GLPK test program, checking why..." + CFLAGS="$CFLAGS $GLPK_CFLAGS" + LIBS="$LIBS $GLPK_LIBS" + AC_TRY_LINK([ +#include <stdio.h> +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLPK or finding the wrong" + echo "*** version of GLPK. If it is not finding GLPK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLPK was incorrectly installed" + echo "*** or that you have moved GLPK since it was installed. In the latter case, you" + echo "*** may want to edit the glpk-config script: $GLPK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi +# GLPK_CFLAGS="" +# GLPK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLPK_CFLAGS) + AC_SUBST(GLPK_LIBS) + rm -f conf.glpktest +]) + + Added: trunk/stdair/config/gsl.m4 =================================================================== --- trunk/stdair/config/gsl.m4 (rev 0) +++ trunk/stdair/config/gsl.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,79 @@ +# Configure path for the GSL library. +# Denis Arnaud <den...@us...>, May 2007 + + +AC_DEFUN([AM_PATH_GSL], +[ + +AC_ARG_WITH(gsl, + [ --with-gsl=PFX Prefix where GSL is installed (optional)], + gsl_dir="$withval", + gsl_dir="") + + if test "x${GSL_CONFIG+set}" != xset ; then + if test "x$gsl_dir" != x ; then + GSL_CONFIG="$gsl_dir/bin/gsl-config" + fi + fi + + AC_PATH_PROG(GSL_CONFIG, gsl-config, no) + + min_gsl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for GSL - version >= $min_gsl_version) + no_gsl="" + if test "$GSL_CONFIG" = "no" ; then + no_gsl=yes + AC_MSG_RESULT([no]) + else + GSL_VERSION=`$GSL_CONFIG --version` + GSL_CFLAGS=`$GSL_CONFIG --cflags` + GSL_LIBS=`$GSL_CONFIG --libs` + + AC_SUBST([GSL_VERSION]) + AC_SUBST([GSL_CFLAGS]) + AC_SUBST([GSL_LIBS]) + + gsl_major_version=`echo $GSL_VERSION | sed 's/^\([[0-9]]*\).*/\1/'` + if test "x${gsl_major_version}" = "x" ; then + gsl_major_version=0 + fi + + gsl_minor_version=`echo $GSL_VERSION | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'` + if test "x${gsl_minor_version}" = "x" ; then + gsl_minor_version=0 + fi + + gsl_micro_version=`echo $GSL_VERSION | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'` + if test "x${gsl_micro_version}" = "x" ; then + gsl_micro_version=0 + fi + + + SAVED_CPPFLAGS="$CPPFLAGS" + SAVED_LDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $GSL_CFLAGS" + LDFLAGS="$LDFLAGS $GSL_LIBS" + + + AC_COMPILE_IFELSE( + AC_LANG_PROGRAM([[ + #include <gsl/gsl_types.h> + ]], + [[int i=0;]] + ) + , + + [AC_MSG_RESULT([yes ($GSL_VERSION)])], + + [ + AC_MSG_ERROR([We could not compile a simple GSL example. See config.log.]) + ] + ) + + CPPFLAGS="$SAVED_CPPFLAGS" + LDFLAGS="$SAVED_LDFLAGS" + + fi +]) Added: trunk/stdair/config/gsoap.m4 =================================================================== --- trunk/stdair/config/gsoap.m4 (rev 0) +++ trunk/stdair/config/gsoap.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,110 @@ +dnl +dnl brief : sets gsoap library +dnl author : daniel.perez +dnl todo : make library checks work +dnl todo : make static/dynamic library an option +dnl +AC_DEFUN([AX_GSOAP], +[ + + + dnl ############################################### + dnl + dnl 0) --with-gsoap-prefix + dnl + AC_MSG_CHECKING([where is gsoap++'s]) + AC_ARG_WITH( + [gsoap-prefix], + AC_HELP_STRING([--with-gsoap-prefix=DIR], + ["gsoap++ home or prefix (e.g. /usr/, /usr/local,...)"]), + [ + GSOAP_PREFIX=$withval + AC_MSG_RESULT([using $GSOAP_PREFIX folder]) + ], + [ + AC_MSG_RESULT([no prefix provided, using default location.]) + foo="foo" + ] + ) + + if test "x$GSOAP_PREFIX" != "x"; then + GSOAP_LIBRARY_PATH_FLAG="-L$GSOAP_PREFIX/lib" + else + GSOAP_LIBRARY_PATH_FLAG= + fi + + GSOAP_SHARED_LIBS="-lgsoap++ $GSOAP_LIBRARY_PATH_FLAG" + GSOAP_STATIC_LIBS="-lgsoap++ $GSOAP_LIBRARY_PATH_FLAG" + GSOAP_INCLUDES="$GSOAP_PREFIX/include" + GSOAP_LD_LIBRARY_PATH="$GSOAP_PREFIX/lib" + + AC_SUBST([GSOAP_SHARED_LIBS]) + AC_SUBST([GSOAP_STATIC_LIBS]) + AC_SUBST([GSOAP_INCLUDES]) + AC_SUBST([GSOAP_LD_LIBRARY_PATH]) + + dnl ############################################### + dnl + dnl 1) Checking if wsdl2h exists + dnl + AC_CHECK_PROG(WSDL2H, wsdl2h, true, false,[$PATH$PATH_SEPARATOR$GSOAP_PREFIX/bin$PATH_SEPARATOR]) + + if test "$WSDL2H" = false ; then + AC_MSG_ERROR(cannot find wsdl2h.) + fi + + dnl ############################################### + dnl + dnl 2) Checking if soapcpp2 exists + dnl + dnl AC_MSG_CHECKING([if soapcpp2 is installed]) + dnl AC_CHECK_PROG(SOAPCPP2, soapcpp2, true, false) + dnl + dnl if test "$SOAPCPP2" = false ; then + dnl AC_MSG_ERROR(cannot find soapcpp2.) + dnl fi + + dnl ############################################### + dnl + dnl 3) Checking if it compiles + dnl + AC_MSG_CHECKING([if gsoap++ compiles]) + AC_TRY_COMPILE([ #include <stdsoap2.h> ], [soap_new();],AC_MSG_RESULT([yes]), [AC_MSG_RESULT([no, see config.log.]) ; exit ] ) + + + dnl ############################################### + dnl + dnl 4) Checking if it links + dnl + + dnl Setting library environment. +dnl GSOAP_LINKS_DYNAMICALLY="false" +dnl OLD_LDFLAGS="$LDFLAGS" +dnl LDFLAGS="$LIBS $GSOAP_SHARED_LIBS" +dnl +dnl +dnl dnl AC_MSG_CHECKING([if gsoap++ links dynamically]) +dnl dnl AC_TRY_LINK([ #include <stdsoap2.h> ], [soap_new();],[GSOAP_LINKS_DYNAMICALLY="true";AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no.])]) +dnl AC_CHECK_LIB([gsoap++],[soap_new],[GSOAP_LINKS_DYNAMICALLY="true"],[]) +dnl +dnl dnl Setting library environment. +dnl GSOAP_LINKS_STATICALLY="false" +dnl LDFLAGS="$OLD_LDFLAGS" +dnl LDFLAGS="$LIBS $GSOAP_STATIC_LIBS" +dnl +dnl dnl AC_MSG_CHECKING([if gsoap++ links statically]) +dnl dnl AC_TRY_LINK([ #include <stdsoap2.h> ], [soap_new();],[GSOAP_LINKS_STATICALLY="true";AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no.])]) +dnl AC_CHECK_LIB([gsoap++],[soap_new],[GSOAP_LINKS_STATICALLY="true"],[]) +dnl +dnl LIBS="$OLD_LIBS" +dnl +dnl if [test "$GSOAP_LINKS_DINAMICALLY" == "true"] ; then +dnl GSOAP_LIBS="$GSOAP_SHARED_LIBS"; +dnl AC_SUBST([GSOAP_LIBS]) +dnl elif [test "$GSOAP_LINKS_STATICALLY" == "true"] ; then +dnl GSOAP_LIBS="$GSOAP_STATIC_LIBS" +dnl AC_SUBST([GSOAP_LIBS]) +dnl else +dnl AC_MSG_ERROR(gsoap does not link. See config.log.) +dnl fi +]) Added: trunk/stdair/config/librt.m4 =================================================================== --- trunk/stdair/config/librt.m4 (rev 0) +++ trunk/stdair/config/librt.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,24 @@ +dnl +dnl Real-Time library (librt) +dnl + +AC_DEFUN([AC_CHECK_LIBRT], +[ + AC_MSG_CHECKING([for librt]) + + rt_found="no" + for dir in /lib /usr/lib /usr/local/lib; do + if test -f "$dir/librt.so.1"; then + rt_found="yes" + break; + fi + done + if test x_$rt_found = x_yes; then + AC_SUBST(RT_LIBS,"-lrt") + AC_MSG_RESULT([-lrt]) + else + AC_SUBST(RT_LIBS,"") + AC_MSG_RESULT([not needed]) + fi +]) + Added: trunk/stdair/config/mpich2.m4 =================================================================== --- trunk/stdair/config/mpich2.m4 (rev 0) +++ trunk/stdair/config/mpich2.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,187 @@ +dnl @synopsis AX_MPICH2 +dnl +dnl This macro tries to find Mpich2 C API header and library locations. +dnl +dnl We define the following configure script flags: +dnl +dnl --with-mpich2: Give prefix for both library and headers, and try +dnl to guess subdirectory names for each. (e.g. Tack /lib and +dnl /include onto given dir name, and other common schemes.) +dnl --with-mpich2-lib: Similar to --with-mpich2, but for library only. +dnl --with-mpich2-include: Similar to --with-mpich2, but for headers +dnl only. +dnl +dnl @version 1.0, 2009/10/08 +dnl @author Denis Arnaud <den...@m4...> + +AC_DEFUN([AX_MPICH2], +[ + +dnl +dnl Check the CPU (and OS) architecture: 32 or 64 bits +dnl +ARCH=`arch` +if test "${ARCH}" = "i386" -o "${ARCH}" = "i686" -o "${ARCH}" = "ppc" -o "${ARCH}" = "sparcv9" +then + MODE=32 + MODEFLAG="-m32" +elif test "${ARCH}" = "ia64" +then + MODE=64 +elif test "${ARCH}" = "s390" +then + MODE=31 +elif test "${ARCH}" = "s390x" +then + MODE=64 +elif test "${ARCH}" = "x86_64" -o "${ARCH}" = "ppc64" -o "${ARCH}" = "sparc64" +then + MODE=64 + MODEFLAG="-m64" +fi + +GENARCH="${ARCH}" +if test "${ARCH}" = "i686" +then + GENARCH="i386" +fi + +MPICH2_DEF_VERSION="1.3.3" +MPICH2_DEF_CC="gcc" +MPIDIR="${MPICH2_DEF_VERSION}-${MPICH2_DEF_CC}" + + # + # Set up configure script macros + # + AC_ARG_WITH(mpich2, + [ --with-mpich2=<path> root directory path of Mpich2 installation], + [MPICH2_lib_check="$with_mpich2/lib${MODE}/mpich2 $with_mpich2/lib/mpich2 $with_mpich2/lib${MODE} $with_mpich2/lib" + MPICH2_inc_check="$with_mpich2/include $with_mpich2/include/mpich2 $with_mpich2/include/mpich2/${MPIDIR}"], + [MPICH2_lib_check="/usr/lib${MODE} /usr/lib /usr/lib${MODE}/mpich2 /usr/lib/mpich2 /usr/lib${MODE}/mpich2/lib /usr/lib/mpich2/lib /usr/lib${MODE}/mpich2/${MPIDIR} /usr/lib/mpich2/${MPIDIR} /usr/local/lib${MODE} /usr/local/lib /usr/local/lib${MODE}/mpich2 /usr/local/lib/mpich2 /usr/local/lib${MODE}/mpich2/${MPIDIR} /usr/local/lib/mpich2/${MPIDIR} /usr/local/mpich2/lib${MODE} /usr/local/mpich2/lib /usr/local/mpich2/${MPIDIR}/lib${MODE} /usr/local/mpich2/${MPIDIR}/lib$ /opt/mpich2/lib /opt/mpich2/${MPIDIR}/lib /opt/mpich2/lib/mpich2" + MPICH2_inc_check="/usr/include /usr/include/mpich2 /usr/include/mpich2/${MPIDIR} /usr/local/include /usr/local/include/mpich2 /usr/local/include/mpich2/${MPIDIR} /opt/mpich2/include /opt/mpich2/${MPIDIR}/include"]) + + AC_ARG_WITH(mpich2-lib, + [ --with-mpich2-lib=<path> directory path of Mpich2 library installation], + [MPICH2_lib_check="$with_mpich2_lib $with_mpich2_lib/lib${MODE} $with_mpich2_lib/lib $with_mpich2_lib/lib${MODE}/mpich2 $with_mpich2_lib/lib/mpich2 $with_mpich2_lib/lib${MODE}/mpich2/${MPIDIR} $with_mpich2_lib/lib/mpich2/${MPIDIR}"]) + + AC_ARG_WITH(mpich2-include, + [ --with-mpich2-include=<path> directory path of Mpich2 header installation], + [MPICH2_inc_check="$with_mpich2_include $with_mpich2_include/include $with_mpich2_include/include/mpich2 $with_mpich2_include/include/mpich2/${MPIDIR}"]) + + # Mpich2 library + MPICH2_LIB=mpichcxx + MPICH2_LIBC=mpich + + # + # Look for Mpich2 library + # + AC_MSG_CHECKING([for Mpich2 library directory]) + MPICH2_libdir= + for m in ${MPICH2_lib_check} + do + if test -d "$m" + then + if (test -f "$m/lib$MPICH2_LIB.so" || test -f "$m/lib$MPICH2_LIB.a") + then + MPICH2_libdir=$m + break + fi + fi + done + + if test -z "$MPICH2_libdir" + then + AC_MSG_ERROR([Didn't find $MPICH2_LIB library in '$MPICH2_lib_check']) + fi + + case "$MPICH2_libdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Mpich2 library directory ($MPICH2_libdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MPICH2_libdir]) + + # + # Look for Mpich2 headers + # + AC_MSG_CHECKING([for Mpich2 include directory]) + MPICH2_incdir= + for m in $MPICH2_inc_check + do + if test -d "$m" && test -f "$m/mpi.h" + then + MPICH2_incdir=$m + break + fi + done + + if test -z "$MPICH2_incdir" + then + AC_MSG_ERROR([Didn't find the Mpich2 include dir in '$MPICH2_inc_check']) + fi + + case "$MPICH2_incdir" in + /* ) ;; + * ) AC_MSG_ERROR([The Mpich2 include directory ($MPICH2_incdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MPICH2_incdir]) + + # + # Look for Mpich2 version + # + min_mpich2_version=ifelse([$1], , 1.0.0, $1) + AC_MSG_CHECKING([for Mpich2 version >= $min_mpich2_version]) + + # Derive the full version, e.g., 1.3.3 + MPICH2_VERSION=`echo ${MPICH2_incdir} | sed 's/.*\/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1.\2.\3/g'` + if test -z "${MPICH2_VERSION}" ; then + MPICH2_VERSION=${MPICH2_DEF_VERSION} + fi + + # Calculation of major, minor, micro + mpich2_major_version=`echo $MPICH2_VERSION | sed 's/^\([[0-9]]*\).*/\1/'` + if test "x${mpich2_major_version}" = "x" ; then + mpich2_major_version=0 + fi + + mpich2_minor_version=`echo $MPICH2_VERSION | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'` + if test "x${mpich2_minor_version}" = "x" ; then + mpich2_minor_version=0 + fi + + mpich2_micro_version=`echo $MPICH2_VERSION | \ + sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'` + if test "x${mpich2_micro_version}" = "x" ; then + mpich2_micro_version=0 + fi + + AC_MSG_RESULT([$MPICH2_VERSION]) + + # + # Derive the flags for compilation and linking + # + MPICH2_CFLAGS="-I${MPICH2_incdir} ${MODEFLAG}" + MPICH2_LIBS="-L${MPICH2_libdir} -lmpichcxx" + + # + # Make the changes permanent + # + AC_SUBST(MPICH2_VERSION) + AC_SUBST(MPICH2_CFLAGS) + AC_SUBST(MPICH2_LIBS) + + # Test linking with mpich2 + save_LIBS="$LIBS" + if test -z "$MPICH2_LIBS" + then + MPICH2_LIBS="-L/usr/lib${MODE}/mpich2 -lmpich" + fi + LIBS="$LIBS $MPICH2_LIBS" + AC_CHECK_LIB($MPICH2_LIBC, MPID_Comm_direct, + [], + [AC_MSG_ERROR([Could not find working Mpich2 library!])] + ) + LIBS="$save_LIBS" +]) dnl AX_MPICH2 Added: trunk/stdair/config/mysql++.m4 =================================================================== --- trunk/stdair/config/mysql++.m4 (rev 0) +++ trunk/stdair/config/mysql++.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,142 @@ +#-###################################################################### +# mysql++.m4 - Example autoconf macro showing how to find MySQL++ +# library and header files. +# +# Copyright (c) 2004-2005 by Educational Technology Resources, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with MySQL++; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +# USA +#-###################################################################### + +dnl @synopsis AX_MYSQLPP +dnl +dnl This macro tries to find the MySQL++ library and header files. +dnl +dnl We define the following configure script flags: +dnl +dnl --with-mysqlpp: Give prefix for both library and headers, and try +dnl to guess subdirectory names for each. (e.g. tack /lib and +dnl /include onto given dir name, and other common schemes.) +dnl --with-mysqlpp-lib: Similar to --with-mysqlpp, but for library only. +dnl --with-mysqlpp-include: Similar to --with-mysqlpp, but for headers +dnl only. +dnl +dnl This macro depends on having the default compiler and linker flags +dnl set up for building programs against the MySQL C API. The mysql.m4 +dnl macro in this directory fits this bill; run it first. +dnl +dnl @version 1.0, 2005/07/13 +dnl @author Warren Young <my...@et...> + +AC_DEFUN([AX_MYSQLPP], +[ +# -------------------------------------------------------------------- +# Support for MySQL (C client API): http://www.mysql.com +# the mysql.m4 must be present and define AX_MYSQL macro +# -------------------------------------------------------------------- +AX_MYSQL +# AC_SUBST(MYSQL_CFLAGS) +# AC_SUBST(MYSQL_LIBS) + +AC_CACHE_CHECK([for MySQL++ devel stuff], ac_cv_mysqlpp_devel, +[ + # + # Set up configure script macros + # + AC_ARG_WITH(mysqlpp, + [ --with-mysqlpp=<path> path containing MySQL++ header and library subdirs], + [MYSQLPP_lib_check="$with_mysqlpp/lib64 $with_mysqlpp/lib" + MYSQLPP_inc_check="$with_mysqlpp/include"], + [MYSQLPP_lib_check="/usr/local/mysql++/lib64 /usr/local/mysql++/lib /usr/local/lib64/mysql++ /usr/local/lib/mysql++ /opt/mysql++/lib64 /opt/mysql++/lib /usr/lib64/mysql++ /usr/lib/mysql++ /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib" + MYSQLPP_inc_check="/usr/local/mysql++/include /usr/local/include/mysql++ /opt/mysql++/include /usr/local/include /usr/include"]) + AC_ARG_WITH(mysqlpp-lib, + [ --with-mysqlpp-lib=<path> directory path of MySQL++ library], + [MYSQLPP_lib_check="$with_mysqlpp_lib $with_mysqlpp_lib/lib64 $with_mysqlpp_lib/lib $with_mysqlpp_lib/lib64/mysql $with_mysqlpp_lib/lib/mysql"]) + AC_ARG_WITH(mysqlpp-include, + [ --with-mysqlpp-include=<path> directory path of MySQL++ headers], + [MYSQLPP_inc_check="$with_mysqlpp_include $with_mysqlpp_include/include $with_mysqlpp_include/include/mysql"]) + + # + # Look for MySQL++ library + # + MYSQLPP_libdir= + for dir in $MYSQLPP_lib_check + do + if test -d "$dir" && \ + ( test -f "$dir/libmysqlpp.so" || + test -f "$dir/libmysqlpp.a" ) + then + MYSQLPP_libdir=$dir + break + fi + done + + if test -z "$MYSQLPP_libdir" + then + AC_MSG_ERROR([Didn't find the MySQL++ library dir in '$MYSQLPP_lib_check']) + fi + + case "$MYSQLPP_libdir" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL++ library directory ($MYSQLPP_libdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([lib in $MYSQLPP_libdir]) + + case "$MYSQLPP_libdir" in + /usr/lib) ;; + *) LDFLAGS="$LDFLAGS -L${MYSQLPP_libdir}" ;; + esac + + + # + # Look for MySQL++ headers + # + AC_MSG_CHECKING([for MySQL++ header directory]) + MYSQLPP_incdir= + for dir in $MYSQLPP_inc_check + do + if test -d "$dir" && test -f "$dir/mysql++/mysql++.h" + then + MYSQLPP_incdir=$dir + break + fi + done + + if test -z "$MYSQLPP_incdir" + then + AC_MSG_ERROR([Didn't find the MySQL++ header dir in '$MYSQLPP_inc_check']) + fi + + case "$MYSQLPP_incdir" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL++ header directory ($MYSQLPP_incdir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MYSQLPP_incdir]) + + MYSQLPP_CFLAGS="-DMYSQLPP_MYSQL_HEADERS_BURIED=1 -I${MYSQLPP_incdir} ${MYSQL_CFLAGS}" + MYSQLPP_LIBS="-L${MYSQLPP_libdir} -lmysqlpp ${MYSQL_LIBS}" + + + +# AC_MSG_CHECKING([that we can build MySQL++ programs]) +# AC_COMPILE_IFELSE( +# [AC_LANG_PROGRAM([#include <mysql++/mysql++.h>], +# [std::string s; mysqlpp::escape_string(s)])], +# ac_cv_mysqlpp_devel=yes, +# AC_MSG_ERROR(no)) +])]) dnl End AX_MYSQLPP + Added: trunk/stdair/config/mysql.m4 =================================================================== --- trunk/stdair/config/mysql.m4 (rev 0) +++ trunk/stdair/config/mysql.m4 2009-12-29 10:48:15 UTC (rev 71) @@ -0,0 +1,163 @@ +dnl @synopsis AX_MYSQL +dnl +dnl This macro tries to find MySQL C API header and library locations. +dnl +dnl We define the following configure script flags: +dnl +dnl --with-mysql: Give prefix for both library and headers, and try +dnl to guess subdirectory names for each. (e.g. Tack /lib and +dnl /include onto given dir name, and other common schemes.) +dnl --with-mysql-lib: Similar to --with-mysql, but for library only. +dnl --with-mysql-include: Similar to --with-mysql, but for headers +dnl only. +dnl +dnl @version 1.2, 2007/02/20 +dnl @author Warren Young <my...@et...> + +AC_DEFUN([AX_MYSQL], +[ + # + # Set up configure script macros + # + AC_ARG_WITH(mysql, + [ --with-mysql=<path> root directory path of MySQL installation], + [MYSQL_lib_check="$with_mysql/lib64/mysql $with_mysql/lib/mysql $with_mysql/lib64 $with_mysql/lib" + MYSQL_inc_check="$with_mysql/include $with_mysql/include/mysql" + MYSQL_bin_check="$with_mysql/bin"], + [MYSQL_lib_check="/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /opt/mysql/lib /opt/mysql/lib/mysql" + MYSQL_inc_check="/usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /opt/mysql/include/mysql" + MYSQL_bin_check="/usr/bin /usr/local/bin /usr/local/mysql/bin"]) + + AC_ARG_WITH(mysql-lib, + [ --with-mysql-lib=<path> directory path of MySQL library installation], + [MYSQL_lib_check="$with_mysql_lib $with_mysql_lib/lib64 $with_mysql_lib/lib $with_mysql_lib/lib64/mysql $with_mysql_lib/lib/mysql"]) + + AC_ARG_WITH(mysql-include, + [ --with-mysql-include=<path> directory path of MySQL header installation], + [MYSQL_inc_check="$with_mysql_include $with_mysql_include/include $with_mysql_include/include/mysql"]) + + + # + # Look for MySQL Configuration Script + # + AC_MSG_CHECKING([for MySQL configuration script]) + MYSQL_CONFIG= + MYSQL_bindir= + for m in $MYSQL_bin_check + do + if test -d "$m" && test -f "$m/mysql_config" + then + MYSQL_CONFIG=$m/mysql_config + MYSQL_bindir=$m + break + fi + done + + if test -z "$MYSQL_bindir" + then + AC_MSG_ERROR([Didn't find $MYSQL_CONFIG binary in '$MYSQL_bin_check']) + fi + + case "$MYSQL_bindir" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL binary directory ($MYSQL_bindir) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MYSQL_bindir]) + +# AC_PATH_PROG(MYSQL_CONFIG, mysql_config, $MYSQL_bindir) + + # + # Decide which C API library to use, based on thread support + # + if test "x$acx_pthread_ok" = xyes + then + MYSQL_C_LIB=mysqlclient_r + MYSQL_LIB_OPTION=libs_r + else + MYSQL_C_LIB=mysqlclient + MYSQL_LIB_OPTION=libs + fi + + if test "x${MYSQL_CONFIG+set}" != xset + then + MYSQL_VERSION=`${MYSQL_CONFIG} --version` + MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags` + MYSQL_LIBS=`${MYSQL_CONFIG} --${MYSQL_LIB_OPTION}` + else + # + # Look for MySQL C API library + # + AC_MSG_CHECKING([for MySQL library directory]) + MYSQL_libdir= + for m in $MYSQL_lib_check + do + if test -d "$m" && \ + (test -f "$m/lib$MYSQL_C_LIB.so" \ + || test -f "$m/lib$MYSQL_C_LIB.a") + then + MYSQL_libdir=$m + break + fi + done + + if test -z "$MYSQL_libdir" + then + ... [truncated message content] |