|
From: <den...@us...> - 2009-12-26 01:40:52
|
Revision: 21
http://dsim.svn.sourceforge.net/dsim/?rev=21&view=rev
Author: denis_arnaud
Date: 2009-12-26 01:40:41 +0000 (Sat, 26 Dec 2009)
Log Message:
-----------
[Test] Created a dedicated test suite for Boost tests.
Modified Paths:
--------------
trunk/dsim/Makefile.am
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Added Paths:
-----------
trunk/dsim/test/boost/
trunk/dsim/test/boost/Makefile.am
trunk/dsim/test/boost/accumulators/
trunk/dsim/test/boost/accumulators/Makefile.am
trunk/dsim/test/boost/accumulators/accu.cpp
trunk/dsim/test/boost/asio/
trunk/dsim/test/boost/asio/Makefile.am
trunk/dsim/test/boost/asio/daytime1.cpp
trunk/dsim/test/boost/asio/daytime2.cpp
trunk/dsim/test/boost/asio/daytime3.cpp
trunk/dsim/test/boost/asio/daytime4.cpp
trunk/dsim/test/boost/asio/daytime5.cpp
trunk/dsim/test/boost/asio/daytime6.cpp
trunk/dsim/test/boost/asio/daytime7.cpp
trunk/dsim/test/boost/asio/httpd/
trunk/dsim/test/boost/asio/httpd/Makefile.am
trunk/dsim/test/boost/asio/httpd/connection.cpp
trunk/dsim/test/boost/asio/httpd/connection.hpp
trunk/dsim/test/boost/asio/httpd/header.hpp
trunk/dsim/test/boost/asio/httpd/mime_types.cpp
trunk/dsim/test/boost/asio/httpd/mime_types.hpp
trunk/dsim/test/boost/asio/httpd/posix_main.cpp
trunk/dsim/test/boost/asio/httpd/reply.cpp
trunk/dsim/test/boost/asio/httpd/reply.hpp
trunk/dsim/test/boost/asio/httpd/request.hpp
trunk/dsim/test/boost/asio/httpd/request_handler.cpp
trunk/dsim/test/boost/asio/httpd/request_handler.hpp
trunk/dsim/test/boost/asio/httpd/request_parser.cpp
trunk/dsim/test/boost/asio/httpd/request_parser.hpp
trunk/dsim/test/boost/asio/httpd/server.cpp
trunk/dsim/test/boost/asio/httpd/server.hpp
trunk/dsim/test/boost/asio/httpd/win_main.cpp
trunk/dsim/test/boost/asio/logd/
trunk/dsim/test/boost/asio/logd/Makefile.am
trunk/dsim/test/boost/asio/logd/log/
trunk/dsim/test/boost/asio/logd/logd.cpp
trunk/dsim/test/boost/asio/logger/
trunk/dsim/test/boost/asio/logger/Makefile.am
trunk/dsim/test/boost/asio/logger/basic_logger.hpp
trunk/dsim/test/boost/asio/logger/daytime_client.cpp
trunk/dsim/test/boost/asio/logger/logger.hpp
trunk/dsim/test/boost/asio/logger/logger_service.cpp
trunk/dsim/test/boost/asio/logger/logger_service.hpp
trunk/dsim/test/boost/asio/logger/stream_socket_service.hpp
trunk/dsim/test/boost/asio/timer1.cpp
trunk/dsim/test/boost/asio/timer2.cpp
trunk/dsim/test/boost/asio/timer3.cpp
trunk/dsim/test/boost/asio/timer4.cpp
trunk/dsim/test/boost/asio/timer5.cpp
trunk/dsim/test/boost/mpi/
trunk/dsim/test/boost/mpi/Makefile.am
trunk/dsim/test/boost/mpi/mpi.cpp
trunk/dsim/test/boost/mpi/pympi.py
trunk/dsim/test/boost/mpl/
trunk/dsim/test/boost/mpl/Makefile.am
trunk/dsim/test/boost/mpl/mpl.cpp
trunk/dsim/test/boost/mpl/test_mpl.sh
trunk/dsim/test/boost/serialization/
trunk/dsim/test/boost/serialization/Makefile.am
trunk/dsim/test/boost/serialization/serial1.cpp
trunk/dsim/test/boost/signals/
trunk/dsim/test/boost/signals/Makefile.am
trunk/dsim/test/boost/signals/multislots.cpp
trunk/dsim/test/boost/spirit/
trunk/dsim/test/boost/spirit/Makefile.am
trunk/dsim/test/boost/spirit/full_calculator.cpp
trunk/dsim/test/boost/spirit/levenshtein.cpp
trunk/dsim/test/boost/spirit/levenshtein_new.cpp
trunk/dsim/test/boost/spirit/parameter_parser.cpp
trunk/dsim/test/boost/spirit/schedule_parser.cpp
trunk/dsim/test/boost/spirit/search_string_parser.cpp
trunk/dsim/test/boost/spirit/test_full_calculator.sh
trunk/dsim/test/boost/spirit/test_parameter_parser.sh
trunk/dsim/test/boost/spirit/test_schedule_parser.sh
trunk/dsim/test/boost/spirit/world_schedule.csv
Modified: trunk/dsim/Makefile.am
===================================================================
--- trunk/dsim/Makefile.am 2009-12-24 16:05:27 UTC (rev 20)
+++ trunk/dsim/Makefile.am 2009-12-26 01:40:41 UTC (rev 21)
@@ -25,7 +25,7 @@
EXTRA_DIST =
# Build in these directories:
-SUBDIRS = stdair trademgen airsched airinv simcrs rmol $(TEST_DIR)
+SUBDIRS = stdair trademgen airsched airinv simcrs rmol dsim $(TEST_DIR)
# Configuration helpers
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-24 16:05:27 UTC (rev 20)
+++ trunk/dsim/configure.ac 2009-12-26 01:40:41 UTC (rev 21)
@@ -464,6 +464,17 @@
dsim/core/Makefile
dsim/batches/Makefile
test/Makefile
+ test/boost/Makefile
+ test/boost/accumulators/Makefile
+ test/boost/asio/Makefile
+ test/boost/asio/httpd/Makefile
+ test/boost/asio/logd/Makefile
+ test/boost/asio/logger/Makefile
+ test/boost/mpi/Makefile
+ test/boost/mpl/Makefile
+ test/boost/spirit/Makefile
+ test/boost/serialization/Makefile
+ test/boost/signals/Makefile
)
AC_OUTPUT
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-24 16:05:27 UTC (rev 20)
+++ trunk/dsim/test/Makefile.am 2009-12-26 01:40:41 UTC (rev 21)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS =
+SUBDIRS = boost
##
check_PROGRAMS = simulate
Property changes on: trunk/dsim/test/boost
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
Added: trunk/dsim/test/boost/Makefile.am
===================================================================
--- trunk/dsim/test/boost/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/Makefile.am 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,9 @@
+## test/boost sub-directory
+include $(top_srcdir)/Makefile.common
+
+##
+SUBDIRS = accumulators asio mpi mpl serialization signals spirit
+
+MAINTAINERCLEANFILES = Makefile.in
+
+EXTRA_DIST =
Property changes on: trunk/dsim/test/boost/accumulators
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
accu
Added: trunk/dsim/test/boost/accumulators/Makefile.am
===================================================================
--- trunk/dsim/test/boost/accumulators/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/accumulators/Makefile.am 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,21 @@
+## test/architecture sub-directory
+include $(top_srcdir)/Makefile.common
+
+MAINTAINERCLEANFILES = Makefile.in
+
+##
+SUBDIRS =
+
+EXTRA_DIST =
+##
+
+check_PROGRAMS = accu
+#TESTS = $(check_PROGRAMS)
+TESTS =
+XFAIL_TESTS = #IndexBuildingTestSuite
+
+accu_SOURCES = accu.cpp
+accu_CXXFLAGS= $(BOOST_CFLAGS)
+accu_LDFLAGS = $(BOOST_LIBS)
+accu_LDADD =
+
Added: trunk/dsim/test/boost/accumulators/accu.cpp
===================================================================
--- trunk/dsim/test/boost/accumulators/accu.cpp (rev 0)
+++ trunk/dsim/test/boost/accumulators/accu.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,171 @@
+// STL
+#include <iostream>
+#include <algorithm>
+// Boost
+#include <boost/ref.hpp>
+#include <boost/bind.hpp>
+#include <boost/array.hpp>
+#include <boost/foreach.hpp>
+// Boost Accumulators
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+
+// using namespace boost;
+namespace boostacc = boost::accumulators;
+
+// Helper that uses BOOST_FOREACH to display a range of doubles
+template<typename Range>
+void output_range(Range const &rng) {
+ bool first = true;
+ BOOST_FOREACH(double d, rng) {
+ if(!first) std::cout << ", ";
+ std::cout << d;
+ first = false;
+ }
+ std::cout << '\n';
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// example1
+//
+// Calculate some useful stats using accumulator_set<> and std::for_each()
+//
+void example1() {
+ boostacc::accumulator_set<double,
+ boostacc::stats<boostacc::tag::min,
+ boostacc::tag::mean(boostacc::immediate),
+ boostacc::tag::sum,
+ boostacc::tag::moment<2> > > acc;
+
+ boost::array<double, 4> data = {0., 1., -1., 3.14159};
+
+ // std::for_each pushes each sample into the accumulator one at a
+ // time, and returns a copy of the accumulator.
+ acc = std::for_each(data.begin(), data.end(), acc);
+
+ // The following would be equivalent, and could be more efficient
+ // because it doesn't pass and return the entire accumulator set
+ // by value.
+ //std::for_each(data.begin(), data.end(), bind<void>(ref(acc), _1));
+
+ std::cout << " min(acc) = " << (boostacc::min)(acc) << std::endl;
+ std::cout << " mean(acc) = " << boostacc::mean(acc) << std::endl;
+
+ // since mean depends on count and sum, we can get their results, too.
+ std::cout << " count(acc) = " << boostacc::count(acc) << std::endl;
+ std::cout << " sum(acc) = " << boostacc::sum(acc) << std::endl;
+ std::cout << " moment<2>(acc) = " << boostacc::moment<2>(acc) << std::endl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// example2
+//
+// Calculate some tail statistics. This demonstrates how to specify
+// constructor and accumulator parameters. Note that the tail statistics
+// return multiple values, which are returned in an iterator_range.
+//
+// It pushes data in and displays the intermediate results to demonstrate
+// how the tail statistics are updated.
+void example2() {
+ // An accumulator which tracks the right tail (largest N items) and
+ // some data that are covariate with them. N == 4.
+ boostacc::accumulator_set<double,
+ boostacc::stats<
+ boostacc::tag::tail_variate<double,
+ boostacc::tag::covariate1, boostacc::right> > > acc (boostacc::tag::tail<boostacc::right>::cache_size = 4);
+
+ acc(2.1, boostacc::covariate1 = .21);
+ acc(1.1, boostacc::covariate1 = .11);
+ acc(2.1, boostacc::covariate1 = .21);
+ acc(1.1, boostacc::covariate1 = .11);
+
+ std::cout << " tail = "; output_range(boostacc::tail(acc));
+ std::cout << " tail_variate = "; output_range(boostacc::tail_variate(acc));
+ std::cout << std::endl;
+
+ acc(21.1, boostacc::covariate1 = 2.11);
+ acc(11.1, boostacc::covariate1 = 1.11);
+ acc(21.1, boostacc::covariate1 = 2.11);
+ acc(11.1, boostacc::covariate1 = 1.11);
+
+ std::cout << " tail = "; output_range(boostacc::tail(acc));
+ std::cout << " tail_variate = "; output_range(boostacc::tail_variate(acc));
+ std::cout << std::endl;
+
+ acc(42.1, boostacc::covariate1 = 4.21);
+ acc(41.1, boostacc::covariate1 = 4.11);
+ acc(42.1, boostacc::covariate1 = 4.21);
+ acc(41.1, boostacc::covariate1 = 4.11);
+
+ std::cout << " tail = "; output_range(boostacc::tail(acc));
+ std::cout << " tail_variate = "; output_range(boostacc::tail_variate(acc));
+ std::cout << std::endl;
+
+ acc(32.1, boostacc::covariate1 = 3.21);
+ acc(31.1, boostacc::covariate1 = 3.11);
+ acc(32.1, boostacc::covariate1 = 3.21);
+ acc(31.1, boostacc::covariate1 = 3.11);
+
+ std::cout << " tail = "; output_range(boostacc::tail(acc));
+ std::cout << " tail_variate = "; output_range(boostacc::tail_variate(acc));
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// example3
+//
+// Demonstrate how to calculate weighted statistics. This example demonstrates
+// both a simple weighted statistical calculation, and a more complicated
+// calculation where the weight statistics are calculated and stored in an
+// external weight accumulataor.
+void example3() {
+ // weight == double
+ double w = 1.;
+
+ // Simple weighted calculation
+ {
+ // stats that depend on the weight are made external
+ boostacc::accumulator_set<double,
+ boostacc::stats<boostacc::tag::mean>, double> acc;
+
+ acc(0., boostacc::weight = w);
+ acc(1., boostacc::weight = w);
+ acc(-1., boostacc::weight = w);
+ acc(3.14159, boostacc::weight = w);
+
+ std::cout << " mean(acc) = " << boostacc::mean(acc) << std::endl;
+ }
+
+ // Weighted calculation with an external weight accumulator
+ {
+ // stats that depend on the weight are made external
+ boostacc::accumulator_set<double, boostacc::stats<boostacc::tag::mean>,
+ boostacc::external<double> > acc;
+
+ // Here's an external weight accumulator
+ boostacc::accumulator_set<void, boostacc::stats<boostacc::tag::sum_of_weights>, double> weight_acc;
+
+ weight_acc(boostacc::weight = w); acc(0., boostacc::weight = w);
+ weight_acc(boostacc::weight = w); acc(1., boostacc::weight = w);
+ weight_acc(boostacc::weight = w); acc(-1., boostacc::weight = w);
+ weight_acc(boostacc::weight = w); acc(3.14159, boostacc::weight = w);
+
+ std::cout << " mean(acc) = "
+ << boostacc::mean(acc, boostacc::weights = weight_acc)
+ << std::endl;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// main
+int main (int argc, char* argv[]) {
+ std::cout << "Example 1:" << std::endl;
+ example1();
+
+ std::cout << std::endl << "Example 2:" << std::endl;
+ example2();
+
+ std::cout << std::endl << "Example 3:" << std::endl;
+ example3();
+
+ return 0;
+}
Property changes on: trunk/dsim/test/boost/asio
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
daytime1
daytime2
daytime3
daytime4
daytime5
daytime6
daytime7
timer1
timer2
timer3
timer4
timer5
Added: trunk/dsim/test/boost/asio/Makefile.am
===================================================================
--- trunk/dsim/test/boost/asio/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/asio/Makefile.am 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,72 @@
+## test/asio sub-directory
+include $(top_srcdir)/Makefile.common
+
+##
+SUBDIRS = logger logd httpd
+
+MAINTAINERCLEANFILES = Makefile.in
+
+check_PROGRAMS = timer1 timer2 timer3 timer4 timer5 \
+ daytime1 daytime2 daytime3 daytime4 daytime5 daytime6 daytime7
+
+timer1_SOURCES = timer1.cpp
+timer1_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+timer1_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+timer1_LDADD =
+
+timer2_SOURCES = timer2.cpp
+timer2_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+timer2_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+timer2_LDADD =
+
+timer3_SOURCES = timer3.cpp
+timer3_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+timer3_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+timer3_LDADD =
+
+timer4_SOURCES = timer4.cpp
+timer4_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+timer4_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+timer4_LDADD =
+
+timer5_SOURCES = timer5.cpp
+timer5_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+timer5_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+timer5_LDADD =
+
+daytime1_SOURCES = daytime1.cpp
+daytime1_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime1_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime1_LDADD =
+
+daytime2_SOURCES = daytime2.cpp
+daytime2_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime2_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime2_LDADD =
+
+daytime3_SOURCES = daytime3.cpp
+daytime3_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime3_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime3_LDADD =
+
+daytime4_SOURCES = daytime4.cpp
+daytime4_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime4_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime4_LDADD =
+
+daytime5_SOURCES = daytime5.cpp
+daytime5_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime5_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime5_LDADD =
+
+daytime6_SOURCES = daytime6.cpp
+daytime6_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime6_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime6_LDADD =
+
+daytime7_SOURCES = daytime7.cpp
+daytime7_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+daytime7_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+daytime7_LDADD =
+
+EXTRA_DIST =
Added: trunk/dsim/test/boost/asio/daytime1.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime1.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime1.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,82 @@
+// Boost.ASIO Tutorial - Daytime1:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime1.html
+// STL
+#include <iostream>
+#include <string>
+// Boost.ASIO
+#include <boost/asio.hpp>
+#include <boost/array.hpp>
+
+// /////////// M A I N ////////////////
+int main (int argc, char* argv[]) {
+
+ // Host name
+ std::string lHostname = "localhost";
+
+ // Service name (as specified within /etc/services)
+ // The "aria" service corresponds to the port 2624
+ const std::string lServiceName = "aria";
+
+ try {
+
+ if (argc >= 2) {
+ lHostname = argv[1];
+ }
+
+ boost::asio::io_service lIOService;
+
+ boost::asio::ip::tcp::resolver lResolver (lIOService);
+
+ boost::asio::ip::tcp::resolver::query lQuery (lHostname, lServiceName);
+
+ boost::asio::ip::tcp::resolver::iterator itEndPoint =
+ lResolver.resolve (lQuery);
+ boost::asio::ip::tcp::resolver::iterator lEnd;
+
+ boost::asio::ip::tcp::socket lSocket (lIOService);
+ boost::system::error_code lError = boost::asio::error::host_not_found;
+
+ while (lError && itEndPoint != lEnd) {
+ const boost::asio::ip::tcp::endpoint lEndPoint = *itEndPoint;
+
+ // DEBUG
+ std::cout << "Testing end point: " << std::endl;
+
+ lSocket.close();
+ lSocket.connect (lEndPoint, lError);
+ ++itEndPoint;
+ }
+
+ if (lError) {
+ throw boost::system::system_error (lError);
+ }
+ assert (!lError);
+
+ // DEBUG
+ const boost::asio::ip::tcp::endpoint lValidEndPoint;
+ std::cout << "Valid end point: " << lValidEndPoint << std::endl;
+
+ for (;;) {
+ boost::array<char, 128> lBuffer;
+ boost::system::error_code lError;
+
+ size_t lLength = lSocket.read_some (boost::asio::buffer (lBuffer), lError);
+
+ if (lError == boost::asio::error::eof) {
+ // Connection closed cleanly by peer.
+ break;
+
+ } else if (lError) {
+ // Some other error.
+ throw boost::system::system_error (lError);
+ }
+
+ std::cout.write (lBuffer.data(), lLength);
+ }
+
+ } catch (std::exception& lException) {
+ std::cerr << lException.what() << std::endl;
+ }
+
+ return 0;
+}
Added: trunk/dsim/test/boost/asio/daytime2.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime2.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime2.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,46 @@
+// Boost.ASIO Tutorial - Daytime2:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime2.html
+// STL
+#include <iostream>
+#include <string>
+#include <ctime>
+// Boost.ASIO
+#include <iostream>
+#include <boost/asio.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+// //////////////////////////////////////////////////////////
+std::string make_daytime_string() {
+ const std::time_t now = std::time(0);
+ return std::ctime (&now);
+}
+
+// //////////////////// M A I N /////////////////////////////
+int main (int argc, char* argv[]) {
+
+ try {
+
+ boost::asio::io_service lIOService;
+
+ // Create a listener for IP/TCP v4, listening on port 2624 (corresponding
+ // to the "aria" service, as specified within the /etc/services file)
+ boost::asio::ip::tcp::acceptor lAcceptor (lIOService,
+ boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), 2624));
+
+ for (;;) {
+ boost::asio::ip::tcp::socket lSocket (lIOService);
+ lAcceptor.accept (lSocket);
+ const std::string lMessage = make_daytime_string();
+
+ boost::system::error_code lIgnoredError;
+ boost::asio::write (lSocket, boost::asio::buffer (lMessage),
+ boost::asio::transfer_all(), lIgnoredError);
+ }
+
+ } catch (std::exception& lException) {
+ std::cerr << lException.what() << std::endl;
+ }
+
+ return 0;
+}
+
Added: trunk/dsim/test/boost/asio/daytime3.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime3.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime3.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,145 @@
+// Boost.ASIO Tutorial - Daytime3:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime3.html
+// STL
+#include <cassert>
+#include <ctime>
+#include <iostream>
+#include <string>
+// Boost.ASIO
+#include <iostream>
+#include <boost/asio.hpp>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+// //////////////////////////////////////////////////////////
+std::string make_daytime_string() {
+ const std::time_t now = std::time(0);
+ return std::ctime (&now);
+}
+
+// //////////////////////////////////////////////////////////
+/** Class handling TCP connections for a given server. */
+class TCPConnection :
+ public boost::enable_shared_from_this<TCPConnection> {
+public:
+ /** Pointer on a TCP connection. */
+ typedef boost::shared_ptr<TCPConnection> Pointer_T;
+
+ /** Create a TCP connection, from a given Boost.ASIO service. */
+ static Pointer_T create (boost::asio::io_service& ioIOService) {
+ TCPConnection* oConnectionPtr = new TCPConnection (ioIOService);
+ assert (oConnectionPtr != NULL);
+ return Pointer_T (oConnectionPtr);
+ }
+
+ /** Get the underlying TCP socket. */
+ boost::asio::ip::tcp::socket& socket() {
+ return _socket;
+ }
+
+ /** Process the incoming client request, by giving it back the time of day. */
+ void start() {
+
+ _message = make_daytime_string();
+
+ boost::system::error_code lIgnoredError;
+ boost::asio::async_write (_socket, boost::asio::buffer (_message),
+ boost::bind (&TCPConnection::handleWrite,
+ shared_from_this(),
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred));
+ }
+
+
+private:
+ // //////////// Constructors & Destructors /////////////
+ /** Constructor. */
+ TCPConnection (boost::asio::io_service& ioIOService)
+ : _socket (ioIOService) {
+ }
+
+ void handleWrite (const boost::system::error_code& iErrorCode,
+ const size_t iTransferredBytes) {
+ }
+
+
+private:
+ // ///////////////// Technical Methods ///////////////////
+
+
+private:
+ // /////////// Attributes /////////////
+ /** Time of day. */
+ std::string _message;
+
+ /** TCP/IP socket. */
+ boost::asio::ip::tcp::socket _socket;
+};
+
+
+/** Class starting a TCP server, and handling incoming requests. */
+class TCPServer {
+public:
+ // //////////// Constructors & Destructors /////////////
+ /** Constructor.
+ <br>Create a listener for IP/TCP v4, listening on port 2624 (corresponding
+ to the "aria" service, as specified within the /etc/services file) */
+ TCPServer (boost::asio::io_service& ioIOService)
+ : _acceptor (ioIOService,
+ boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(),
+ 2624)) {
+ startAccept();
+ }
+
+
+private:
+ // ///////////////// Technical Methods ///////////////////
+ /** Accept (socket) connection from any client. */
+ void startAccept() {
+ TCPConnection::Pointer_T lConnection =
+ TCPConnection::create (_acceptor.io_service());
+
+ boost::asio::ip::tcp::socket& lSocket = lConnection->socket();
+ _acceptor.async_accept (lSocket,
+ boost::bind (&TCPServer::handleAccept, this,
+ lConnection,
+ boost::asio::placeholders::error));
+ }
+
+ /** Process the (socket) connection from any client. */
+ void handleAccept (TCPConnection::Pointer_T ioConnection,
+ const boost::system::error_code& iError) {
+
+ if (!iError) {
+ ioConnection->start();
+ startAccept();
+ }
+ }
+
+
+private:
+ // /////////// Attributes /////////////
+ /** Connection acceptor. */
+ boost::asio::ip::tcp::acceptor _acceptor;
+};
+
+
+// //////////////////// M A I N /////////////////////////////
+int main (int argc, char* argv[]) {
+
+ try {
+
+ boost::asio::io_service lIOService;
+ TCPServer lServer (lIOService);
+
+ lIOService.run();
+
+ } catch (std::exception& lException) {
+ std::cerr << lException.what() << std::endl;
+ }
+
+ return 0;
+}
+
Added: trunk/dsim/test/boost/asio/daytime4.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime4.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime4.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,17 @@
+// Boost.ASIO Tutorial - Daytime4:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime4.html
+// STL
+#include <iostream>
+// Boost.ASIO
+#include <boost/asio.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+// /////////// M A I N ////////////////
+int main (int argc, char* argv[]) {
+
+ boost::asio::io_service lIOService;
+
+ std::cout << "We have waited 1 second" << std::endl;
+
+ return 0;
+}
Added: trunk/dsim/test/boost/asio/daytime5.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime5.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime5.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,17 @@
+// Boost.ASIO Tutorial - Daytime5:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime5.html
+// STL
+#include <iostream>
+// Boost.ASIO
+#include <boost/asio.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+// /////////// M A I N ////////////////
+int main (int argc, char* argv[]) {
+
+ boost::asio::io_service lIOService;
+
+ std::cout << "We have waited 1 second" << std::endl;
+
+ return 0;
+}
Added: trunk/dsim/test/boost/asio/daytime6.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime6.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime6.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,17 @@
+// Boost.ASIO Tutorial - Daytime6:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime6.html
+// STL
+#include <iostream>
+// Boost.ASIO
+#include <boost/asio.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+// /////////// M A I N ////////////////
+int main (int argc, char* argv[]) {
+
+ boost::asio::io_service lIOService;
+
+ std::cout << "We have waited 1 second" << std::endl;
+
+ return 0;
+}
Added: trunk/dsim/test/boost/asio/daytime7.cpp
===================================================================
--- trunk/dsim/test/boost/asio/daytime7.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/daytime7.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,17 @@
+// Boost.ASIO Tutorial - Daytime7:
+// http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tutdaytime7.html
+// STL
+#include <iostream>
+// Boost.ASIO
+#include <boost/asio.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+// /////////// M A I N ////////////////
+int main (int argc, char* argv[]) {
+
+ boost::asio::io_service lIOService;
+
+ std::cout << "We have waited 1 second" << std::endl;
+
+ return 0;
+}
Property changes on: trunk/dsim/test/boost/asio/httpd
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
httpd_server
Added: trunk/dsim/test/boost/asio/httpd/Makefile.am
===================================================================
--- trunk/dsim/test/boost/asio/httpd/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/asio/httpd/Makefile.am 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,17 @@
+## test/asio/httpd sub-directory
+include $(top_srcdir)/Makefile.common
+
+MAINTAINERCLEANFILES = Makefile.in
+
+check_PROGRAMS = httpd_server
+
+httpd_server_SOURCES = \
+ header.hpp connection.hpp mime_types.hpp reply.hpp request.hpp \
+ request_handler.hpp request_parser.hpp server.hpp \
+ mime_types.cpp connection.cpp posix_main.cpp reply.cpp request_handler.cpp \
+ request_parser.cpp server.cpp win_main.cpp
+httpd_server_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+httpd_server_LDFLAGS = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) $(BOOST_ASIO_LIB)
+httpd_server_LDADD =
+
+EXTRA_DIST =
Added: trunk/dsim/test/boost/asio/httpd/connection.cpp
===================================================================
--- trunk/dsim/test/boost/asio/httpd/connection.cpp (rev 0)
+++ trunk/dsim/test/boost/asio/httpd/connection.cpp 2009-12-26 01:40:41 UTC (rev 21)
@@ -0,0 +1,87 @@
+//
+// connection.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "connection.hpp"
+#include <vector>
+#include <boost/bind.hpp>
+#include "request_handler.hpp"
+
+namespace http {
+
+ namespace server3 {
+
+ connection::connection(boost::asio::io_service& io_service,
+ request_handler& handler)
+ : strand_(io_service),
+ socket_(io_service),
+ request_handler_(handler) {
+ }
+
+ boost::asio::ip::tcp::socket...
[truncated message content] |
|
From: <den...@us...> - 2009-12-28 15:16:34
|
Revision: 25
http://dsim.svn.sourceforge.net/dsim/?rev=25&view=rev
Author: denis_arnaud
Date: 2009-12-28 15:16:19 +0000 (Mon, 28 Dec 2009)
Log Message:
-----------
[Conf] Suppressed useless dependencies on SOCI and MySQL.
Modified Paths:
--------------
trunk/dsim/config/mysql.m4
trunk/dsim/config/soci.m4
trunk/dsim/configure.ac
trunk/dsim/dsim/bom/Makefile.am
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/config/mysql.m4
===================================================================
--- trunk/dsim/config/mysql.m4 2009-12-28 10:52:19 UTC (rev 24)
+++ trunk/dsim/config/mysql.m4 2009-12-28 15:16:19 UTC (rev 25)
@@ -113,10 +113,10 @@
AC_MSG_RESULT([$MYSQL_libdir])
- case "$MYSQL_libdir" in
- /usr/lib) ;;
- *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;;
- esac
+# case "$MYSQL_libdir" in
+# /usr/lib) ;;
+# *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;;
+# esac
#
# Look for MySQL C API headers
Modified: trunk/dsim/config/soci.m4
===================================================================
--- trunk/dsim/config/soci.m4 2009-12-28 10:52:19 UTC (rev 24)
+++ trunk/dsim/config/soci.m4 2009-12-28 15:16:19 UTC (rev 25)
@@ -79,10 +79,10 @@
AC_MSG_RESULT([$SOCI_libdir])
- case "$SOCI_libdir" in
- /usr/lib) ;;
- *) LDFLAGS="$LDFLAGS -L${SOCI_libdir}" ;;
- esac
+# case "$SOCI_libdir" in
+# /usr/lib) ;;
+# *) LDFLAGS="$LDFLAGS -L${SOCI_libdir}" ;;
+# esac
#
@@ -119,8 +119,8 @@
then
SOCI_LIBS="-L${SOCI_libdir}"
fi
- SOCI_CFLAGS="-DSOCI_HEADERS_BURIED -DSOCI_MYSQL_HEADERS_BURIED $SOCI_CFLAGS"
- SOCI_LIBS="$SOCI_LIBS -l${SOCI_CORE_LIB} -l${SOCI_MYSQL_LIB} -ldl"
+ SOCI_CFLAGS="-DSOCI_HEADERS_BURIED -DSOCI_MYSQL_HEADERS_BURIED ${MYSQL_CFLAGS} ${SOCI_CFLAGS}"
+ SOCI_LIBS="${MYSQL_LIBS} ${SOCI_LIBS} -l${SOCI_CORE_LIB} -l${SOCI_MYSQL_LIB} -ldl"
AC_SUBST(SOCI_CFLAGS)
AC_SUBST(SOCI_LIBS)
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-28 10:52:19 UTC (rev 24)
+++ trunk/dsim/configure.ac 2009-12-28 15:16:19 UTC (rev 25)
@@ -475,6 +475,7 @@
test/boost/spirit/Makefile
test/boost/serialization/Makefile
test/boost/signals/Makefile
+ test/rmol/Makefile
)
AC_OUTPUT
Modified: trunk/dsim/dsim/bom/Makefile.am
===================================================================
--- trunk/dsim/dsim/bom/Makefile.am 2009-12-28 10:52:19 UTC (rev 24)
+++ trunk/dsim/dsim/bom/Makefile.am 2009-12-28 15:16:19 UTC (rev 25)
@@ -5,8 +5,8 @@
noinst_LTLIBRARIES= libbom.la
libbom_la_SOURCES= $(bom_h_sources) $(bom_cc_sources)
-libbom_la_CXXFLAGS = $(GSL_CFLAGS)
-libbom_la_LDFLAGS = $(GSL_LIBS)
+libbom_la_CXXFLAGS =
+libbom_la_LDFLAGS =
#pkgincludedir = $(includedir)/@PACKAGE@/bom
#pkginclude_HEADERS = $(bom_h_sources)
Property changes on: trunk/dsim/test
___________________________________________________________________
Added: svn:externals
+ rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-28 10:52:19 UTC (rev 24)
+++ trunk/dsim/test/Makefile.am 2009-12-28 15:16:19 UTC (rev 25)
@@ -17,12 +17,12 @@
#SimulationTestSuite_LDADD = $(top_builddir)/test/com/libcppunitcore.la
#SimulationTestSuite_LDFLAGS = \
# $(BOOST_LIBS) $(CPPUNIT_LIBS) \
-# $(top_builddir)/@PACKAGE@/lib@PACKAGE@.la
+# $(top_builddir)/dsim/libdsim.la
simulate_SOURCES = simulate.cpp
simulate_CXXFLAGS= $(CPPUNIT_CFLAGS) $(BOOST_CFLAGS)
simulate_LDADD =
simulate_LDFLAGS = $(BOOST_LIBS) \
- $(top_builddir)/@PACKAGE@/core/lib@PACKAGE@.la
+ $(top_builddir)/dsim/core/libdsim.la
EXTRA_DIST =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2009-12-28 18:24:20
|
Revision: 26
http://dsim.svn.sourceforge.net/dsim/?rev=26&view=rev
Author: denis_arnaud
Date: 2009-12-28 18:24:08 +0000 (Mon, 28 Dec 2009)
Log Message:
-----------
[Test] Activated the embedded ExtraCC library, and added the RMOL test sub-directory.
Modified Paths:
--------------
trunk/dsim/Makefile.am
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/
Property changes on: trunk/dsim
___________________________________________________________________
Modified: svn:externals
- stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/stdair
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/trademgen
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/airsched
avlcal https://avlcal.svn.sourceforge.net/svnroot/avlcal/trunk/avlcal/avlcal
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/airinv
simfqt https://simfqt.svn.sourceforge.net/svnroot/simfqt/trunk/simfqt/simfqt
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/simcrs
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/rmol
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/travelccm
+ stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/stdair
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/trademgen
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/airsched
avlcal https://avlcal.svn.sourceforge.net/svnroot/avlcal/trunk/avlcal/avlcal
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/airinv
simfqt https://simfqt.svn.sourceforge.net/svnroot/simfqt/trunk/simfqt/simfqt
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/simcrs
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/rmol
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/travelccm
extracppunit https://extracc.svn.sourceforge.net/svnroot/extracc/trunk/extracc/extracppunit
Modified: trunk/dsim/Makefile.am
===================================================================
--- trunk/dsim/Makefile.am 2009-12-28 15:16:19 UTC (rev 25)
+++ trunk/dsim/Makefile.am 2009-12-28 18:24:08 UTC (rev 26)
@@ -25,7 +25,8 @@
EXTRA_DIST =
# Build in these directories:
-SUBDIRS = stdair trademgen airsched airinv simcrs rmol dsim $(TEST_DIR)
+SUBDIRS = stdair trademgen airsched airinv simcrs rmol dsim \
+ extracppunit $(TEST_DIR)
# Configuration helpers
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-28 15:16:19 UTC (rev 25)
+++ trunk/dsim/configure.ac 2009-12-28 18:24:08 UTC (rev 26)
@@ -141,7 +141,11 @@
# -----------------------------------------------------------------------------
# Support for ExtraCC (Extra-CruiseControl): http://sf.net/projects/extracc
# -----------------------------------------------------------------------------
-AM_PATH_EXTRACC
+# Note: the ExtraCC is now imported as a Subversion external reference,
+# thus directly accessible within the extracppunit directory.
+# When that library will be widely avaible on Linux distributions,
+# the external reference can be removed and the following line uncommented.
+#AM_PATH_EXTRACC
#AC_SUBST(EXTRACC_VERSION)
#AC_SUBST(EXTRACC_CFLAGS)
#AC_SUBST(EXTRACC_LIBS)
@@ -199,14 +203,6 @@
AC_SUBST(BOOST_MPI_PYTHON_LIB)
# --------------------------------------------------------------------
-# Support for MySQL++ (C++ client API): http://tangentsoft.net/mysql++
-# --------------------------------------------------------------------
-AX_MYSQLPP
-AC_SUBST(MYSQLPP_VERSION)
-AC_SUBST(MYSQLPP_CFLAGS)
-AC_SUBST(MYSQLPP_LIBS)
-
-# --------------------------------------------------------------------
# Support for SOCI http://soci.sourceforge.net
# --------------------------------------------------------------------
AX_SOCI
@@ -217,18 +213,22 @@
# --------------------------------------------------------------------
# Support for TRAVEL-CCM (CCM Open Library): http://sf.net/projects/travel-ccm
# --------------------------------------------------------------------
-AM_PATH_TRAVELCCM
-AC_SUBST(TRAVELCCM_VERSION)
-AC_SUBST(TRAVELCCM_CFLAGS)
-AC_SUBST(TRAVELCCM_LIBS)
+# Note: That library is imported as a Subversion external reference. So, there is
+# no need to import it as an independent library as well.
+#AM_PATH_TRAVELCCM
+#AC_SUBST(TRAVELCCM_VERSION)
+#AC_SUBST(TRAVELCCM_CFLAGS)
+#AC_SUBST(TRAVELCCM_LIBS)
# --------------------------------------------------------------------
# Support for RMOL (RM Open Library): http://sf.net/projects/rmol
# --------------------------------------------------------------------
-AM_PATH_RMOL([0.19])
-AC_SUBST(RMOL_VERSION)
-AC_SUBST(RMOL_CFLAGS)
-AC_SUBST(RMOL_LIBS)
+# Note: That library is imported as a Subversion external reference. So, there is
+# no need to import it as an independent library as well.
+#AM_PATH_RMOL([0.19])
+#AC_SUBST(RMOL_VERSION)
+#AC_SUBST(RMOL_CFLAGS)
+#AC_SUBST(RMOL_LIBS)
# ============ X E R C E S ==================
AX_XERCES_C
@@ -238,14 +238,6 @@
#
AC_CHECK_LIBRT
-# -----------------------------------------------------------
-# Xapian (Indexing & Search API: http://www.xapian.org
-# -----------------------------------------------------------
-XO_LIB_XAPIAN
-AC_SUBST(XAPIAN_VERSION)
-AC_SUBST(XAPIAN_CFLAGS)
-AC_SUBST(XAPIAN_LIBS)
-
# -------------------------------------------------------------------
# Support for documentation
# -------------------------------------------------------------------
@@ -463,6 +455,7 @@
dsim/config/Makefile
dsim/core/Makefile
dsim/batches/Makefile
+ extracppunit/Makefile
test/Makefile
test/boost/Makefile
test/boost/accumulators/Makefile
@@ -561,11 +554,6 @@
o MYSQL_CFLAGS .... : ${MYSQL_CFLAGS}
o MYSQL_LIBS ...... : ${MYSQL_LIBS}
- - MySQL++ ........... :
- o MYSQLPP_version . : ${MYSQLPP_VERSION}
- o MYSQLPP_CFLAGS .. : ${MYSQLPP_CFLAGS}
- o MYSQLPP_LIBS .... : ${MYSQLPP_LIBS}
-
- SOCI .............. :
o SOCI_version .... : ${SOCI_VERSION}
o SOCI_CFLAGS ..... : ${SOCI_CFLAGS}
@@ -576,26 +564,6 @@
o XERCES_CFLAGS ... : ${XERCES_CFLAGS}
o XERCES_LIBS ..... : ${XERCES_LIBS}
- - EXTRACC ........... :
- o EXTRACC_VERSION . : ${EXTRACC_VERSION}
- o EXTRACC_CFLAGS .. : ${EXTRACC_CFLAGS}
- o EXTRACC_LIBS .... : ${EXTRACC_LIBS}
-
- - TRAVELCCM ......... :
- o TRAVELCCM_VERSION : ${TRAVELCCM_VERSION}
- o TRAVELCCM_CFLAGS : ${TRAVELCCM_CFLAGS}
- o TRAVELCCM_LIBS .. : ${TRAVELCCM_LIBS}
-
- - RMOL .............. :
- o RMOL_VERSION .... : ${RMOL_VERSION}
- o RMOL_CFLAGS ..... : ${RMOL_CFLAGS}
- o RMOL_LIBS ....... : ${RMOL_LIBS}
-
- - XAPIAN ............ :
- o XAPIAN_VERSION .. : ${XAPIAN_VERSION}
- o XAPIAN_CFLAGS ... : ${XAPIAN_CFLAGS}
- o XAPIAN_LIBS ..... : ${XAPIAN_LIBS}
-
- CPPUNIT............ :
o CPPUNIT_VERSION . : ${CPPUNIT_VERSION}
o CPPUNIT_CFLAGS .. : ${CPPUNIT_CFLAGS}
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-28 15:16:19 UTC (rev 25)
+++ trunk/dsim/test/Makefile.am 2009-12-28 18:24:08 UTC (rev 26)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost
+SUBDIRS = boost rmol
##
check_PROGRAMS = simulate
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:34:22
|
Revision: 29
http://dsim.svn.sourceforge.net/dsim/?rev=29&view=rev
Author: denis_arnaud
Date: 2009-12-29 13:34:09 +0000 (Tue, 29 Dec 2009)
Log Message:
-----------
[Test] Added the tests on the Airline Schedule Manager (airsched) library.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-29 13:19:34 UTC (rev 28)
+++ trunk/dsim/configure.ac 2009-12-29 13:34:09 UTC (rev 29)
@@ -476,6 +476,7 @@
test/boost/spirit/Makefile
test/boost/serialization/Makefile
test/boost/signals/Makefile
+ test/airsched/Makefile
test/rmol/Makefile
)
AC_OUTPUT
Property changes on: trunk/dsim/test
___________________________________________________________________
Modified: svn:externals
- rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
+ airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-29 13:19:34 UTC (rev 28)
+++ trunk/dsim/test/Makefile.am 2009-12-29 13:34:09 UTC (rev 29)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost rmol
+SUBDIRS = boost airsched rmol
##
check_PROGRAMS = simulate
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2009-12-29 14:14:48
|
Revision: 30
http://dsim.svn.sourceforge.net/dsim/?rev=30&view=rev
Author: denis_arnaud
Date: 2009-12-29 14:14:40 +0000 (Tue, 29 Dec 2009)
Log Message:
-----------
[Test] Added tests for the stdair, airinv and simcrs projects.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-29 13:34:09 UTC (rev 29)
+++ trunk/dsim/configure.ac 2009-12-29 14:14:40 UTC (rev 30)
@@ -476,8 +476,11 @@
test/boost/spirit/Makefile
test/boost/serialization/Makefile
test/boost/signals/Makefile
+ test/stdair/Makefile
test/airsched/Makefile
+ test/airinv/Makefile
test/rmol/Makefile
+ test/simcrs/Makefile
)
AC_OUTPUT
Property changes on: trunk/dsim/test
___________________________________________________________________
Modified: svn:externals
- airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
+ stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://rmol.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://rmol.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-29 13:34:09 UTC (rev 29)
+++ trunk/dsim/test/Makefile.am 2009-12-29 14:14:40 UTC (rev 30)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost airsched rmol
+SUBDIRS = boost stdair airsched airinv rmol simcrs
##
check_PROGRAMS = simulate
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-07-24 16:29:52
|
Revision: 110
http://dsim.svn.sourceforge.net/dsim/?rev=110&view=rev
Author: denis_arnaud
Date: 2010-07-24 16:29:46 +0000 (Sat, 24 Jul 2010)
Log Message:
-----------
[Doc] Updated the tool for document generation (in order to produce PDF documents).
Modified Paths:
--------------
trunk/dsim/Makefile.am
trunk/dsim/doc/Makefile.am
Modified: trunk/dsim/Makefile.am
===================================================================
--- trunk/dsim/Makefile.am 2010-07-24 16:24:03 UTC (rev 109)
+++ trunk/dsim/Makefile.am 2010-07-24 16:29:46 UTC (rev 110)
@@ -74,4 +74,3 @@
upload-tex: dist-tex
@UPLOAD_COMMAND@ @PACKAGE_TARNAME@-tex-@VERSION@.tar.gz \
@PACKAGE_TARNAME@-tex-@VERSION@.tar.bz2
-
Modified: trunk/dsim/doc/Makefile.am
===================================================================
--- trunk/dsim/doc/Makefile.am 2010-07-24 16:24:03 UTC (rev 109)
+++ trunk/dsim/doc/Makefile.am 2010-07-24 16:29:46 UTC (rev 110)
@@ -158,6 +158,13 @@
$(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/html; \
done \
fi
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ if test -d latex; then \
+ $(mkinstalldirs) $(DESTDIR)$(docdir)/latex; \
+ for f in latex/*; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/latex; \
+ done \
+ fi
uninstall-local:
rm -rf $(DESTDIR)$(docdir)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2009-12-29 17:57:15
|
Revision: 32
http://dsim.svn.sourceforge.net/dsim/?rev=32&view=rev
Author: denis_arnaud
Date: 2009-12-29 17:57:04 +0000 (Tue, 29 Dec 2009)
Log Message:
-----------
[Test] Moved the dsim tests into a dedicated directory.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Added Paths:
-----------
trunk/dsim/test/dsim/
trunk/dsim/test/dsim/Makefile.am
trunk/dsim/test/dsim/simulate.cpp
Removed Paths:
-------------
trunk/dsim/test/simulate.cpp
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-29 16:05:42 UTC (rev 31)
+++ trunk/dsim/configure.ac 2009-12-29 17:57:04 UTC (rev 32)
@@ -481,6 +481,7 @@
test/airinv/Makefile
test/rmol/Makefile
test/simcrs/Makefile
+ test/dsim/Makefile
)
AC_OUTPUT
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-29 16:05:42 UTC (rev 31)
+++ trunk/dsim/test/Makefile.am 2009-12-29 17:57:04 UTC (rev 32)
@@ -4,25 +4,11 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost stdair airsched airinv rmol simcrs
+SUBDIRS = boost stdair airsched airinv rmol simcrs dsim
+EXTRA_DIST =
+
##
-check_PROGRAMS = simulate
+check_PROGRAMS =
TESTS = $(check_PROGRAMS)
XFAIL_TESTS = #
-
-#SimulationTestSuite_SOURCES = SimulationTestSuite.hpp \
- SimulationTestSuite.cpp
-#SimulationTestSuite_CXXFLAGS= $(CPPUNIT_CFLAGS) $(BOOST_CFLAGS)
-#SimulationTestSuite_LDADD = $(top_builddir)/test/com/libcppunitcore.la
-#SimulationTestSuite_LDFLAGS = \
-# $(BOOST_LIBS) $(CPPUNIT_LIBS) \
-# $(top_builddir)/dsim/libdsim.la
-
-simulate_SOURCES = simulate.cpp
-simulate_CXXFLAGS= $(CPPUNIT_CFLAGS) $(BOOST_CFLAGS)
-simulate_LDADD =
-simulate_LDFLAGS = $(BOOST_LIBS) \
- $(top_builddir)/dsim/core/libdsim.la
-
-EXTRA_DIST =
Property changes on: trunk/dsim/test/dsim
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
simulate
simulate.log
Copied: trunk/dsim/test/dsim/Makefile.am (from rev 31, trunk/dsim/test/Makefile.am)
===================================================================
--- trunk/dsim/test/dsim/Makefile.am (rev 0)
+++ trunk/dsim/test/dsim/Makefile.am 2009-12-29 17:57:04 UTC (rev 32)
@@ -0,0 +1,28 @@
+## test sub-directory
+include $(top_srcdir)/Makefile.common
+
+MAINTAINERCLEANFILES = Makefile.in
+
+##
+SUBDIRS =
+
+EXTRA_DIST =
+
+##
+check_PROGRAMS = simulate
+TESTS = $(check_PROGRAMS)
+XFAIL_TESTS = #
+
+#SimulationTestSuite_SOURCES = SimulationTestSuite.hpp \
+ SimulationTestSuite.cpp
+#SimulationTestSuite_CXXFLAGS= $(CPPUNIT_CFLAGS) $(BOOST_CFLAGS)
+#SimulationTestSuite_LDADD = $(top_builddir)/test/com/libcppunitcore.la
+#SimulationTestSuite_LDFLAGS = \
+# $(BOOST_LIBS) $(CPPUNIT_LIBS) \
+# $(top_builddir)/dsim/libdsim.la
+
+simulate_SOURCES = simulate.cpp
+simulate_CXXFLAGS= $(CPPUNIT_CFLAGS) $(BOOST_CFLAGS)
+simulate_LDADD =
+simulate_LDFLAGS = $(BOOST_LIBS) \
+ $(top_builddir)/dsim/core/libdsim.la
Copied: trunk/dsim/test/dsim/simulate.cpp (from rev 31, trunk/dsim/test/simulate.cpp)
===================================================================
--- trunk/dsim/test/dsim/simulate.cpp (rev 0)
+++ trunk/dsim/test/dsim/simulate.cpp 2009-12-29 17:57:04 UTC (rev 32)
@@ -0,0 +1,40 @@
+// STL
+#include <cassert>
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <string>
+// DSIM
+#include <dsim/DSIM_Service.hpp>
+#include <dsim/config/dsim-paths.hpp>
+
+// ///////// M A I N ////////////
+int main (int argc, char* argv[]) {
+
+ try {
+
+ // Output log File
+ std::string lLogFilename ("simulate.log");
+
+ // Set the log parameters
+ std::ofstream logOutputFile;
+ // Open and clean the log outputfile
+ logOutputFile.open (lLogFilename.c_str());
+ logOutputFile.clear();
+
+ // Initialise the list of classes/buckets
+ DSIM::DSIM_Service dsimService (logOutputFile);
+
+ // Perform a simulation
+ dsimService.simulate();
+
+ } catch (const std::exception& stde) {
+ std::cerr << "Standard exception: " << stde.what() << std::endl;
+ return -1;
+
+ } catch (...) {
+ return -1;
+ }
+
+ return 0;
+}
Deleted: trunk/dsim/test/simulate.cpp
===================================================================
--- trunk/dsim/test/simulate.cpp 2009-12-29 16:05:42 UTC (rev 31)
+++ trunk/dsim/test/simulate.cpp 2009-12-29 17:57:04 UTC (rev 32)
@@ -1,40 +0,0 @@
-// STL
-#include <cassert>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <string>
-// DSIM
-#include <dsim/DSIM_Service.hpp>
-#include <dsim/config/dsim-paths.hpp>
-
-// ///////// M A I N ////////////
-int main (int argc, char* argv[]) {
-
- try {
-
- // Output log File
- std::string lLogFilename ("simulate.log");
-
- // Set the log parameters
- std::ofstream logOutputFile;
- // Open and clean the log outputfile
- logOutputFile.open (lLogFilename.c_str());
- logOutputFile.clear();
-
- // Initialise the list of classes/buckets
- DSIM::DSIM_Service dsimService (logOutputFile);
-
- // Perform a simulation
- dsimService.simulate();
-
- } catch (const std::exception& stde) {
- std::cerr << "Standard exception: " << stde.what() << std::endl;
- return -1;
-
- } catch (...) {
- return -1;
- }
-
- 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-30 14:25:15
|
Revision: 37
http://dsim.svn.sourceforge.net/dsim/?rev=37&view=rev
Author: denis_arnaud
Date: 2009-12-30 14:25:05 +0000 (Wed, 30 Dec 2009)
Log Message:
-----------
[Struct] Added a dependency (as Subversion external references) on the TraDemGen project.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-30 11:19:01 UTC (rev 36)
+++ trunk/dsim/configure.ac 2009-12-30 14:25:05 UTC (rev 37)
@@ -477,6 +477,7 @@
test/boost/serialization/Makefile
test/boost/signals/Makefile
test/stdair/Makefile
+ test/trademgen/Makefile
test/airsched/Makefile
test/airinv/Makefile
test/rmol/Makefile
Property changes on: trunk/dsim/test
___________________________________________________________________
Modified: svn:externals
- stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://rmol.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://rmol.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
+ stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-30 11:19:01 UTC (rev 36)
+++ trunk/dsim/test/Makefile.am 2009-12-30 14:25:05 UTC (rev 37)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost stdair airsched airinv rmol simcrs dsim
+SUBDIRS = boost stdair trademgen airsched airinv rmol simcrs dsim
EXTRA_DIST =
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:15:08
|
Revision: 39
http://dsim.svn.sourceforge.net/dsim/?rev=39&view=rev
Author: denis_arnaud
Date: 2009-12-30 15:14:59 +0000 (Wed, 30 Dec 2009)
Log Message:
-----------
[Test] Added the (external reference on the) samples directory.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Removed Paths:
-------------
trunk/dsim/test/samples/
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-30 14:34:30 UTC (rev 38)
+++ trunk/dsim/configure.ac 2009-12-30 15:14:59 UTC (rev 39)
@@ -465,6 +465,7 @@
dsim/batches/Makefile
extracppunit/Makefile
test/Makefile
+ test/samples/Makefile
test/boost/Makefile
test/boost/accumulators/Makefile
test/boost/asio/Makefile
Property changes on: trunk/dsim/test
___________________________________________________________________
Modified: svn:externals
- stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
+ samples https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/samples
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-30 14:34:30 UTC (rev 38)
+++ trunk/dsim/test/Makefile.am 2009-12-30 15:14:59 UTC (rev 39)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost stdair trademgen airsched airinv rmol simcrs dsim
+SUBDIRS = boost samples stdair trademgen airsched airinv rmol simcrs dsim
EXTRA_DIST =
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:08:30
|
Revision: 40
http://dsim.svn.sourceforge.net/dsim/?rev=40&view=rev
Author: denis_arnaud
Date: 2009-12-30 16:08:23 +0000 (Wed, 30 Dec 2009)
Log Message:
-----------
[Struct] Added the Travel-CCM project.
Modified Paths:
--------------
trunk/dsim/Makefile.am
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/Makefile.am
===================================================================
--- trunk/dsim/Makefile.am 2009-12-30 15:14:59 UTC (rev 39)
+++ trunk/dsim/Makefile.am 2009-12-30 16:08:23 UTC (rev 40)
@@ -21,11 +21,10 @@
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure \
config-h.in sic/stamp-h.in autogen.sh bootstrap
-#EXTRA_DIST = @PACKAGE@.spec @PACKAGE@.m4 @PACKAGE@.pc Makefile.common
-EXTRA_DIST =
+EXTRA_DIST = @PACKAGE@.spec @PACKAGE@.m4 @PACKAGE@.pc Makefile.common
# Build in these directories:
-SUBDIRS = stdair trademgen airsched airinv simcrs rmol dsim \
+SUBDIRS = stdair trademgen airsched airinv simcrs rmol travelccm dsim \
extracppunit $(TEST_DIR)
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-30 15:14:59 UTC (rev 39)
+++ trunk/dsim/configure.ac 2009-12-30 16:08:23 UTC (rev 40)
@@ -454,6 +454,15 @@
rmol/config/Makefile
rmol/core/Makefile
rmol/batches/Makefile
+ travelccm/Makefile
+ travelccm/basic/Makefile
+ travelccm/bom/Makefile
+ travelccm/factory/Makefile
+ travelccm/command/Makefile
+ travelccm/service/Makefile
+ travelccm/core/Makefile
+ travelccm/config/Makefile
+ travelccm/batches/Makefile
dsim/Makefile
dsim/basic/Makefile
dsim/bom/Makefile
@@ -483,6 +492,7 @@
test/airinv/Makefile
test/rmol/Makefile
test/simcrs/Makefile
+ test/travelccm/Makefile
test/dsim/Makefile
)
AC_OUTPUT
Property changes on: trunk/dsim/test
___________________________________________________________________
Modified: svn:externals
- samples https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/samples
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
+ samples https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/samples
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/test/travelccm
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-30 15:14:59 UTC (rev 39)
+++ trunk/dsim/test/Makefile.am 2009-12-30 16:08:23 UTC (rev 40)
@@ -4,7 +4,8 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = boost samples stdair trademgen airsched airinv rmol simcrs dsim
+SUBDIRS = boost samples \
+ stdair trademgen airsched airinv rmol simcrs travelccm dsim
EXTRA_DIST =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2009-12-31 11:15:08
|
Revision: 41
http://dsim.svn.sourceforge.net/dsim/?rev=41&view=rev
Author: denis_arnaud
Date: 2009-12-31 11:14:56 +0000 (Thu, 31 Dec 2009)
Log Message:
-----------
[Struct] Added SimFQT and AvlCal projects.
Modified Paths:
--------------
trunk/dsim/Makefile.am
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Property Changed:
----------------
trunk/dsim/test/
Modified: trunk/dsim/Makefile.am
===================================================================
--- trunk/dsim/Makefile.am 2009-12-30 16:08:23 UTC (rev 40)
+++ trunk/dsim/Makefile.am 2009-12-31 11:14:56 UTC (rev 41)
@@ -24,8 +24,8 @@
EXTRA_DIST = @PACKAGE@.spec @PACKAGE@.m4 @PACKAGE@.pc Makefile.common
# Build in these directories:
-SUBDIRS = stdair trademgen airsched airinv simcrs rmol travelccm dsim \
- extracppunit $(TEST_DIR)
+SUBDIRS = stdair trademgen airsched rmol airinv avlcal simfqt simcrs travelccm \
+ dsim extracppunit $(TEST_DIR)
# Configuration helpers
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-30 16:08:23 UTC (rev 40)
+++ trunk/dsim/configure.ac 2009-12-31 11:14:56 UTC (rev 41)
@@ -426,6 +426,16 @@
airsched/config/Makefile
airsched/core/Makefile
airsched/batches/Makefile
+ rmol/Makefile
+ rmol/basic/Makefile
+ rmol/field/Makefile
+ rmol/bom/Makefile
+ rmol/factory/Makefile
+ rmol/command/Makefile
+ rmol/service/Makefile
+ rmol/config/Makefile
+ rmol/core/Makefile
+ rmol/batches/Makefile
airinv/Makefile
airinv/basic/Makefile
airinv/bom/Makefile
@@ -435,6 +445,24 @@
airinv/config/Makefile
airinv/core/Makefile
airinv/batches/Makefile
+ avlcal/Makefile
+ avlcal/basic/Makefile
+ avlcal/bom/Makefile
+ avlcal/factory/Makefile
+ avlcal/command/Makefile
+ avlcal/service/Makefile
+ avlcal/config/Makefile
+ avlcal/core/Makefile
+ avlcal/batches/Makefile
+ simfqt/Makefile
+ simfqt/basic/Makefile
+ simfqt/bom/Makefile
+ simfqt/factory/Makefile
+ simfqt/command/Makefile
+ simfqt/service/Makefile
+ simfqt/config/Makefile
+ simfqt/core/Makefile
+ simfqt/batches/Makefile
simcrs/Makefile
simcrs/basic/Makefile
simcrs/bom/Makefile
@@ -444,16 +472,6 @@
simcrs/config/Makefile
simcrs/core/Makefile
simcrs/batches/Makefile
- rmol/Makefile
- rmol/basic/Makefile
- rmol/field/Makefile
- rmol/bom/Makefile
- rmol/factory/Makefile
- rmol/command/Makefile
- rmol/service/Makefile
- rmol/config/Makefile
- rmol/core/Makefile
- rmol/batches/Makefile
travelccm/Makefile
travelccm/basic/Makefile
travelccm/bom/Makefile
@@ -489,8 +507,10 @@
test/stdair/Makefile
test/trademgen/Makefile
test/airsched/Makefile
+ test/rmol/Makefile
test/airinv/Makefile
- test/rmol/Makefile
+ test/avlcal/Makefile
+ test/simfqt/Makefile
test/simcrs/Makefile
test/travelccm/Makefile
test/dsim/Makefile
Property changes on: trunk/dsim/test
___________________________________________________________________
Modified: svn:externals
- samples https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/samples
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/test/travelccm
+ samples https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/samples
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/test/stdair
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/test/airsched
avlcal https://avlcal.svn.sourceforge.net/svnroot/avlcal/trunk/avlcal/test/avlcal
simfqt https://simfqt.svn.sourceforge.net/svnroot/simfqt/trunk/simfqt/test/simfqt
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/test/airinv
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/test/rmol
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/test/simcrs
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/test/trademgen
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/test/travelccm
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2009-12-30 16:08:23 UTC (rev 40)
+++ trunk/dsim/test/Makefile.am 2009-12-31 11:14:56 UTC (rev 41)
@@ -5,7 +5,7 @@
##
SUBDIRS = boost samples \
- stdair trademgen airsched airinv rmol simcrs travelccm dsim
+ stdair trademgen airsched rmol airinv avlcal simfqt simcrs travelccm dsim
EXTRA_DIST =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2009-12-31 13:33:44
|
Revision: 42
http://dsim.svn.sourceforge.net/dsim/?rev=42&view=rev
Author: denis_arnaud
Date: 2009-12-31 13:33:35 +0000 (Thu, 31 Dec 2009)
Log Message:
-----------
[Test] Added tests for the Boost.Filesystem library.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/boost/Makefile.am
trunk/dsim/test/boost/accumulators/Makefile.am
trunk/dsim/test/boost/asio/Makefile.am
trunk/dsim/test/boost/mpl/Makefile.am
trunk/dsim/test/boost/serialization/Makefile.am
trunk/dsim/test/boost/signals/Makefile.am
Added Paths:
-----------
trunk/dsim/test/boost/filesystem/
trunk/dsim/test/boost/filesystem/Makefile.am
trunk/dsim/test/boost/filesystem/file_size.cpp
trunk/dsim/test/boost/filesystem/fstream_test.cpp
trunk/dsim/test/boost/filesystem/lpath.hpp
trunk/dsim/test/boost/filesystem/operations_test.cpp
trunk/dsim/test/boost/filesystem/path_test.cpp
trunk/dsim/test/boost/filesystem/process_jam_log.cpp
trunk/dsim/test/boost/filesystem/simple_ls.cpp
trunk/dsim/test/boost/filesystem/tiny_xml.cpp
trunk/dsim/test/boost/filesystem/tiny_xml.hpp
trunk/dsim/test/boost/filesystem/utf8_codecvt_facet.cpp
trunk/dsim/test/boost/filesystem/utf8_codecvt_facet.hpp
trunk/dsim/test/boost/filesystem/utf8_codecvt_facet_base.cpp
trunk/dsim/test/boost/filesystem/wide_test.cpp
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2009-12-31 11:14:56 UTC (rev 41)
+++ trunk/dsim/configure.ac 2009-12-31 13:33:35 UTC (rev 42)
@@ -499,6 +499,7 @@
test/boost/asio/httpd/Makefile
test/boost/asio/logd/Makefile
test/boost/asio/logger/Makefile
+ test/boost/filesystem/Makefile
test/boost/mpi/Makefile
test/boost/mpl/Makefile
test/boost/spirit/Makefile
Modified: trunk/dsim/test/boost/Makefile.am
===================================================================
--- trunk/dsim/test/boost/Makefile.am 2009-12-31 11:14:56 UTC (rev 41)
+++ trunk/dsim/test/boost/Makefile.am 2009-12-31 13:33:35 UTC (rev 42)
@@ -5,6 +5,6 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = accumulators asio mpi mpl serialization signals spirit
+SUBDIRS = accumulators asio filesystem mpi mpl serialization signals spirit
EXTRA_DIST =
Modified: trunk/dsim/test/boost/accumulators/Makefile.am
===================================================================
--- trunk/dsim/test/boost/accumulators/Makefile.am 2009-12-31 11:14:56 UTC (rev 41)
+++ trunk/dsim/test/boost/accumulators/Makefile.am 2009-12-31 13:33:35 UTC (rev 42)
@@ -1,4 +1,4 @@
-## test/architecture sub-directory
+## test/boost/accumulators sub-directory
include $(top_srcdir)/Makefile.common
MAINTAINERCLEANFILES = Makefile.in
Modified: trunk/dsim/test/boost/asio/Makefile.am
===================================================================
--- trunk/dsim/test/boost/asio/Makefile.am 2009-12-31 11:14:56 UTC (rev 41)
+++ trunk/dsim/test/boost/asio/Makefile.am 2009-12-31 13:33:35 UTC (rev 42)
@@ -1,4 +1,4 @@
-## test/asio sub-directory
+## test/boost/asio sub-directory
include $(top_srcdir)/Makefile.common
##
Property changes on: trunk/dsim/test/boost/filesystem
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
simple_ls
file_size
process_jam_log
path_test
wide_test
fstream_test
operations_test
Copied: trunk/dsim/test/boost/filesystem/Makefile.am (from rev 41, trunk/dsim/test/boost/mpl/Makefile.am)
===================================================================
--- trunk/dsim/test/boost/filesystem/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/filesystem/Makefile.am 2009-12-31 13:33:35 UTC (rev 42)
@@ -0,0 +1,57 @@
+## test/boost/filesystem sub-directory
+include $(top_srcdir)/Makefile.common
+
+#
+MAINTAINERCLEANFILES = Makefile.in
+
+#
+SUBDIRS =
+
+EXTRA_DIST =
+
+#
+check_PROGRAMS = simple_ls file_size process_jam_log \
+ path_test wide_test operations_test fstream_test
+
+#
+simple_ls_SOURCES = simple_ls.cpp
+simple_ls_CXXFLAGS = $(BOOST_CFLAGS)
+simple_ls_LDADD =
+simple_ls_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
+#
+file_size_SOURCES = file_size.cpp
+file_size_CXXFLAGS = $(BOOST_CFLAGS)
+file_size_LDADD =
+file_size_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
+#
+process_jam_log_SOURCES = tiny_xml.hpp tiny_xml.cpp process_jam_log.cpp
+process_jam_log_CXXFLAGS = $(BOOST_CFLAGS)
+process_jam_log_LDADD =
+process_jam_log_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
+#
+path_test_SOURCES = path_test.cpp
+path_test_CXXFLAGS = $(BOOST_CFLAGS)
+path_test_LDADD =
+path_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
+#
+wide_test_SOURCES = wide_test.cpp
+wide_test_CXXFLAGS = $(BOOST_CFLAGS)
+wide_test_LDADD =
+wide_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
+#
+operations_test_SOURCES = operations_test.cpp
+operations_test_CXXFLAGS = $(BOOST_CFLAGS)
+operations_test_LDADD =
+operations_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
+#
+fstream_test_SOURCES = fstream_test.cpp
+fstream_test_CXXFLAGS = $(BOOST_CFLAGS)
+fstream_test_LDADD =
+fstream_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB)
+
Added: trunk/dsim/test/boost/filesystem/file_size.cpp
===================================================================
--- trunk/dsim/test/boost/filesystem/file_size.cpp (rev 0)
+++ trunk/dsim/test/boost/filesystem/file_size.cpp 2009-12-31 13:33:35 UTC (rev 42)
@@ -0,0 +1,38 @@
+// file_size program -------------------------------------------------------//
+// Copyright Beman Dawes, 2004
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/filesystem for documentation.
+// STL
+#include <iostream>
+// Boost
+#include <boost/filesystem/operations.hpp>
+
+namespace fs = boost::filesystem;
+
+// ////////////////////// M A I N ///////////////////////
+int main( int argc, char* argv[] ) {
+
+ if ( argc != 2 ) {
+ std::cout << "Usage: file_size path" << std::endl;
+ return 1;
+ }
+
+ std::cout << "sizeof(intmax_t) is " << sizeof(boost::intmax_t) << std::endl;
+
+ fs::path p( argv[1], fs::native );
+
+ if (fs::exists (p) == false) {
+ std::cout << "not found: " << argv[1] << std::endl;
+ return 1;
+ }
+
+ if (fs::is_regular (p) == false) {
+ std::cout << "not a regular file: " << argv[1] << std::endl;
+ return 1;
+ }
+
+ std::cout << "size of " << argv[1] << " is " << fs::file_size(p) << std::endl;
+ return 0;
+}
Added: trunk/dsim/test/boost/filesystem/fstream_test.cpp
===================================================================
--- trunk/dsim/test/boost/filesystem/fstream_test.cpp (rev 0)
+++ trunk/dsim/test/boost/filesystem/fstream_test.cpp 2009-12-31 13:33:35 UTC (rev 42)
@@ -0,0 +1,177 @@
+// fstream_test.cpp --------------------------------------------------------//
+// Copyright Beman Dawes 2002.
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// See library home page at http://www.boost.org/libs/filesystem
+// STL
+#include <string>
+#include <iostream>
+#include <cstdio> // for std::remove
+// Boost
+#include <boost/config/warning_disable.hpp>
+// See deprecated_test for tests of deprecated features
+#define BOOST_FILESYSTEM_NO_DEPRECATED
+#include <boost/filesystem/config.hpp>
+
+# ifdef BOOST_FILESYSTEM_NARROW_ONLY
+# include "lpath.hpp"
+# endif
+
+#include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include "utf8_codecvt_facet.hpp"
+
+namespace fs = boost::filesystem;
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+ namespace std { using ::remove; }
+#endif
+
+
+namespace {
+
+ bool cleanup = true;
+
+ template< class Path >
+ void test( const Path & p ) {
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
+ {
+ std::cout << " in test 1\n";
+ fs::filebuf fb;
+ fb.open( p, std::ios_base::in );
+ BOOST_TEST( fb.is_open() == fs::exists( p ) );
+ }
+ {
+ std::cout << " in test 2\n";
+ fs::filebuf fb1;
+ fb1.open( p, std::ios_base::out );
+ BOOST_TEST( fb1.is_open() );
+ }
+ {
+ std::cout << " in test 3\n";
+ fs::filebuf fb2;
+ fb2.open( p, std::ios_base::in );
+ BOOST_TEST( fb2.is_open() );
+ }
+# else
+ std::cout << "<note>\n";
+ std::cout <<
+ "VC++6.0 does not support boost::filesystem open()\n";
+# endif
+ {
+ std::cout << " in test 4\n";
+ fs::ifstream tfs( p );
+ BOOST_TEST( tfs.is_open() );
+ }
+ {
+ std::cout << " in test 4.1\n";
+ fs::ifstream tfs( p / p.filename() ); // should fail
+ BOOST_TEST( !tfs.is_open() );
+ }
+ {
+ std::cout << " in test 5\n";
+ fs::ifstream tfs( p, std::ios_base::in );
+ BOOST_TEST( tfs.is_open() );
+ }
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
+ {
+ std::cout << " in test 6\n";
+ fs::ifstream tfs;
+ tfs.open( p );
+ BOOST_TEST( tfs.is_open() );
+ }
+ {
+ std::cout << " in test 7\n";
+ fs::ifstream tfs;
+ tfs.open( p, std::ios_base::in );
+ BOOST_TEST( tfs.is_open() );
+ }
+# endif
+ {
+ std::cout << " in test 8\n";
+ fs::ofstream tfs( p );
+ BOOST_TEST( tfs.is_open() );
+ }
+ {
+ std::cout << " in test 9\n";
+ fs::ofstream tfs( p, std::ios_base::out );
+ BOOST_TEST( tfs.is_open() );
+ }
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
+ {
+ std::cout << " in test 10\n";
+ fs::ofstream tfs;
+ tfs.open( p );
+ BOOST_TEST( tfs.is_open() );
+ }
+ {
+ std::cout << " in test 11\n";
+ fs::ofstream tfs;
+ tfs.open( p, std::ios_base::out );
+ BOOST_TEST( tfs.is_open() );
+ }
+# endif
+ {
+ std::cout << " in test 12\n";
+ fs::fstream tfs( p );
+ BOOST_TEST( tfs.is_open() );
+ }
+ {
+ std::cout << " in test 13\n";
+ fs::fstream tfs( p, std::ios_base::in|std::ios_base::out );
+ BOOST_TEST( tfs.is_open() );
+ }
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
+ {
+ std::cout << " in test 14\n";
+ fs::fstream tfs;
+ tfs.open( p );
+ BOOST_TEST( tfs.is_open() );
+ }
+ {
+ std::cout << " in test 15\n";
+ fs::fstream tfs;
+ tfs.open( p, std::ios_base::in|std::ios_base::out );
+ BOOST_TEST( tfs.is_open() );
+ }
+# endif
+
+ if ( cleanup ) fs::remove( p );
+
+ } // test
+} // unnamed namespace
+
+int main( int argc, char*[] )
+{
+ if ( argc > 1 ) cleanup = false;
+
+ // test fs::path
+ std::cout << "path tests:\n";
+ test( fs::path( "fstream_test_foo" ) );
+
+#ifndef BOOST_FILESYSTEM_NARROW_ONLY
+
+ // So that tests are run with known encoding, use Boost UTF-8 codecvt
+ std::locale global_loc = std::locale();
+ std::locale loc( global_loc, new fs::detail::utf8_codecvt_facet );
+ fs::wpath_traits::imbue( loc );
+
+ // test fs::wpath
+ // x2780 is circled 1 against white background == e2 9e 80 in UTF-8
+ // x2781 is circled 2 against white background == e2 9e 81 in UTF-8
+ std::cout << "\nwpath tests:\n";
+ test( fs::wpath( L"fstream_test_\x2780" ) );
+
+ // test user supplied basic_path
+ const long lname[] = { 'f', 's', 'r', 'e', 'a', 'm', '_', 't', 'e', 's',
+ 't', '_', 'l', 'p', 'a', 't', 'h', 0 };
+ std::cout << "\nlpath tests:\n";
+ // test( user::lpath( lname ) );
+
+#endif
+
+ return ::boost::report_errors();
+}
Added: trunk/dsim/test/boost/filesystem/lpath.hpp
===================================================================
--- trunk/dsim/test/boost/filesystem/lpath.hpp (rev 0)
+++ trunk/dsim/test/boost/filesystem/lpath.hpp 2009-12-31 13:33:35 UTC (rev 42)
@@ -0,0 +1,101 @@
+// Boost lpath.hpp ---------------------------------------------------------//
+
+// Copyright Beman Dawes 2005
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See library home page at http://www.boost.org/libs/filesystem
+
+#include <boost/filesystem/path.hpp>
+#include <cwchar> // for std::mbstate_t
+#include <string>
+#include <ios> // for std::streamoff
+
+namespace std
+{
+ // Note well: this specialization is meant only to support wide_test.cpp.
+ // It is not fully functional, fully correct, or efficient.
+ template<> struct char_traits<long>
+ {
+ typedef long char_type;
+ typedef long int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+ static void assign(char_type& c1, const char_type& c2){c1=c2;}
+ static bool eq(const char_type& c1, const char_type& c2){return c1==c2;}
+ static bool lt(const char_type& c1, const char_type& c2){return c1<c2;}
+ static int compare(const char_type* s1, const char_type* s2, size_t n)
+ {
+ const char_type* e = s1 + n;
+ for ( ;s1 != e && *s1 == *s2; ++s1, ++s2 ) {}
+ return s1 == e ? 0 : (*s1<*s2 ? -1 : 1);
+ }
+ static size_t length(const char_type* s)
+ { const char_type* b=s; for(;*s!=0L;++s){} return s-b; }
+
+ static const char_type* find(const char_type* /*s*/, size_t /*n*/, const char_type& /*a*/)
+ { return 0; }
+
+ // copy semantics will do for wide_test
+ static char_type* move(char_type* s1, const char_type* s2, size_t n)
+ { char_type* b=s1; for(const char_type* e=s1+n;s1!=e;++s1,++s2) *s1=*s2; return b; }
+
+ static char_type* copy(char_type* s1, const char_type* s2, size_t n)
+ { char_type* b=s1; for(const char_type* e=s1+n;s1!=e;++s1,++s2) *s1=*s2; return b; }
+
+ static char_type* assign(char_type* s, size_t n, char_type a)
+ { char_type* b=s; for(char_type* e=s+n;s!=e;++s) *s=a; return b; }
+
+ static int_type not_eof(const int_type& c);
+ static char_type to_char_type(const int_type& c);
+ static int_type to_int_type(const char_type& c);
+ static bool eq_int_type(const int_type& c1, const int_type& c2);
+ static int_type eof();
+ };
+}
+
+namespace user
+{
+ typedef std::basic_string<long> lstring;
+ struct lpath_traits;
+ typedef boost::filesystem::basic_path<lstring, lpath_traits> lpath;
+
+ struct lpath_traits
+ {
+ typedef lstring internal_string_type;
+ typedef std::string external_string_type;
+
+ static external_string_type to_external( const lpath &,
+ const internal_string_type & src )
+ {
+ external_string_type tmp;
+ for ( internal_string_type::const_iterator it( src.begin() );
+ it != src.end(); ++it )
+ {
+ tmp += static_cast<external_string_type::value_type>(*it);
+ }
+ return tmp;
+ }
+
+ static internal_string_type to_internal( const external_string_type & src )
+ {
+ internal_string_type tmp;
+ for ( external_string_type::const_iterator it( src.begin() );
+ it != src.end(); ++it ) tmp += *it;
+ return tmp;
+ }
+ };
+
+} // namespace user
+
+namespace boost
+{
+ namespace filesystem
+ {
+ template<> struct is_basic_path<user::lpath>
+ { static const bool value = true; };
+ }
+}
Added: trunk/dsim/test/boost/filesystem/operations_test.cpp
===================================================================
--- trunk/dsim/test/boost/filesystem/operations_test.cpp (rev 0)
+++ trunk/dsim/test/boost/filesystem/operations_test.cpp 2009-12-31 13:33:35 UTC (rev 42)
@@ -0,0 +1,942 @@
+// Boost operations_test.cpp -----------------------------------------------//
+// Copyright Beman Dawes 2002.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See library home page at http://www.boost.org/libs/filesystem
+// STL
+#include <fstream>
+#include <iostream>
+#include <string>
+#include <cstring> // for strncmp, etc.
+#include <ctime>
+#include <cstdlib> // for system()
+// Boost
+#include <boost/config/warning_disable.hpp>
+// See deprecated_test for tests of deprecated features
+#define BOOST_FILESYSTEM_NO_DEPRECATED
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/convenience.hpp>
+#include <boost/cerrno.hpp>
+namespace fs = boost::filesystem;
+
+#include <boost/config.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::system::error_code;
+using boost::system::system_category;
+using boost::system::system_error;
+
+#ifndef BOOST_FILESYSTEM_NARROW_ONLY
+# define BOOST_BND(BOOST_FUNC_TO_DO) BOOST_FUNC_TO_DO<fs::path>
+#else
+# define BOOST_BND(BOOST_FUNC_TO_DO) BOOST_FUNC_TO_DO
+#endif
+
+// VC++ 7.0 and earlier has a serious namespace bug that causes a clash
+// between boost::filesystem::is_empty and the unrelated type trait
+// boost::is_empty.
+#if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300
+# define BOOST_FS_IS_EMPTY fs::is_empty
+#else
+# define BOOST_FS_IS_EMPTY fs::_is_empty
+#endif
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+ namespace std { using ::asctime; using ::gmtime; using ::localtime;
+ using ::difftime; using ::time; using ::tm; using ::mktime; using ::system; }
+# endif
+
+#ifdef BOOST_WINDOWS_API
+# include <windows.h>
+#endif
+
+#define CHECK_EXCEPTION(Functor,Expect) throws_fs_error(Functor,Expect,__LINE__)
+
+namespace
+{
+ typedef int errno_t;
+ std::string platform( BOOST_PLATFORM );
+ bool report_throws;
+ fs::directory_iterator end_itr;
+
+ unsigned short language_id; // 0 except for Windows
+
+ const char * temp_dir_name = "temp_fs_test_dir";
+
+ void create_file( const fs::path & ph, const std::string & contents )
+ {
+ std::ofstream f( ph.file_string().c_str() );
+ if ( !f )
+ throw fs::filesystem_error( "operations_test create_file",
+ ph, error_code(errno, system_category) );
+ if ( !contents.empty() ) f << contents;
+ }
+
+ void verify_file( const fs::path & ph, const std::string & expected )
+ {
+ std::ifstream f( ph.file_string().c_str() );
+ if ( !f )
+ throw fs::filesystem_error( "operations_test verify_file",
+ ph, error_code(errno, system_category) );
+ std::string contents;
+ f >> contents;
+ if ( contents != expected )
+ throw fs::filesystem_error( "operations_test verify_file contents \""
+ + contents + "\" != \"" + expected + "\"", ph, error_code() );
+ }
+
+ template< typename F >
+ bool throws_fs_error( F func, errno_t en, int line )
+ {
+ try { func(); }
+
+ catch ( const fs::filesystem_error & ex )
+ {
+ if ( report_throws )
+ {
+ // use the what() convenience function to display exceptions
+ std::cout << "\n" << ex.what() << "\n";
+ }
+ if ( en == 0
+ || en == ex.code().default_error_condition().value() ) return true;
+ std::cout
+ << "\nWarning: line " << line
+ << " exception reports default_error_condition().value() " << ex.code().default_error_condition().value()
+ << ", should be " << en
+ << "\n value() is " << ex.code().value()
+ << std::endl;
+ return true;
+ }
+ return false;
+ }
+
+ // compile-only two argument "do-the-right-thing" tests
+ // verifies that all overload combinations compile without error
+ void do_not_call()
+ {
+ fs::path p;
+ std::string s;
+ const char * a = 0;
+ fs::copy_file( p, p );
+ fs::copy_file( s, p );
+ fs::copy_file( a, p );
+ fs::copy_file( p, s );
+ fs::copy_file( p, a );
+ fs::copy_file( s, s );
+ fs::copy_file( a, s );
+ fs::copy_file( s, a );
+ fs::copy_file( a, a );
+ }
+
+ void exception_tests()
+ {
+ bool exception_thrown;
+ exception_thrown = false;
+ try
+ {
+ fs::create_directory( "no-such-dir/foo/bar" );
+ }
+ catch ( std::runtime_error x )
+ {
+ exception_thrown = true;
+ if ( report_throws ) std::cout << x.what() << std::endl;
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
+ // the stdcxx standard library apparently appends additional info
+ // to what(), so check only the initial portion:
+ BOOST_TEST( std::strncmp( x.what(),
+ "boost::filesystem::create_directory",
+ sizeof("boost::filesystem::create_directory")-1 ) == 0 );
+ }
+ BOOST_TEST( exception_thrown );
+
+ exception_thrown = false;
+ try
+ {
+ fs::create_directory( "no-such-dir/foo/bar" );
+ }
+ catch ( system_error x )
+ {
+ exception_thrown = true;
+ if ( report_throws ) std::cout << x.what() << std::endl;
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
+ BOOST_TEST( std::strcmp( x.what(),
+ "boost::filesystem::create_directory: The system cannot find the path specified" ) == 0 );
+ }
+ BOOST_TEST( exception_thrown );
+
+ exception_thrown = false;
+ try
+ {
+ fs::create_directory( "no-such-dir/foo/bar" );
+ }
+ catch ( fs::filesystem_error x )
+ {
+ exception_thrown = true;
+ if ( report_throws ) std::cout << x.what() << std::endl;
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
+ {
+ bool ok ( std::strcmp( x.what(),
+ "boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
+ BOOST_TEST( ok );
+ if ( !ok )
+ {
+ std::cout << "what returns \"" << x.what() << "\"" << std::endl;
+ }
+ }
+ }
+ BOOST_TEST( exception_thrown );
+
+ exception_thrown = false;
+ try
+ {
+ fs::create_directory( "no-such-dir/foo/bar" );
+ }
+ catch ( const fs::filesystem_error & x )
+ {
+ exception_thrown = true;
+ if ( report_throws ) std::cout << x.what() << std::endl;
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
+ {
+ bool ok ( std::strcmp( x.what(),
+ "boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
+ BOOST_TEST( ok );
+ if ( !ok )
+ {
+ std::cout << "what returns \"" << x.what() << "\"" << std::endl;
+ }
+ }
+ }
+ BOOST_TEST( exception_thrown );
+ }
+
+ void bad_file_size()
+ {
+ fs::file_size( " No way, Jose" );
+ }
+
+ void bad_directory_size()
+ {
+ fs::file_size( fs::current_path<fs::path>() );
+ }
+
+ fs::path bad_create_directory_path;
+ void bad_create_directory()
+ {
+ fs::create_directory( bad_create_directory_path );
+ }
+
+ void bad_equivalent()
+ {
+ fs::equivalent( "no-such-path", "another-not-present-path" );
+ }
+
+ fs::path bad_remove_dir;
+ void bad_remove()
+ {
+ fs::remove( bad_remove_dir );
+ }
+
+ class renamer
+ {
+ public:
+ renamer( const fs::path & p1, const fs::path & p2 )
+ : from(p1), to(p2) {}
+ void operator()()
+ {
+ fs::rename( from, to );
+ }
+ private:
+ fs::path from;
+ fs::path to;
+ };
+
+} // unnamed namespace
+
+// main ------------------------------------------------------------------------------//
+
+int main( int argc, char * argv[] )
+{
+ if ( argc > 1 && *argv[1]=='-' && *(argv[1]+1)=='t' ) report_throws = true;
+
+ // The choice of platform is make at runtime rather than compile-time
+ // so that compile errors for all platforms will be detected even though
+ // only the current platform is runtime tested.
+# if defined( BOOST_POSIX_API )
+ platform = "POSIX";
+# elif defined( BOOST_WINDOWS_API )
+ platform = "Windows";
+# if !defined(__MINGW32__) && !defined(__CYGWIN__)
+ language_id = ::GetUserDefaultUILanguage();
+# else
+ language_id = 0x0409; // Assume US English
+# endif
+# else
+ platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" )
+ ? "Windows"
+ : "POSIX";
+# endif
+ std::cout << "API is " << platform << std::endl;
+
+ exception_tests();
+
+ std::cout << "\ninitial_path<path>().string() is\n \""
+ << fs::initial_path<fs::path>().string()
+ << "\"\n";
+ std::cout << "\ninitial_path<fs::path>().file_string() is\n \""
+ << fs::initial_path<fs::path>().file_string()
+ << "\"\n\n";
+ BOOST_TEST( fs::initial_path<fs::path>().is_complete() );
+ BOOST_TEST( fs::current_path<fs::path>().is_complete() );
+ BOOST_TEST( fs::initial_path<fs::path>().string()
+ == fs::current_path<fs::path>().string() );
+
+ BOOST_TEST( fs::complete( "" ).empty() );
+ BOOST_TEST( fs::complete( "/" ).string() == fs::initial_path<fs::path>().root_path().string() );
+ BOOST_TEST( fs::complete( "foo" ).string() == fs::initial_path<fs::path>().string()+"/foo" );
+ BOOST_TEST( fs::complete( "/foo" ).string() == fs::initial_path<fs::path>().root_path().string()+"foo" );
+ BOOST_TEST( fs::complete( "foo", fs::path( "//net/bar" ) ).string()
+ == "//net/bar/foo" );
+
+ // predicate and status tests
+ BOOST_TEST( fs::exists( "/" ) );
+ fs::path ng( " no-way, Jose" );
+ BOOST_TEST( !fs::exists( ng ) );
+ BOOST_TEST( !fs::is_directory( ng ) );
+ BOOST_TEST( !fs::is_regular_file( ng ) );
+ BOOST_TEST( !fs::is_symlink( ng ) );
+ fs::file_status stat( fs::status( ng ) );
+ BOOST_TEST( fs::status_known( stat ) );
+ BOOST_TEST( !fs::exists( stat ) );
+ BOOST_TEST( !fs::is_directory( stat ) );
+ BOOST_TEST( !fs::is_regular_file( stat ) );
+ BOOST_TEST( !fs::is_other( stat ) );
+ BOOST_TEST( !fs::is_symlink( stat ) );
+ stat = fs::status( "" );
+ BOOST_TEST( fs::status_known( stat ) );
+ BOOST_TEST( !fs::exists( stat ) );
+ BOOST_TEST( !fs::is_directory( stat ) );
+ BOOST_TEST( !fs::is_regular_file( stat ) );
+ BOOST_TEST( !fs::is_other( stat ) );
+ BOOST_TEST( !fs::is_symlink( stat ) );
+
+ fs::path dir( fs::initial_path<fs::path>() / temp_dir_name );
+
+ if ( fs::exists( dir ) )
+ fs::remove_all( dir ); // remove residue from prior failed tests
+ BOOST_TEST( !fs::exists( dir ) );
+
+ // create a directory, then check it for consistency
+ // take extra care to report problems, since if this fails
+ // many subsequent tests will fail
+ try
+ {
+ fs::create_directory( dir );
+ }
+
+ catch ( const fs::filesystem_error & x )
+ {
+ std::cout << x.what() << "\n\n"
+ "***** Creating directory " << dir.string() << " failed. *****\n"
+ "***** This is a serious error that will prevent further tests *****\n"
+ "***** from returning useful results. Further testing is aborted. *****\n\n";
+ return 1;
+ }
+
+ catch ( ... )
+ {
+ std::cout << "\n\n"
+ "***** Creating directory " << dir.string() << " failed. *****\n"
+ "***** This is a serious error that will prevent further tests *****\n"
+ "***** from returning useful results. Further testing is aborted. *****\n\n";
+ return 1;
+ }
+
+ BOOST_TEST( fs::exists( dir ) );
+ BOOST_TEST( BOOST_FS_IS_EMPTY( dir ) );
+ BOOST_TEST( fs::is_directory( dir ) );
+ BOOST_TEST( !fs::is_regular_file( dir ) );
+ BOOST_TEST( !fs::is_other( dir ) );
+ BOOST_TEST( !fs::is_symlink( dir ) );
+ stat = fs::status( dir );
+ BOOST_TEST( fs::exists( stat ) );
+ BOOST_TEST( fs::is_directory( stat ) );
+ BOOST_TEST( !fs::is_regular_file( stat ) );
+ BOOST_TEST( !fs::is_other( stat ) );
+ BOOST_TEST( !fs::is_symlink( stat ) );
+
+ // Windows only tests
+ if ( platform == "Windows" )
+ {
+ BOOST_TEST( !fs::exists( fs::path( "//share-not" ) ) );
+ BOOST_TEST( !fs::exists( fs::path( "//share-not/" ) ) );
+ BOOST_TEST( !fs::exists( fs::path( "//share-not/foo" ) ) );
+ BOOST_TEST( !fs::exists( "tools/jam/src/:sys:stat.h" ) ); // !exists() if ERROR_INVALID_NAME
+ BOOST_TEST( !fs::exists( ":sys:stat.h" ) ); // !exists() if ERROR_INVALID_PARAMETER
+ BOOST_TEST( !fs::exists( "1:/" ) );
+ BOOST_TEST( dir.string().size() > 1
+ && dir.string()[1] == ':' ); // verify path includes drive
+
+ BOOST_TEST( fs::system_complete( "" ).empty() );
+ BOOST_TEST( fs::system_complete( "/" ).string()
+ == fs::initial_path<fs::path>().root_path().string() );
+ BOOST_TEST( fs::system_complete( "foo" ).string()
+ == fs::initial_path<fs::path>().string()+"/foo" );
+ BOOST_TEST( fs::system_complete( "/foo" ).string()
+ == fs::initial_path<fs::path>().root_path().string()+"foo" );
+ BOOST_TEST( fs::complete( fs::path( "c:/" ) ).string()
+ == "c:/" );
+ BOOST_TEST( fs::complete( fs::path( "c:/foo" ) ).string()
+ == "c:/foo" );
+
+ BOOST_TEST( fs::system_complete( fs::path( fs::initial_path<fs::path>().root_name() ) ).string() == fs::initial_path<fs::path>().string() );
+ BOOST_TEST( fs::system_complete( fs::path( fs::initial_path<fs::path>().root_name()
+ + "foo" ) ).string() == fs::initial_path<fs::path>().string()+"/foo" );
+ BOOST_TEST( fs::system_complete( fs::path( "c:/" ) ).string()
+ == "c:/" );
+ BOOST_TEST( fs::system_complete( fs::path( "c:/foo" ) ).string()
+ == "c:/foo" );
+ BOOST_TEST( fs::system_complete( fs::path( "//share" ) ).string()
+ == "//share" );
+ } // Windows
+
+ else if ( platform == "POSIX" )
+ {
+ BOOST_TEST( fs::system_complete( "" ).empty() );
+ BOOST_TEST( fs::initial_path<fs::path>().root_path().string() == "/" );
+ BOOST_TEST( fs::system_complete( "/" ).string() == "/" );
+ BOOST_TEST( fs::system_complete( "foo" ).string()
+ == fs::initial_path<fs::path>().string()+"/foo" );
+ BOOST_TEST( fs::system_complete( "/foo" ).string()
+ == fs::initial_path<fs::path>().root_path().string()+"foo" );
+ } // POSIX
+
+ // the bound functions should throw, so CHECK_EXCEPTION() should return true
+ BOOST_TEST( CHECK_EXCEPTION( bad_file_size, E...
[truncated message content] |
|
From: <den...@us...> - 2010-01-01 18:55:24
|
Revision: 43
http://dsim.svn.sourceforge.net/dsim/?rev=43&view=rev
Author: denis_arnaud
Date: 2010-01-01 18:55:18 +0000 (Fri, 01 Jan 2010)
Log Message:
-----------
[Struct] The parsing of the input schedule file is now done during the initialisation.
Modified Paths:
--------------
trunk/dsim/dsim/DSIM_Service.hpp
trunk/dsim/dsim/service/DSIM_Service.cpp
trunk/dsim/test/dsim/simulate.cpp
Modified: trunk/dsim/dsim/DSIM_Service.hpp
===================================================================
--- trunk/dsim/dsim/DSIM_Service.hpp 2009-12-31 13:33:35 UTC (rev 42)
+++ trunk/dsim/dsim/DSIM_Service.hpp 2010-01-01 18:55:18 UTC (rev 43)
@@ -5,8 +5,10 @@
// Import section
// //////////////////////////////////////////////////////////////////////
// STL
-#include <ostream>
+#include <iosfwd>
#include <string>
+// StdAir
+#include <stdair/STDAIR_Types.hpp>
// Dsim
#include <dsim/DSIM_Types.hpp>
@@ -27,8 +29,9 @@
public:
// ////////// Constructors and destructors //////////
/** Constructor.
- @param std::ostream& Output log stream (for instance, std::cout). */
- DSIM_Service (const std::string&, std::ostream& ioLogStream);
+ @param std::ostream& Output log stream (for instance, std::cout).
+ @param const stdair::Filename_T& Filename of the input schedule file. */
+ DSIM_Service (std::ostream& ioLogStream, const stdair::Filename_T&);
/** Destructor. */
~DSIM_Service();
@@ -41,8 +44,10 @@
/** Default copy constructor. */
DSIM_Service (const DSIM_Service&);
- /** Initialise. */
- void init (const std::string&, std::ostream& ioLogStream);
+ /** Initialise.
+ @param std::ostream& Output log stream (for instance, std::cout).
+ @param const stdair::Filename_T& Filename of the input schedule file. */
+ void init (std::ostream& ioLogStream, const stdair::Filename_T&);
/** Finalise. */
void finalise ();
Modified: trunk/dsim/dsim/service/DSIM_Service.cpp
===================================================================
--- trunk/dsim/dsim/service/DSIM_Service.cpp 2009-12-31 13:33:35 UTC (rev 42)
+++ trunk/dsim/dsim/service/DSIM_Service.cpp 2010-01-01 18:55:18 UTC (rev 43)
@@ -3,6 +3,7 @@
// //////////////////////////////////////////////////////////////////////
// STL
#include <cassert>
+#include <ostream>
// Boost
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
@@ -21,15 +22,14 @@
// //////////////////////////////////////////////////////////////////////
DSIM_Service::
- DSIM_Service (const std::string& iScheduleInputFilename,
- std::ostream& ioLogStream)
+ DSIM_Service (std::ostream& ioLogStream,
+ const stdair::Filename_T& iScheduleInputFilename)
: _dsimServiceContext (NULL) {
- init (iScheduleInputFilename, ioLogStream);
+ init (ioLogStream, iScheduleInputFilename);
}
// //////////////////////////////////////////////////////////////////////
- DSIM_Service::DSIM_Service ()
- : _dsimServiceContext (NULL) {
+ DSIM_Service::DSIM_Service () : _dsimServiceContext (NULL) {
assert (false);
}
@@ -51,8 +51,8 @@
}
// //////////////////////////////////////////////////////////////////////
- void DSIM_Service::init (const std::string& iScheduleInputFilename,
- std::ostream& ioLogStream) {
+ void DSIM_Service::init (std::ostream& ioLogStream,
+ const stdair::Filename_T& iScheduleInputFilename) {
// Set the log file
logInit (LOG::DEBUG, ioLogStream);
@@ -65,6 +65,10 @@
// configuration file).
// Initialise the SIMCRS service handler
const SIMCRS::CRSCode_T lCRSCode = "1S";
+
+ // Note that the (Boost.)Smart Pointer keeps track of the references
+ // on the Service object, and deletes that object when it is no longer
+ // referenced (e.g., at the end of the process).
SIMCRS_ServicePtr_T lSIMCRS_Service =
SIMCRS_ServicePtr_T (new SIMCRS::SIMCRS_Service (ioLogStream, lCRSCode,
iScheduleInputFilename));
Modified: trunk/dsim/test/dsim/simulate.cpp
===================================================================
--- trunk/dsim/test/dsim/simulate.cpp 2009-12-31 13:33:35 UTC (rev 42)
+++ trunk/dsim/test/dsim/simulate.cpp 2010-01-01 18:55:18 UTC (rev 43)
@@ -26,7 +26,7 @@
logOutputFile.clear();
// Initialise the list of classes/buckets
- DSIM::DSIM_Service dsimService (lScheduleInputFilename, logOutputFile);
+ DSIM::DSIM_Service dsimService (logOutputFile, lScheduleInputFilename);
// Perform a simulation
dsimService.simulate();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-01-20 20:11:06
|
Revision: 51
http://dsim.svn.sourceforge.net/dsim/?rev=51&view=rev
Author: denis_arnaud
Date: 2010-01-20 20:11:00 +0000 (Wed, 20 Jan 2010)
Log Message:
-----------
[Dev] Moved the Log service into the StdAir library.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/dsim/core/Makefile.am
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-01-20 17:24:13 UTC (rev 50)
+++ trunk/dsim/configure.ac 2010-01-20 20:11:00 UTC (rev 51)
@@ -406,6 +406,7 @@
stdair/bom/Makefile
stdair/factory/Makefile
stdair/config/Makefile
+ stdair/service/Makefile
stdair/core/Makefile
trademgen/Makefile
trademgen/basic/Makefile
Modified: trunk/dsim/dsim/core/Makefile.am
===================================================================
--- trunk/dsim/dsim/core/Makefile.am 2010-01-20 17:24:13 UTC (rev 50)
+++ trunk/dsim/dsim/core/Makefile.am 2010-01-20 20:11:00 UTC (rev 51)
@@ -20,9 +20,8 @@
$(top_builddir)/dsim/command/libcmd.la \
$(top_builddir)/dsim/service/libsvc.la
libdsim_la_LDFLAGS = \
- $(BOOST_DATE_TIME_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) \
+ $(BOOST_DATE_TIME_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) \
+ $(top_builddir)/stdair/core/libstdair.la \
+ $(top_builddir)/airsched/core/libairsched.la \
+ $(top_builddir)/simcrs/core/libsimcrs.la \
-version-info $(GENERIC_LIBRARY_VERSION)
-
-# Header files
-#pkginclude_HEADERS = $(service_h_sources)
-#nobase_nodist_pkginclude_HEADERS = $(top_builddir)/dsim/config.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-01-21 13:25:25
|
Revision: 52
http://dsim.svn.sourceforge.net/dsim/?rev=52&view=rev
Author: denis_arnaud
Date: 2010-01-21 13:25:10 +0000 (Thu, 21 Jan 2010)
Log Message:
-----------
[Dev] The log output stream initialisation has been moved into the StdAir library.
Modified Paths:
--------------
trunk/dsim/dsim/DSIM_Service.hpp
trunk/dsim/dsim/service/DSIM_Service.cpp
trunk/dsim/test/dsim/simulate.cpp
Modified: trunk/dsim/dsim/DSIM_Service.hpp
===================================================================
--- trunk/dsim/dsim/DSIM_Service.hpp 2010-01-20 20:11:00 UTC (rev 51)
+++ trunk/dsim/dsim/DSIM_Service.hpp 2010-01-21 13:25:10 UTC (rev 52)
@@ -4,11 +4,9 @@
// //////////////////////////////////////////////////////////////////////
// Import section
// //////////////////////////////////////////////////////////////////////
-// STL
-#include <iosfwd>
-#include <string>
// StdAir
#include <stdair/STDAIR_Types.hpp>
+#include <stdair/basic/BasLogParams.hpp>
// Dsim
#include <dsim/DSIM_Types.hpp>
@@ -29,10 +27,25 @@
public:
// ////////// Constructors and destructors //////////
/** Constructor.
- @param std::ostream& Output log stream (for instance, std::cout).
+ <br>The init() method is called; see the corresponding documentation
+ for more details.
+ <br>Moreover, a reference on an output stream is given, so
+ that log outputs can be directed onto that stream.
+ @param const stdair::BasLogParams& Parameters for the output log stream.
@param const stdair::Filename_T& Filename of the input schedule file. */
- DSIM_Service (std::ostream& ioLogStream, const stdair::Filename_T&);
+ DSIM_Service (const stdair::BasLogParams&, const stdair::Filename_T&);
+ /** Constructor.
+ <br>The init() method is called; see the corresponding documentation
+ for more details.
+ <br>Moreover, as no reference on any output stream is given,
+ it is assumed that the StdAir log service has already been
+ initialised with the proper log output stream by some other
+ methods in the calling chain (for instance, when the DSIM_Service
+ is itself being initialised by another library service).
+ @param const stdair::Filename_T& Filename of the input schedule file. */
+ DSIM_Service (const stdair::Filename_T&);
+
/** Destructor. */
~DSIM_Service();
@@ -44,10 +57,12 @@
/** Default copy constructor. */
DSIM_Service (const DSIM_Service&);
+ /** Initialise the log. */
+ void logInit (const stdair::BasLogParams&);
+
/** Initialise.
- @param std::ostream& Output log stream (for instance, std::cout).
@param const stdair::Filename_T& Filename of the input schedule file. */
- void init (std::ostream& ioLogStream, const stdair::Filename_T&);
+ void init (const stdair::Filename_T&);
/** Finalise. */
void finalise ();
Modified: trunk/dsim/dsim/service/DSIM_Service.cpp
===================================================================
--- trunk/dsim/dsim/service/DSIM_Service.cpp 2010-01-20 20:11:00 UTC (rev 51)
+++ trunk/dsim/dsim/service/DSIM_Service.cpp 2010-01-21 13:25:10 UTC (rev 52)
@@ -4,11 +4,10 @@
// STL
#include <cassert>
#include <ostream>
-// Boost
-#include <boost/date_time/gregorian/gregorian.hpp>
-#include <boost/date_time/posix_time/ptime.hpp>
// StdAir
#include <stdair/basic/BasChronometer.hpp>
+#include <stdair/bom/BomManager.hpp> // for display()
+#include <stdair/service/Logger.hpp>
// Distribution
#include <simcrs/SIMCRS_Service.hpp>
// Dsim
@@ -16,20 +15,11 @@
#include <dsim/command/Simulator.hpp>
#include <dsim/factory/FacDsimServiceContext.hpp>
#include <dsim/service/DSIM_ServiceContext.hpp>
-#include <dsim/service/Logger.hpp>
#include <dsim/DSIM_Service.hpp>
namespace DSIM {
// //////////////////////////////////////////////////////////////////////
- DSIM_Service::
- DSIM_Service (std::ostream& ioLogStream,
- const stdair::Filename_T& iScheduleInputFilename)
- : _dsimServiceContext (NULL) {
- init (ioLogStream, iScheduleInputFilename);
- }
-
- // //////////////////////////////////////////////////////////////////////
DSIM_Service::DSIM_Service () : _dsimServiceContext (NULL) {
assert (false);
}
@@ -40,23 +30,38 @@
}
// //////////////////////////////////////////////////////////////////////
+ DSIM_Service::DSIM_Service (const stdair::Filename_T& iScheduleInputFilename)
+ : _dsimServiceContext (NULL) {
+
+ // Initialise the context
+ init (iScheduleInputFilename);
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ DSIM_Service::DSIM_Service (const stdair::BasLogParams& iLogParams,
+ const stdair::Filename_T& iScheduleInputFilename)
+ : _dsimServiceContext (NULL) {
+
+ // Set the log file
+ logInit (iLogParams);
+
+ // Initialise the (remaining of the) context
+ init (iScheduleInputFilename);
+ }
+
+ // //////////////////////////////////////////////////////////////////////
DSIM_Service::~DSIM_Service () {
// Delete/Clean all the objects from memory
finalise();
}
// //////////////////////////////////////////////////////////////////////
- void logInit (const LOG::EN_LogLevel iLogLevel,
- std::ostream& ioLogOutputFile) {
- Logger::instance().setLogParameters (iLogLevel, ioLogOutputFile);
+ void DSIM_Service::logInit (const stdair::BasLogParams& iLogParams) {
+ stdair::Logger::init (iLogParams);
}
// //////////////////////////////////////////////////////////////////////
- void DSIM_Service::init (std::ostream& ioLogStream,
- const stdair::Filename_T& iScheduleInputFilename) {
- // Set the log file
- logInit (LOG::DEBUG, ioLogStream);
-
+ void DSIM_Service::init (const stdair::Filename_T& iScheduleInputFilename) {
// Initialise the context
DSIM_ServiceContext& lDSIM_ServiceContext =
FacDsimServiceContext::instance().create ();
@@ -71,7 +76,7 @@
// on the Service object, and deletes that object when it is no longer
// referenced (e.g., at the end of the process).
SIMCRS_ServicePtr_T lSIMCRS_Service =
- SIMCRS_ServicePtr_T (new SIMCRS::SIMCRS_Service (ioLogStream, lCRSCode,
+ SIMCRS_ServicePtr_T (new SIMCRS::SIMCRS_Service (lCRSCode,
iScheduleInputFilename));
lDSIM_ServiceContext.setSIMCRS_Service (lSIMCRS_Service);
}
@@ -103,11 +108,11 @@
const double lSimulationMeasure = lSimulationChronometer.elapsed();
// DEBUG
- DSIM_LOG_DEBUG ("Simulation: " << lSimulationMeasure << " - "
- << lDSIM_ServiceContext.display());
+ STDAIR_LOG_DEBUG ("Simulation: " << lSimulationMeasure << " - "
+ << lDSIM_ServiceContext.display());
} catch (const std::exception& error) {
- DSIM_LOG_ERROR ("Exception: " << error.what());
+ STDAIR_LOG_ERROR ("Exception: " << error.what());
throw SimulationException();
}
}
Modified: trunk/dsim/test/dsim/simulate.cpp
===================================================================
--- trunk/dsim/test/dsim/simulate.cpp 2010-01-20 20:11:00 UTC (rev 51)
+++ trunk/dsim/test/dsim/simulate.cpp 2010-01-21 13:25:10 UTC (rev 52)
@@ -26,7 +26,8 @@
logOutputFile.clear();
// Initialise the list of classes/buckets
- DSIM::DSIM_Service dsimService (logOutputFile, lScheduleInputFilename);
+ const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
+ DSIM::DSIM_Service dsimService (lLogParams, lScheduleInputFilename);
// Perform a simulation
dsimService.simulate();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-01-29 15:59:39
|
Revision: 57
http://dsim.svn.sourceforge.net/dsim/?rev=57&view=rev
Author: denis_arnaud
Date: 2010-01-29 15:59:32 +0000 (Fri, 29 Jan 2010)
Log Message:
-----------
[Test] Added test on Boost.SmartPointers.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/boost/Makefile.am
Added Paths:
-----------
trunk/dsim/test/boost/smart_pointers/
trunk/dsim/test/boost/smart_pointers/Makefile.am
trunk/dsim/test/boost/smart_pointers/reference_lost.cpp
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-01-28 19:38:14 UTC (rev 56)
+++ trunk/dsim/configure.ac 2010-01-29 15:59:32 UTC (rev 57)
@@ -507,6 +507,7 @@
test/boost/spirit/Makefile
test/boost/serialization/Makefile
test/boost/signals/Makefile
+ test/boost/smart_pointers/Makefile
test/stdair/Makefile
test/trademgen/Makefile
test/airsched/Makefile
Modified: trunk/dsim/test/boost/Makefile.am
===================================================================
--- trunk/dsim/test/boost/Makefile.am 2010-01-28 19:38:14 UTC (rev 56)
+++ trunk/dsim/test/boost/Makefile.am 2010-01-29 15:59:32 UTC (rev 57)
@@ -5,6 +5,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = accumulators asio filesystem mpi mpl serialization signals spirit
+SUBDIRS = accumulators asio filesystem mpi mpl serialization signals spirit \
+ smart_pointers
EXTRA_DIST =
Property changes on: trunk/dsim/test/boost/smart_pointers
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
reference_lost
Copied: trunk/dsim/test/boost/smart_pointers/Makefile.am (from rev 56, trunk/dsim/test/boost/filesystem/Makefile.am)
===================================================================
--- trunk/dsim/test/boost/smart_pointers/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/smart_pointers/Makefile.am 2010-01-29 15:59:32 UTC (rev 57)
@@ -0,0 +1,19 @@
+## test/boost/smart_pointers sub-directory
+include $(top_srcdir)/Makefile.common
+
+#
+MAINTAINERCLEANFILES = Makefile.in
+
+#
+SUBDIRS =
+
+EXTRA_DIST =
+
+#
+check_PROGRAMS = reference_lost
+
+#
+reference_lost_SOURCES = reference_lost.cpp
+reference_lost_CXXFLAGS = $(BOOST_CFLAGS)
+reference_lost_LDADD =
+reference_lost_LDFLAGS = $(BOOST_LIBS)
Copied: trunk/dsim/test/boost/smart_pointers/reference_lost.cpp (from rev 56, trunk/dsim/test/boost/filesystem/simple_ls.cpp)
===================================================================
--- trunk/dsim/test/boost/smart_pointers/reference_lost.cpp (rev 0)
+++ trunk/dsim/test/boost/smart_pointers/reference_lost.cpp 2010-01-29 15:59:32 UTC (rev 57)
@@ -0,0 +1,53 @@
+// STL
+#include <cassert>
+#include <iostream>
+// Boost
+#include <boost/shared_ptr.hpp>
+
+/** Simple object. */
+class Object {
+public:
+ Object() {
+ std::cout << "Object constructor" << std::endl;
+ }
+ Object(const Object&) {
+ std::cout << "Object copy constructor" << std::endl;
+ }
+ ~Object() {
+ std::cout << "Object destructor" << std::endl;
+ }
+ void display() const {
+ std::cout << "Description: " << _description << std::endl;
+ }
+
+private:
+ /** Description. */
+ std::string _description;
+};
+
+
+/** Pointer on the STDAIR Service handler. */
+typedef boost::shared_ptr<Object> ObjectPtr_T;
+
+
+// ////////////////////// M A I N ///////////////////////
+int main (int argc, char* argv[]) {
+
+ Object* lObject_ptr = new Object;
+ assert (lObject_ptr != NULL);
+ Object& lObject = *lObject_ptr;
+
+ std::cout << "The reference is good?" << std::endl;
+ lObject.display();
+ std::cout << "Yes, the reference is good!" << std::endl;
+
+ {
+ ObjectPtr_T lObjectSmartPtr = ObjectPtr_T (lObject_ptr);
+ }
+
+ std::cout << "The reference is still good?" << std::endl;
+ lObject.display();
+ std::cout << "Yes, the reference is still good!" << std::endl;
+
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-02-06 17:58:50
|
Revision: 61
http://dsim.svn.sourceforge.net/dsim/?rev=61&view=rev
Author: denis_arnaud
Date: 2010-02-06 17:58:43 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
[DB] Added support for database management (still a little work to do).
Modified Paths:
--------------
trunk/dsim/dsim/service/DSIM_Service.cpp
trunk/dsim/test/dsim/simulate.cpp
Property Changed:
----------------
trunk/dsim/
Property changes on: trunk/dsim
___________________________________________________________________
Modified: svn:externals
- config https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/config
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/stdair
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/trademgen
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/airsched
avlcal https://avlcal.svn.sourceforge.net/svnroot/avlcal/trunk/avlcal/avlcal
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/airinv
simfqt https://simfqt.svn.sourceforge.net/svnroot/simfqt/trunk/simfqt/simfqt
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/simcrs
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/rmol
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/travelccm
extracppunit https://extracc.svn.sourceforge.net/svnroot/extracc/trunk/extracc/extracppunit
+ config https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/config
db https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/db
stdair https://stdair.svn.sourceforge.net/svnroot/stdair/trunk/stdair/stdair
trademgen https://trademgen.svn.sourceforge.net/svnroot/trademgen/trunk/trademgen/trademgen
airsched https://air-sched.svn.sourceforge.net/svnroot/air-sched/trunk/airsched/airsched
avlcal https://avlcal.svn.sourceforge.net/svnroot/avlcal/trunk/avlcal/avlcal
airinv https://airinv.svn.sourceforge.net/svnroot/airinv/trunk/airinv/airinv
simfqt https://simfqt.svn.sourceforge.net/svnroot/simfqt/trunk/simfqt/simfqt
simcrs https://simcrs.svn.sourceforge.net/svnroot/simcrs/trunk/simcrs/simcrs
rmol https://rmol.svn.sourceforge.net/svnroot/rmol/trunk/rmol/rmol
travelccm https://travel-ccm.svn.sourceforge.net/svnroot/travel-ccm/trunk/travelccm/travelccm
extracppunit https://extracc.svn.sourceforge.net/svnroot/extracc/trunk/extracc/extracppunit
Modified: trunk/dsim/dsim/service/DSIM_Service.cpp
===================================================================
--- trunk/dsim/dsim/service/DSIM_Service.cpp 2010-02-03 16:28:56 UTC (rev 60)
+++ trunk/dsim/dsim/service/DSIM_Service.cpp 2010-02-06 17:58:43 UTC (rev 61)
@@ -140,15 +140,16 @@
iScheduleInputFilename));
lDSIM_ServiceContext.setSIMCRS_Service (lSIMCRS_Service);
- // TODO: do not hardcode the DBParams.
+ // TODO: do not hardcode the stdair::BasDBParams.
+ // TODO: do not hardcode the demand input file.
// Initialise the TRADEMGEN service handler
- const TRADEMGEN::DBParams lDBParams =
- TRADEMGEN::DBParams ("anguyen", "anguyen", "ncemysqlp.nce.amadeus.net",
- "3321", "sim_anguyen");
+ const stdair::Filename_T lDemandInputFilename ("../../test/samples/demand01.csv");
+ const stdair::BasDBParams lDBParams =
+ stdair::BasDBParams ("dsim", "dsim", "localhost", "3306", "dsim");
TRADEMGEN_ServicePtr_T lTRADEMGEN_Service =
- TRADEMGEN_ServicePtr_T (new TRADEMGEN::TRADEMGEN_Service (lDBParams));
+ TRADEMGEN_ServicePtr_T (new TRADEMGEN::TRADEMGEN_Service (ioSTDAIR_ServicePtr,
+ lDemandInputFilename));
lDSIM_ServiceContext.setTRADEMGEN_Service (lTRADEMGEN_Service);
-
}
// //////////////////////////////////////////////////////////////////////
Modified: trunk/dsim/test/dsim/simulate.cpp
===================================================================
--- trunk/dsim/test/dsim/simulate.cpp 2010-02-03 16:28:56 UTC (rev 60)
+++ trunk/dsim/test/dsim/simulate.cpp 2010-02-06 17:58:43 UTC (rev 61)
@@ -11,8 +11,6 @@
// ///////// M A I N ////////////
int main (int argc, char* argv[]) {
- try {
-
// Schedule input file name
std::string lScheduleInputFilename ("../samples/schedule01.csv");
@@ -32,13 +30,6 @@
// Perform a simulation
dsimService.simulate();
- } catch (const std::exception& stde) {
- std::cerr << "Standard exception: " << stde.what() << std::endl;
- return -1;
-
- } catch (...) {
- return -1;
- }
-
return 0;
}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-02-07 02:41:50
|
Revision: 62
http://dsim.svn.sourceforge.net/dsim/?rev=62&view=rev
Author: denis_arnaud
Date: 2010-02-07 02:41:42 +0000 (Sun, 07 Feb 2010)
Log Message:
-----------
[DB] Now fully support database storage (with a simple example for airline names).
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/dsim/DSIM_Service.hpp
trunk/dsim/dsim/batches/Makefile.am
trunk/dsim/dsim/batches/sources.mk
trunk/dsim/dsim/command/Makefile.am
trunk/dsim/dsim/command/sources.mk
trunk/dsim/dsim/service/DSIM_Service.cpp
trunk/dsim/dsim/service/DSIM_ServiceContext.hpp
trunk/dsim/test/dsim/Makefile.am
trunk/dsim/test/dsim/simulate.cpp
Added Paths:
-----------
trunk/dsim/dsim/batches/simulate.cpp
trunk/dsim/dsim/command/DBManager.cpp
trunk/dsim/dsim/command/DBManager.hpp
trunk/dsim/test/dsim/SimulationTestSuite.cpp
trunk/dsim/test/dsim/SimulationTestSuite.hpp
Property Changed:
----------------
trunk/dsim/dsim/batches/
trunk/dsim/test/dsim/
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-02-06 17:58:43 UTC (rev 61)
+++ trunk/dsim/configure.ac 2010-02-07 02:41:42 UTC (rev 62)
@@ -171,20 +171,20 @@
# -----------------------------------------------------------
# OpenMPI: http://www.open-mpi.org
# -----------------------------------------------------------
-#AX_OPENMPI
-#AC_SUBST(MPIGEN_VERSION)
-#AC_SUBST(MPIGEN_CFLAGS)
-#AC_SUBST(MPIGEN_LIBS)
+AX_OPENMPI
+AC_SUBST(MPIGEN_VERSION)
+AC_SUBST(MPIGEN_CFLAGS)
+AC_SUBST(MPIGEN_LIBS)
# -----------------------------------------------------------
# MPICH2: http://www.mcs.anl.gov/research/projects/mpich2
# Note: Boost.MPI depends on MPICH2 by default, rather than
# on OpenMPI
# -----------------------------------------------------------
-AX_MPICH2
-AC_SUBST(MPIGEN_VERSION)
-AC_SUBST(MPIGEN_CFLAGS)
-AC_SUBST(MPIGEN_LIBS)
+#AX_MPICH2
+#AC_SUBST(MPIGEN_VERSION)
+#AC_SUBST(MPIGEN_CFLAGS)
+#AC_SUBST(MPIGEN_LIBS)
# ---------------------------------------------------------------
# Support for Boost (Extension of the STL): http://www.boost.org
@@ -404,6 +404,7 @@
stdair/Makefile
stdair/basic/Makefile
stdair/bom/Makefile
+ stdair/dbadaptor/Makefile
stdair/factory/Makefile
stdair/config/Makefile
stdair/service/Makefile
Modified: trunk/dsim/dsim/DSIM_Service.hpp
===================================================================
--- trunk/dsim/dsim/DSIM_Service.hpp 2010-02-06 17:58:43 UTC (rev 61)
+++ trunk/dsim/dsim/DSIM_Service.hpp 2010-02-07 02:41:42 UTC (rev 62)
@@ -6,10 +6,17 @@
// //////////////////////////////////////////////////////////////////////
// StdAir
#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/BasLogParams.hpp>
// Dsim
#include <dsim/DSIM_Types.hpp>
+// Forward declarations.
+namespace stdair {
+ class AirlineFeatureSet;
+ class STDAIR_Service;
+ struct BasLogParams;
+ struct BasDBParams;
+}
+
namespace DSIM {
// Forward declaration
@@ -19,37 +26,50 @@
/** Interface for the DSIM Services. */
class DSIM_Service {
public:
- // /////////// Business Methods /////////////
- /** Perform a simulation. */
- void simulate();
-
-
- public:
// ////////// Constructors and destructors //////////
/** Constructor.
<br>The init() method is called; see the corresponding documentation
for more details.
- <br>Moreover, a reference on an output stream is given, so
- that log outputs can be directed onto that stream.
+ <br>A reference on an output stream is given, so that log
+ outputs can be directed onto that stream.
+ <br>Moreover, database connection parameters are given, so that a
+ session can be created on the corresponding database.
@param const stdair::BasLogParams& Parameters for the output log stream.
- @param const stdair::Filename_T& Filename of the input schedule file. */
- DSIM_Service (const stdair::BasLogParams&, const stdair::Filename_T&);
+ @param const stdair::BasDBParams& Parameters for the database access.
+ @param const stdair::Filename_T& Filename of the input schedule file.
+ @param const stdair::Filename_T& Filename of the input demand file. */
+ DSIM_Service (const stdair::BasLogParams&, const stdair::BasDBParams&,
+ const stdair::Filename_T& iScheduleInputFilename,
+ const stdair::Filename_T& iDemandInputFilenames);
/** Constructor.
<br>The init() method is called; see the corresponding documentation
for more details.
<br>Moreover, as no reference on any output stream is given,
- it is assumed that the StdAir log service has already been
- initialised with the proper log output stream by some other
- methods in the calling chain (for instance, when the DSIM_Service
- is itself being initialised by another library service).
- @param const stdair::Filename_T& Filename of the input schedule file. */
- DSIM_Service (const stdair::Filename_T&);
+ neither any database access parameter is given, it is assumed
+ that the StdAir log service has already been initialised with
+ the proper log output stream by some other methods in the
+ calling chain (for instance, when the DSIM_Service is
+ itself being initialised by another library service).
+ @param const stdair::Filename_T& Filename of the input schedule file.
+ @param const stdair::Filename_T& Filename of the input demand file. */
+ DSIM_Service (stdair::STDAIR_ServicePtr_T,
+ const stdair::Filename_T& iScheduleInputFilename,
+ const stdair::Filename_T& iDemandInputFilenames);
/** Destructor. */
~DSIM_Service();
+ public:
+ // /////////// Business Methods /////////////
+ /** Perform a simulation. */
+ void simulate();
+
+ /** Display the list of airlines. */
+ void displayAirlineListFromDB();
+
+
private:
// /////// Construction and Destruction helper methods ///////
/** Default constructor. */
@@ -57,13 +77,6 @@
/** Default copy constructor. */
DSIM_Service (const DSIM_Service&);
- /** Initialise the log. */
- void logInit (const stdair::BasLogParams&);
-
- /** Initialise.
- @param const stdair::Filename_T& Filename of the input schedule file. */
- void init (stdair::STDAIR_ServicePtr_T, const stdair::Filename_T&);
-
/** Initialise the (DSIM) service context (i.e., the
DSIM_ServiceContext object). */
void initServiceContext ();
@@ -72,9 +85,20 @@
<br>A reference on the root of the BOM tree, namely the BomRoot object,
is stored within the service context for later use.
@param const stdair::BasLogParams& Parameters for the output log stream.
- */
- stdair::STDAIR_ServicePtr_T initStdAirService (const stdair::BasLogParams&);
-
+ @param const stdair::BasDBParams& Parameters for the database access.
+ @param const stdair::AirlineFeatureSet& Set of airline features. */
+ void initStdAirService (const stdair::BasLogParams&,
+ const stdair::BasDBParams&);
+
+ /** Initialise.
+ <br>The CSV file, describing the airline schedules for the
+ simulator, is parsed and the inventories are generated accordingly.
+ @param const stdair::AirlineFeatureSet& Set of airline features.
+ @param const stdair::Filename_T& Filename of the input schedule file.
+ @param const stdair::Filename_T& Filename of the input demand file. */
+ void init (const stdair::Filename_T& iScheduleInputFilename,
+ const stdair::Filename_T& iDemandInputFilename);
+
/** Finalise. */
void finalise ();
Property changes on: trunk/dsim/dsim/batches
___________________________________________________________________
Modified: svn:ignore
- .deps
.libs
Makefile.in
Makefile
dsim
+ .deps
.libs
Makefile.in
Makefile
simulate
simulate.log
Modified: trunk/dsim/dsim/batches/Makefile.am
===================================================================
--- trunk/dsim/dsim/batches/Makefile.am 2010-02-06 17:58:43 UTC (rev 61)
+++ trunk/dsim/dsim/batches/Makefile.am 2010-02-07 02:41:42 UTC (rev 62)
@@ -6,10 +6,12 @@
MAINTAINERCLEANFILES = Makefile.in
+
# Binaries (batches)
-bin_PROGRAMS =
+bin_PROGRAMS = simulate
-#airinv_SOURCES = $(batches_h_sources) $(batches_cc_sources)
-#airinv_CXXFLAGS = $(BOOST_CFLAGS)
-#airinv_LDADD =
-#airinv_LDFLAGS = $(BOOST_PROGRAM_OPTIONS_LIB) $(top_builddir)/airinv/core/libairinv.la
+simulate_SOURCES = $(batches_h_sources) $(batches_cc_sources)
+simulate_CXXFLAGS = $(BOOST_CFLAGS)
+simulate_LDADD =
+simulate_LDFLAGS = $(BOOST_PROGRAM_OPTIONS_LIB) $(SOCI_LIBS) \
+ $(top_builddir)/dsim/core/libdsim.la
Added: trunk/dsim/dsim/batches/simulate.cpp
===================================================================
--- trunk/dsim/dsim/batches/simulate.cpp (rev 0)
+++ trunk/dsim/dsim/batches/simulate.cpp 2010-02-07 02:41:42 UTC (rev 62)
@@ -0,0 +1,338 @@
+// STL
+#include <cassert>
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <vector>
+#include <string>
+// Boost (Extended STL)
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/date_time/gregorian/gregorian.hpp>
+#include <boost/tokenizer.hpp>
+#include <boost/program_options.hpp>
+// StdAir
+#include <stdair/STDAIR_Types.hpp>
+#include <stdair/basic/BasLogParams.hpp>
+#include <stdair/basic/BasDBParams.hpp>
+#include <stdair/factory/FacBomContent.hpp>
+#include <stdair/bom/AirlineFeatureSet.hpp>
+#include <stdair/bom/AirlineFeature.hpp>
+// DSIM
+#include <dsim/DSIM_Service.hpp>
+#include <dsim/config/dsim-paths.hpp>
+
+// //////// Type definitions ///////
+typedef std::vector<std::string> WordList_T;
+
+
+// //////// Constants //////
+/** Default name and location for the log file. */
+const std::string K_DSIM_DEFAULT_LOG_FILENAME ("simulate.log");
+
+/** Default name and location for the (CSV) demand input file. */
+const std::string K_DSIM_DEFAULT_DEMAND_INPUT_FILENAME ("../../test/samples/demand01.csv");
+
+/** Default name and location for the (CSV) schedule input file. */
+const std::string K_DSIM_DEFAULT_SCHEDULE_INPUT_FILENAME ("../../test/samples/schedule01.csv");
+
+/** Default query string. */
+const std::string K_DSIM_DEFAULT_QUERY_STRING ("my good old query");
+
+/** Default name and location for the Xapian database. */
+const std::string K_DSIM_DEFAULT_DB_USER ("dsim");
+const std::string K_DSIM_DEFAULT_DB_PASSWD ("dsim");
+const std::string K_DSIM_DEFAULT_DB_DBNAME ("dsim");
+const std::string K_DSIM_DEFAULT_DB_HOST ("localhost");
+const std::string K_DSIM_DEFAULT_DB_PORT ("3306");
+
+
+// //////////////////////////////////////////////////////////////////////
+void tokeniseStringIntoWordList (const std::string& iPhrase,
+ WordList_T& ioWordList) {
+ // Empty the word list
+ ioWordList.clear();
+
+ // Boost Tokeniser
+ typedef boost::tokenizer<boost::char_separator<char> > Tokeniser_T;
+
+ // Define the separators
+ const boost::char_separator<char> lSepatorList(" .,;:|+-*/_=!@#$%`~^&(){}[]?'<>\"");
+
+ // Initialise the phrase to be tokenised
+ Tokeniser_T lTokens (iPhrase, lSepatorList);
+ for (Tokeniser_T::const_iterator tok_iter = lTokens.begin();
+ tok_iter != lTokens.end(); ++tok_iter) {
+ const std::string& lTerm = *tok_iter;
+ ioWordList.push_back (lTerm);
+ }
+
+}
+
+// //////////////////////////////////////////////////////////////////////
+std::string createStringFromWordList (const WordList_T& iWordList) {
+ std::ostringstream oStr;
+
+ unsigned short idx = iWordList.size();
+ for (WordList_T::const_iterator itWord = iWordList.begin();
+ itWord != iWordList.end(); ++itWord, --idx) {
+ const std::string& lWord = *itWord;
+ oStr << lWord;
+ if (idx > 1) {
+ oStr << " ";
+ }
+ }
+
+ return oStr.str();
+}
+
+
+// ///////// Parsing of Options & Configuration /////////
+// A helper function to simplify the main part.
+template<class T> std::ostream& operator<< (std::ostream& os,
+ const std::vector<T>& v) {
+ std::copy (v.begin(), v.end(), std::ostream_iterator<T> (std::cout, " "));
+ return os;
+}
+
+/** Early return status (so that it can be differentiated from an error). */
+const int K_DSIM_EARLY_RETURN_STATUS = 99;
+
+/** Read and parse the command line options. */
+int readConfiguration (int argc, char* argv[],
+ std::string& ioQueryString,
+ stdair::Filename_T& ioScheduleInputFilename,
+ stdair::Filename_T& ioDemandInputFilename,
+ std::string& ioLogFilename,
+ std::string& ioDBUser, std::string& ioDBPasswd,
+ std::string& ioDBHost, std::string& ioDBPort,
+ std::string& ioDBDBName) {
+
+ // Initialise the travel query string, if that one is empty
+ if (ioQueryString.empty() == true) {
+ ioQueryString = K_DSIM_DEFAULT_QUERY_STRING;
+ }
+
+ // Transform the query string into a list of words (STL strings)
+ WordList_T lWordList;
+ tokeniseStringIntoWordList (ioQueryString, lWordList);
+
+ // Declare a group of options that will be allowed only on command line
+ boost::program_options::options_description generic ("Generic options");
+ generic.add_options()
+ ("prefix", "print installation prefix")
+ ("version,v", "print version string")
+ ("help,h", "produce help message");
+
+ // Declare a group of options that will be allowed both on command
+ // line and in config file
+ boost::program_options::options_description config ("Configuration");
+ config.add_options()
+ ("demand,d",
+ boost::program_options::value< std::string >(&ioScheduleInputFilename)->default_value(K_DSIM_DEFAULT_DEMAND_INPUT_FILENAME),
+ "(CVS) input file for the demand distributions")
+ ("schedule,s",
+ boost::program_options::value< std::string >(&ioDemandInputFilename)->default_value(K_DSIM_DEFAULT_SCHEDULE_INPUT_FILENAME),
+ "(CVS) input file for the schedules")
+ ("log,l",
+ boost::program_options::value< std::string >(&ioLogFilename)->default_value(K_DSIM_DEFAULT_LOG_FILENAME),
+ "Filepath for the logs")
+ ("user,u",
+ boost::program_options::value< std::string >(&ioDBUser)->default_value(K_DSIM_DEFAULT_DB_USER),
+ "SQL database hostname (e.g., dsim)")
+ ("passwd,p",
+ boost::program_options::value< std::string >(&ioDBPasswd)->default_value(K_DSIM_DEFAULT_DB_PASSWD),
+ "SQL database hostname (e.g., dsim)")
+ ("host,H",
+ boost::program_options::value< std::string >(&ioDBHost)->default_value(K_DSIM_DEFAULT_DB_HOST),
+ "SQL database hostname (e.g., localhost)")
+ ("port,P",
+ boost::program_options::value< std::string >(&ioDBPort)->default_value(K_DSIM_DEFAULT_DB_PORT),
+ "SQL database port (e.g., 3306)")
+ ("dbname,m",
+ boost::program_options::value< std::string >(&ioDBDBName)->default_value(K_DSIM_DEFAULT_DB_DBNAME),
+ "SQL database name (e.g., dsim)")
+ ("query,q",
+ boost::program_options::value< WordList_T >(&lWordList)->multitoken(),
+ "Query word list")
+ ;
+
+ // Hidden options, will be allowed both on command line and
+ // in config file, but will not be shown to the user.
+ boost::program_options::options_description hidden ("Hidden options");
+ hidden.add_options()
+ ("copyright",
+ boost::program_options::value< std::vector<std::string> >(),
+ "Show the copyright (license)");
+
+ boost::program_options::options_description cmdline_options;
+ cmdline_options.add(generic).add(config).add(hidden);
+
+ boost::program_options::options_description config_file_options;
+ config_file_options.add(config).add(hidden);
+
+ boost::program_options::options_description visible ("Allowed options");
+ visible.add(generic).add(config);
+
+ boost::program_options::positional_options_description p;
+ p.add ("copyright", -1);
+
+ boost::program_options::variables_map vm;
+ boost::program_options::
+ store (boost::program_options::command_line_parser (argc, argv).
+ options (cmdline_options).positional(p).run(), vm);
+
+ std::ifstream ifs ("simulate.cfg");
+ boost::program_options::store (parse_config_file (ifs, config_file_options),
+ vm);
+ boost::program_options::notify (vm);
+
+ if (vm.count ("help")) {
+ std::cout << visible << std::endl;
+ return K_DSIM_EARLY_RETURN_STATUS;
+ }
+
+ if (vm.count ("version")) {
+ std::cout << PACKAGE_NAME << ", version " << PACKAGE_VERSION << std::endl;
+ return K_DSIM_EARLY_RETURN_STATUS;
+ }
+
+ if (vm.count ("prefix")) {
+ std::cout << "Installation prefix: " << PREFIXDIR << std::endl;
+ return K_DSIM_EARLY_RETURN_STATUS;
+ }
+
+ if (vm.count ("schedule")) {
+ ioScheduleInputFilename = vm["schedule"].as< std::string >();
+ std::cout << "Schedule input filename is: " << ioScheduleInputFilename
+ << std::endl;
+ }
+
+ if (vm.count ("demand")) {
+ ioDemandInputFilename = vm["demand"].as< std::string >();
+ std::cout << "Demand input filename is: " << ioDemandInputFilename
+ << std::endl;
+ }
+
+ if (vm.count ("log")) {
+ ioLogFilename = vm["log"].as< std::string >();
+ std::cout << "Log filename is: " << ioLogFilename << std::endl;
+ }
+
+ if (vm.count ("user")) {
+ ioDBUser = vm["user"].as< std::string >();
+ std::cout << "SQL database user name is: " << ioDBUser << std::endl;
+ }
+
+ if (vm.count ("passwd")) {
+ ioDBPasswd = vm["passwd"].as< std::string >();
+ //std::cout << "SQL database user password is: " << ioDBPasswd << std::endl;
+ }
+
+ if (vm.count ("host")) {
+ ioDBHost = vm["host"].as< std::string >();
+ std::cout << "SQL database host name is: " << ioDBHost << std::endl;
+ }
+
+ if (vm.count ("port")) {
+ ioDBPort = vm["port"].as< std::string >();
+ std::cout << "SQL database port number is: " << ioDBPort << std::endl;
+ }
+
+ if (vm.count ("dbname")) {
+ ioDBDBName = vm["dbname"].as< std::string >();
+ std::cout << "SQL database name is: " << ioDBDBName << std::endl;
+ }
+
+ ioQueryString = createStringFromWordList (lWordList);
+ std::cout << "The query string is: " << ioQueryString << std::endl;
+
+ return 0;
+}
+
+// ///////// M A I N ////////////
+int main (int argc, char* argv[]) {
+
+ try {
+
+ // Query
+ std::string lQuery;
+
+ // Schedule input file name
+ stdair::Filename_T lScheduleInputFilename;
+
+ // Demand input file name
+ stdair::Filename_T lDemandInputFilename;
+
+ // Output log File
+ std::string lLogFilename;
+
+ // SQL database parameters
+ std::string lDBUser;
+ std::string lDBPasswd;
+ std::string lDBHost;
+ std::string lDBPort;
+ std::string lDBDBName;
+
+ // Airline code
+ stdair::AirlineCode_T lAirlineCode ("BA");
+
+ // Call the command-line option parser
+ const int lOptionParserStatus =
+ readConfiguration (argc, argv, lQuery, lScheduleInputFilename,
+ lDemandInputFilename, lLogFilename,
+ lDBUser, lDBPasswd, lDBHost, lDBPort, lDBDBName);
+
+ if (lOptionParserStatus == K_DSIM_EARLY_RETURN_STATUS) {
+ return 0;
+ }
+
+ // Set the database parameters
+ stdair::BasDBParams lDBParams (lDBUser, lDBPasswd, lDBHost, lDBPort,
+ lDBDBName);
+
+ // Set the log parameters
+ std::ofstream logOutputFile;
+ // open and clean the log outputfile
+ logOutputFile.open (lLogFilename.c_str());
+ logOutputFile.clear();
+
+ // Initialise the set of required airline features
+ stdair::AirlineFeatureSet& lAirlineFeatureSet =
+ stdair::FacBomContent::instance().create<stdair::AirlineFeatureSet>();
+
+ // Initialise an AirlineFeature object
+ stdair::AirlineFeatureKey_T lAirlineFeatureKey (lAirlineCode);
+ stdair::AirlineFeature& lAirlineFeature = stdair::FacBomContent::
+ instance().create<stdair::AirlineFeature> (lAirlineFeatureKey);
+ stdair::FacBomContent::
+ linkWithParent<stdair::AirlineFeature> (lAirlineFeature,
+ lAirlineFeatureSet);
+
+ // Initialise the simulation context
+ const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
+ DSIM::DSIM_Service dsimService (lLogParams, lDBParams,
+ lScheduleInputFilename,
+ lDemandInputFilename);
+
+ // Perform a simulation
+ dsimService.simulate();
+
+ // DEBUG
+ // Display the airlines stored in the database
+ dsimService.displayAirlineListFromDB();
+
+ } catch (const DSIM::RootException& otexp) {
+ std::cerr << "Standard exception: " << otexp.what() << std::endl;
+ return -1;
+
+ } catch (const std::exception& stde) {
+ std::cerr << "Standard exception: " << stde.what() << std::endl;
+ return -1;
+
+ } catch (...) {
+ return -1;
+ }
+
+ return 0;
+}
+
Modified: trunk/dsim/dsim/batches/sources.mk
===================================================================
--- trunk/dsim/dsim/batches/sources.mk 2010-02-06 17:58:43 UTC (rev 61)
+++ trunk/dsim/dsim/batches/sources.mk 2010-02-07 02:41:42 UTC (rev 62)
@@ -1,2 +1,2 @@
batches_h_sources =
-batches_cc_sources =
+batches_cc_sources = $(top_srcdir)/dsim/batches/simulate.cpp
Added: trunk/dsim/dsim/command/DBManager.cpp
===================================================================
--- trunk/dsim/dsim/command/DBManager.cpp (rev 0)
+++ trunk/dsim/dsim/command/DBManager.cpp 2010-02-07 02:41:42 UTC (rev 62)
@@ -0,0 +1,166 @@
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STL
+#include <cassert>
+// SOCI
+#include <soci/core/soci.h>
+#include <soci/backends/mysql/soci-mysql.h>
+// StdAir
+#include <stdair/bom/AirlineStruct.hpp>
+#include <stdair/dbadaptor/DbaAirline.hpp>
+#include <stdair/service/Logger.hpp>
+// Dsim
+#include <dsim/command/DBManager.hpp>
+
+namespace DSIM {
+
+ // //////////////////////////////////////////////////////////////////////
+ void DBManager::
+ prepareSelectStatement (stdair::DBSession_T& ioSociSession,
+ stdair::DBRequestStatement_T& ioSelectStatement,
+ stdair::AirlineStruct& ioAirline) {
+
+ try {
+
+ // Instanciate a SQL statement (no request is performed at that stage)
+ /**
+ select code, name
+ from airlines;
+ */
+
+ ioSelectStatement = (ioSociSession.prepare
+ << "select iata_code, name "
+ << "from airlines ", soci::into (ioAirline));
+
+ // Execute the SQL query
+ ioSelectStatement.execute();
+
+ } catch (std::exception const& lException) {
+ STDAIR_LOG_ERROR ("Error: " << lException.what());
+ throw SQLDatabaseException();
+ }
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ void DBManager::
+ prepareSelectOnAirlineCodeStatement (stdair::DBSession_T& ioSociSession,
+ stdair::DBRequestStatement_T& ioSelectStatement,
+ const stdair::AirlineCode_T& iAirlineCode,
+ stdair::AirlineStruct& ioAirline) {
+
+ try {
+
+ // Instanciate a SQL statement (no request is performed at that stage)
+ /**
+ select code, name
+ from airlines
+ where code = iAirlineCode;
+ */
+
+ ioSelectStatement = (ioSociSession.prepare
+ << "select iata_code, name "
+ << "from airlines "
+ << "where iata_code = :airline_code ",
+ soci::into (ioAirline), soci::use (iAirlineCode));
+
+ // Execute the SQL query
+ ioSelectStatement.execute();
+
+ } catch (std::exception const& lException) {
+ STDAIR_LOG_ERROR ("Error: " << lException.what());
+ throw SQLDatabaseException();
+ }
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ bool DBManager::iterateOnStatement (stdair::DBRequestStatement_T& ioStatement,
+ stdair::AirlineStruct& ioAirline) {
+ bool hasStillData = false;
+
+ try {
+
+ // Retrieve the next row of Airline object
+ hasStillData = ioStatement.fetch();
+
+ } catch (std::exception const& lException) {
+ STDAIR_LOG_ERROR ("Error: " << lException.what());
+ throw SQLDatabaseException();
+ }
+
+ return hasStillData;
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ void DBManager::updateAirlineInDB (stdair::DBSession_T& ioSociSession,
+ const stdair::AirlineStruct& iAirline) {
+
+ try {
+
+ // Begin a transaction on the database
+ ioSociSession.begin();
+
+ // Retrieve the airline code
+ const std::string& lAirlineCode = iAirline.getAirlineCode();
+
+ // Retrieve the airline name
+ const std::string& lAirlineName = iAirline.getAirlineName();
+
+ // Instanciate a SQL statement (no request is performed at that stage)
+ stdair::DBRequestStatement_T lUpdateStatement =
+ (ioSociSession.prepare
+ << "update airlines "
+ << "set name = :name "
+ << "where iata_code = :iata_code",
+ soci::use (lAirlineName), soci::use (lAirlineCode));
+
+ // Execute the SQL query
+ lUpdateStatement.execute (true);
+
+ // Commit the transaction on the database
+ ioSociSession.commit();
+
+ // Debug
+ // STDAIR_LOG_DEBUG ("[" << lAirlineCode << "] " << iAirline);
+
+ } catch (std::exception const& lException) {
+ STDAIR_LOG_ERROR ("Error: " << lException.what());
+ throw SQLDatabaseException();
+ }
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ bool DBManager::retrieveAirline (stdair::DBSession_T& ioSociSession,
+ const stdair::AirlineCode_T& iAirlineCode,
+ stdair::AirlineStruct& ioAirline) {
+ bool oHasRetrievedAirline = false;
+
+ try {
+
+ // Prepare the SQL request corresponding to the select statement
+ stdair::DBRequestStatement_T lSelectStatement (ioSociSession);
+ DBManager::prepareSelectOnAirlineCodeStatement (ioSociSession,
+ lSelectStatement,
+ iAirlineCode, ioAirline);
+ const bool shouldDoReset = true;
+ bool hasStillData = iterateOnStatement (lSelectStatement, ioAirline);
+ if (hasStillData == true) {
+ oHasRetrievedAirline = true;
+ }
+
+ // Sanity check
+ const bool shouldNotDoReset = false;
+ hasStillData = iterateOnStatement (lSelectStatement, ioAirline);
+
+ // Debug
+ // STDAIR_LOG_DEBUG ("[" << iDocID << "] " << ioAirline);
+
+ } catch (std::exception const& lException) {
+ STDAIR_LOG_ERROR ("Error: " << lException.what());
+ throw SQLDatabaseException();
+ }
+
+ return oHasRetrievedAirline;
+ }
+
+}
Added: trunk/dsim/dsim/command/DBManager.hpp
===================================================================
--- trunk/dsim/dsim/command/DBManager.hpp (rev 0)
+++ trunk/dsim/dsim/command/DBManager.hpp 2010-02-07 02:41:42 UTC (rev 62)
@@ -0,0 +1,77 @@
+#ifndef __DSIM_CMD_DBMANAGER_HPP
+#define __DSIM_CMD_DBMANAGER_HPP
+
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// StdAir
+#include <stdair/STDAIR_Types.hpp>
+// Dsim
+#include <dsim/DSIM_Types.hpp>
+
+namespace DSIM {
+
+ // Forward declarations
+ struct AirlineStruct;
+
+ /** Class building the Business Object Model (BOM) from data retrieved
+ from the database. */
+ class DBManager {
+ public:
+ /** Update the fields of the database row
+ corresponding to the given BOM object.
+ @parameter stdair::DBSession_T&
+ @parameter stdair::AirlineStruct& . */
+ static void updateAirlineInDB (stdair::DBSession_T&,
+ const stdair::AirlineStruct&);
+
+ /** Retrieve, from the (MySQL) database, the row corresponding to
+ the given BOM code, and fill the given BOM object with that retrieved
+ data.
+ @parameter stdair::DBSession_T&
+ @parameter const stdair::AirlineCode_T&
+ @parameter stdair::AirlineStruct& . */
+ static bool retrieveAirline (stdair::DBSession_T&,
+ const stdair::AirlineCode_T&,
+ stdair::AirlineStruct&);
+
+
+ public:
+ /** Prepare (parse and put in cache) the SQL statement.
+ @parameter stdair::DBSession_T&
+ @parameter stdair::DBRequestStatement_T&
+ @parameter stdair::AirlineStruct& . */
+ static void prepareSelectStatement (stdair::DBSession_T&,
+ stdair::DBRequestStatement_T&,
+ stdair::AirlineStruct&);
+
+ /** Iterate on the SQL statement.
+ <br>The SQL has to be already prepared.
+ @parameter stdair::DBRequestStatement_T&
+ @parameter stdair::AirlineStruct& . */
+ static bool iterateOnStatement (stdair::DBRequestStatement_T&,
+ stdair::AirlineStruct&);
+
+
+ private:
+ /** Prepare (parse and put in cache) the SQL statement.
+ @parameter stdair::DBSession_T&
+ @parameter stdair...
[truncated message content] |
|
From: <den...@us...> - 2010-02-07 19:45:38
|
Revision: 63
http://dsim.svn.sourceforge.net/dsim/?rev=63&view=rev
Author: denis_arnaud
Date: 2010-02-07 19:45:32 +0000 (Sun, 07 Feb 2010)
Log Message:
-----------
1. Integrated more initialisation procedures within the STDAIR_Service object. 2. Added a sample stdair::DBManagerForAirlines class.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/dsim/DSIM_Service.hpp
trunk/dsim/dsim/batches/simulate.cpp
trunk/dsim/dsim/service/DSIM_Service.cpp
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-02-07 02:41:42 UTC (rev 62)
+++ trunk/dsim/configure.ac 2010-02-07 19:45:32 UTC (rev 63)
@@ -406,6 +406,7 @@
stdair/bom/Makefile
stdair/dbadaptor/Makefile
stdair/factory/Makefile
+ stdair/command/Makefile
stdair/config/Makefile
stdair/service/Makefile
stdair/core/Makefile
Modified: trunk/dsim/dsim/DSIM_Service.hpp
===================================================================
--- trunk/dsim/dsim/DSIM_Service.hpp 2010-02-07 02:41:42 UTC (rev 62)
+++ trunk/dsim/dsim/DSIM_Service.hpp 2010-02-07 19:45:32 UTC (rev 63)
@@ -67,7 +67,7 @@
void simulate();
/** Display the list of airlines. */
- void displayAirlineListFromDB();
+ void displayAirlineListFromDB() const;
private:
Modified: trunk/dsim/dsim/batches/simulate.cpp
===================================================================
--- trunk/dsim/dsim/batches/simulate.cpp 2010-02-07 02:41:42 UTC (rev 62)
+++ trunk/dsim/dsim/batches/simulate.cpp 2010-02-07 19:45:32 UTC (rev 63)
@@ -15,8 +15,6 @@
#include <stdair/basic/BasLogParams.hpp>
#include <stdair/basic/BasDBParams.hpp>
#include <stdair/factory/FacBomContent.hpp>
-#include <stdair/bom/AirlineFeatureSet.hpp>
-#include <stdair/bom/AirlineFeature.hpp>
// DSIM
#include <dsim/DSIM_Service.hpp>
#include <dsim/config/dsim-paths.hpp>
@@ -296,18 +294,6 @@
logOutputFile.open (lLogFilename.c_str());
logOutputFile.clear();
- // Initialise the set of required airline features
- stdair::AirlineFeatureSet& lAirlineFeatureSet =
- stdair::FacBomContent::instance().create<stdair::AirlineFeatureSet>();
-
- // Initialise an AirlineFeature object
- stdair::AirlineFeatureKey_T lAirlineFeatureKey (lAirlineCode);
- stdair::AirlineFeature& lAirlineFeature = stdair::FacBomContent::
- instance().create<stdair::AirlineFeature> (lAirlineFeatureKey);
- stdair::FacBomContent::
- linkWithParent<stdair::AirlineFeature> (lAirlineFeature,
- lAirlineFeatureSet);
-
// Initialise the simulation context
const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
DSIM::DSIM_Service dsimService (lLogParams, lDBParams,
Modified: trunk/dsim/dsim/service/DSIM_Service.cpp
===================================================================
--- trunk/dsim/dsim/service/DSIM_Service.cpp 2010-02-07 02:41:42 UTC (rev 62)
+++ trunk/dsim/dsim/service/DSIM_Service.cpp 2010-02-07 19:45:32 UTC (rev 63)
@@ -210,7 +210,7 @@
}
// //////////////////////////////////////////////////////////////////////
- void DSIM_Service::displayAirlineListFromDB () {
+ void DSIM_Service::displayAirlineListFromDB () const {
if (_dsimServiceContext == NULL) {
throw NonInitialisedServiceException();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-02-28 01:19:06
|
Revision: 71
http://dsim.svn.sourceforge.net/dsim/?rev=71&view=rev
Author: denis_arnaud
Date: 2010-02-28 01:18:59 +0000 (Sun, 28 Feb 2010)
Log Message:
-----------
[Test] Added a directory for Boost.IOStreams.
Modified Paths:
--------------
trunk/dsim/configure.ac
Added Paths:
-----------
trunk/dsim/test/boost/iostreams/
trunk/dsim/test/boost/iostreams/Makefile.am
trunk/dsim/test/boost/iostreams/filereader.cpp
trunk/dsim/test/boost/iostreams/filetoberead.csv
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-02-23 14:29:43 UTC (rev 70)
+++ trunk/dsim/configure.ac 2010-02-28 01:18:59 UTC (rev 71)
@@ -199,6 +199,7 @@
AC_SUBST(BOOST_THREAD_LIB)
AC_SUBST(BOOST_PYTHON_LIB)
AC_SUBST(BOOST_SIGNALS_LIB)
+AC_SUBST(BOOST_IOSTREAMS_LIB)
AC_SUBST(BOOST_ASIO_LIB)
AC_SUBST(BOOST_MPI_LIB)
AC_SUBST(BOOST_MPI_PYTHON_LIB)
@@ -504,6 +505,7 @@
test/boost/asio/logd/Makefile
test/boost/asio/logger/Makefile
test/boost/filesystem/Makefile
+ test/boost/iostreams/Makefile
test/boost/mpi/Makefile
test/boost/mpl/Makefile
test/boost/spirit/Makefile
@@ -609,6 +611,7 @@
o BOOST_FS_LIB .... : ${BOOST_FILESYSTEM_LIB}
o BOOST_THRD_LIB .. : ${BOOST_THREAD_LIB}
o BOOST_PY_LIB .... : ${BOOST_PYTHON_LIB}
+ o BOOST_IOSTR_LIB . : ${BOOST_IOSTREAMS_LIB}
o BOOST_ASIO_LIB .. : ${BOOST_ASIO_LIB}
o BOOST_SIG_LIB ... : ${BOOST_SIGNALS_LIB}
o BOOST_MPI_LIB ... : ${BOOST_MPI_LIB}
Property changes on: trunk/dsim/test/boost/iostreams
___________________________________________________________________
Added: svn:ignore
+ .deps
.libs
Makefile.in
Makefile
filereader
Added: trunk/dsim/test/boost/iostreams/Makefile.am
===================================================================
--- trunk/dsim/test/boost/iostreams/Makefile.am (rev 0)
+++ trunk/dsim/test/boost/iostreams/Makefile.am 2010-02-28 01:18:59 UTC (rev 71)
@@ -0,0 +1,17 @@
+## test/boost/iostreams sub-directory
+include $(top_srcdir)/Makefile.common
+
+##
+SUBDIRS =
+
+MAINTAINERCLEANFILES = Makefile.in
+
+EXTRA_DIST =
+
+#
+check_PROGRAMS = filereader
+
+filereader_SOURCES = filereader.cpp
+filereader_CXXFLAGS = $(BOOST_CFLAGS) $(BOOST_CFLAGS)
+filereader_LDFLAGS = $(BOOST_LIBS) $(BOOST_ASIO_LIB) $(BOOST_IOSTREAMS_LIB)
+filereader_LDADD =
Added: trunk/dsim/test/boost/iostreams/filereader.cpp
===================================================================
--- trunk/dsim/test/boost/iostreams/filereader.cpp (rev 0)
+++ trunk/dsim/test/boost/iostreams/filereader.cpp 2010-02-28 01:18:59 UTC (rev 71)
@@ -0,0 +1,46 @@
+// STL
+#include <cassert>
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <streambuf>
+// Boost
+
+
+// ////////////////// M A I N ////////////////////////
+int main (int argc, char* argv[]) {
+
+ // Input file name
+ const std::string lInputFilename ("filetoberead.csv");
+
+ // Open the input file
+ std::ifstream lInputFile (lInputFilename.c_str());
+
+ // Get a handler (pointer) on the underlying buffer stream
+ std::streambuf* lInputFileBuffer_ptr = lInputFile.rdbuf();
+
+ // Get the number of characters within the input file
+ const unsigned long nbChars = lInputFileBuffer_ptr->in_avail();
+
+ // DEBUG
+ std::cout << "Number of characters in the file '" << lInputFilename << "': "
+ << nbChars << std::endl;
+
+ // Instantiate a character buffer for that number of characters
+ char lBufferChar[nbChars];
+
+ // Read that number of characters from the input file, and put it directly into the
+ // character buffer
+ lInputFileBuffer_ptr->sgetn (lBufferChar, nbChars);
+
+ // Instantiate an input stream with the character buffer
+ std::istringstream iStr (lBufferChar);
+ // std::ostringstream iStr (lBufferChar);
+
+ // DEBUG
+ // std::cout << "The file contains: " << iStr.str() << std::endl;
+
+ return 0;
+}
+
Added: trunk/dsim/test/boost/iostreams/filetoberead.csv
===================================================================
--- trunk/dsim/test/boost/iostreams/filetoberead.csv (rev 0)
+++ trunk/dsim/test/boost/iostreams/filetoberead.csv 2010-02-28 01:18:59 UTC (rev 71)
@@ -0,0 +1,7 @@
+NCE,CDG,1
+NCE,ORY,1
+NCE,LYS,1
+NCE,MRS,1
+NCE,TLS,1
+NCE,SXB,1
+NCE,CFE,1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-04-23 16:20:56
|
Revision: 77
http://dsim.svn.sourceforge.net/dsim/?rev=77&view=rev
Author: denis_arnaud
Date: 2010-04-23 16:20:50 +0000 (Fri, 23 Apr 2010)
Log Message:
-----------
[Structure] The AirRac is now compiled.
Modified Paths:
--------------
trunk/dsim/Makefile.am
trunk/dsim/configure.ac
trunk/dsim/test/Makefile.am
Modified: trunk/dsim/Makefile.am
===================================================================
--- trunk/dsim/Makefile.am 2010-04-23 15:59:54 UTC (rev 76)
+++ trunk/dsim/Makefile.am 2010-04-23 16:20:50 UTC (rev 77)
@@ -24,8 +24,8 @@
EXTRA_DIST = @PACKAGE@.spec @PACKAGE@.m4 @PACKAGE@.pc Makefile.common
# Build in these directories:
-SUBDIRS = stdair trademgen airsched rmol airinv avlcal simfqt simcrs travelccm \
- dsim extracppunit $(TEST_DIR)
+SUBDIRS = stdair trademgen airsched airrac rmol airinv avlcal simfqt simcrs \
+ travelccm dsim extracppunit $(TEST_DIR)
# Configuration helpers
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-04-23 15:59:54 UTC (rev 76)
+++ trunk/dsim/configure.ac 2010-04-23 16:20:50 UTC (rev 77)
@@ -432,6 +432,15 @@
airsched/config/Makefile
airsched/core/Makefile
airsched/batches/Makefile
+ airrac/Makefile
+ airrac/basic/Makefile
+ airrac/bom/Makefile
+ airrac/factory/Makefile
+ airrac/command/Makefile
+ airrac/service/Makefile
+ airrac/config/Makefile
+ airrac/core/Makefile
+ airrac/batches/Makefile
rmol/Makefile
rmol/basic/Makefile
rmol/field/Makefile
@@ -516,6 +525,7 @@
test/stdair/Makefile
test/trademgen/Makefile
test/airsched/Makefile
+ test/airrac/Makefile
test/rmol/Makefile
test/airinv/Makefile
test/avlcal/Makefile
Modified: trunk/dsim/test/Makefile.am
===================================================================
--- trunk/dsim/test/Makefile.am 2010-04-23 15:59:54 UTC (rev 76)
+++ trunk/dsim/test/Makefile.am 2010-04-23 16:20:50 UTC (rev 77)
@@ -5,7 +5,8 @@
##
SUBDIRS = boost samples \
- stdair trademgen airsched rmol airinv avlcal simfqt simcrs travelccm dsim
+ stdair trademgen airsched airrac rmol airinv avlcal simfqt simcrs \
+ travelccm dsim
EXTRA_DIST =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-06-13 19:42:05
|
Revision: 85
http://dsim.svn.sourceforge.net/dsim/?rev=85&view=rev
Author: denis_arnaud
Date: 2010-06-13 19:41:59 +0000 (Sun, 13 Jun 2010)
Log Message:
-----------
[Test] Updated the dependency for the new ExtraCPPUnit library name.
Modified Paths:
--------------
trunk/dsim/configure.ac
trunk/dsim/test/dsim/Makefile.am
trunk/dsim/test/dsim/SimulationTestSuite.cpp
Modified: trunk/dsim/configure.ac
===================================================================
--- trunk/dsim/configure.ac 2010-06-13 19:41:41 UTC (rev 84)
+++ trunk/dsim/configure.ac 2010-06-13 19:41:59 UTC (rev 85)
@@ -138,6 +138,7 @@
fi
AC_SUBST(CXXFLAGS_OPT)
+
# -----------------------------------------------------------------------------
# Support for ExtraCC (Extra-CruiseControl): http://sf.net/projects/extracc
# -----------------------------------------------------------------------------
@@ -644,6 +645,11 @@
o XERCES_CFLAGS ... : ${XERCES_CFLAGS}
o XERCES_LIBS ..... : ${XERCES_LIBS}
+ - ExtraCC ........... :
+ o EXTRACC_VERSION . : ${EXTRACC_VERSION}
+ o EXTRACC_CFLAGS .. : ${EXTRACC_CFLAGS}
+ o EXTRACC_LIBS .... : ${EXTRACC_LIBS}
+
- CPPUNIT............ :
o CPPUNIT_VERSION . : ${CPPUNIT_VERSION}
o CPPUNIT_CFLAGS .. : ${CPPUNIT_CFLAGS}
Modified: trunk/dsim/test/dsim/Makefile.am
===================================================================
--- trunk/dsim/test/dsim/Makefile.am 2010-06-13 19:41:41 UTC (rev 84)
+++ trunk/dsim/test/dsim/Makefile.am 2010-06-13 19:41:59 UTC (rev 85)
@@ -18,7 +18,7 @@
SimulationTestSuite_LDADD =
SimulationTestSuite_LDFLAGS = \
$(BOOST_LIBS) $(CPPUNIT_LIBS) \
- $(top_builddir)/extracppunit/libextracc-extracppunit.la \
+ $(top_builddir)/extracppunit/libextracppunit.la \
$(top_builddir)/stdair/core/libstdair.la \
$(top_builddir)/dsim/core/libdsim.la
@@ -28,3 +28,4 @@
#simulate_LDFLAGS = $(BOOST_LIBS) \
# $(top_builddir)/stdair/core/libstdair.la \
# $(top_builddir)/dsim/core/libdsim.la
+
Modified: trunk/dsim/test/dsim/SimulationTestSuite.cpp
===================================================================
--- trunk/dsim/test/dsim/SimulationTestSuite.cpp 2010-06-13 19:41:41 UTC (rev 84)
+++ trunk/dsim/test/dsim/SimulationTestSuite.cpp 2010-06-13 19:41:59 UTC (rev 85)
@@ -39,9 +39,9 @@
// Initialise the simulation context
const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
- const stdair::BasDBParams lDBParams ("anguyen", "anguyen",
- "ncemysqlp.nce.amadeus.net", "3321",
- "sim_anguyen");
+ const stdair::BasDBParams lDBParams ("dsim", "dsim",
+ "localhost", "3306",
+ "sim_dsim");
DSIM::DSIM_Service dsimService (lLogParams, lDBParams,
lScheduleInputFilename,
lDemandInputFilename);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-07-20 22:17:50
|
Revision: 102
http://dsim.svn.sourceforge.net/dsim/?rev=102&view=rev
Author: denis_arnaud
Date: 2010-07-20 22:17:42 +0000 (Tue, 20 Jul 2010)
Log Message:
-----------
[Doc] Added structure to generate documentation (with Doxygen).
Modified Paths:
--------------
trunk/dsim/COPYING
trunk/dsim/Makefile.am
trunk/dsim/configure.ac
Added Paths:
-----------
trunk/dsim/doc/Makefile.am
trunk/dsim/doc/doxygen_html.cfg.in
trunk/dsim/doc/images/
trunk/dsim/doc/images/Makefile
trunk/dsim/doc/images/Makefile.am
trunk/dsim/doc/images/Makefile.in
trunk/dsim/doc/images/dsim_logo.png
trunk/dsim/doc/images/dsim_logo.xcf
trunk/dsim/doc/images/favicon.ico
trunk/dsim/doc/images/sfx_logo.png
trunk/dsim/doc/local/
trunk/dsim/doc/local/Makefile
trunk/dsim/doc/local/Makefile.am
trunk/dsim/doc/local/Makefile.in
trunk/dsim/doc/local/authors.doc
trunk/dsim/doc/local/codingrules.doc
trunk/dsim/doc/local/copyright.doc
trunk/dsim/doc/local/documentation.doc
trunk/dsim/doc/local/dsim_footer.html
trunk/dsim/doc/local/dsim_header.html
trunk/dsim/doc/local/features.doc
trunk/dsim/doc/local/help_wanted.doc
trunk/dsim/doc/local/index.doc.in
trunk/dsim/doc/local/installation.doc
trunk/dsim/doc/local/linking.doc
trunk/dsim/doc/local/sources.mk
trunk/dsim/doc/local/test.doc
trunk/dsim/doc/local/users_guide.doc
trunk/dsim/doc/local/verification.doc
trunk/dsim/doc/sourceforge/
trunk/dsim/doc/sourceforge/howto_release_dsim.html.in
trunk/dsim/doc/sourceforge/howto_release_stdair.html
trunk/dsim/doc/tutorial/
trunk/dsim/doc/tutorial/Makefile
trunk/dsim/doc/tutorial/Makefile.am
trunk/dsim/doc/tutorial/Makefile.in
trunk/dsim/doc/tutorial/bpsk.doc
trunk/dsim/doc/tutorial/convcode.doc
trunk/dsim/doc/tutorial/interleaver.doc
trunk/dsim/doc/tutorial/itfile.doc
trunk/dsim/doc/tutorial/ldpc_bersim_awgn.doc
trunk/dsim/doc/tutorial/ldpc_gen_codes.doc
trunk/dsim/doc/tutorial/matlab_itpp.doc
trunk/dsim/doc/tutorial/mimoconv.doc
trunk/dsim/doc/tutorial/mog.doc
trunk/dsim/doc/tutorial/qpsk_simulation.doc
trunk/dsim/doc/tutorial/rayleigh.doc
trunk/dsim/doc/tutorial/reedsolomon.doc
trunk/dsim/doc/tutorial/sources.mk
trunk/dsim/doc/tutorial/spread.doc
trunk/dsim/doc/tutorial/src/
trunk/dsim/doc/tutorial/src/Makefile
trunk/dsim/doc/tutorial/src/Makefile.am
trunk/dsim/doc/tutorial/src/Makefile.in
trunk/dsim/doc/tutorial/src/bpsk.cpp
trunk/dsim/doc/tutorial/src/bpsk.ref
trunk/dsim/doc/tutorial/src/convcode.cpp
trunk/dsim/doc/tutorial/src/convcode.ref
trunk/dsim/doc/tutorial/src/interleaver.cpp
trunk/dsim/doc/tutorial/src/interleaver.ref
trunk/dsim/doc/tutorial/src/ldpc_bersim_awgn.cpp
trunk/dsim/doc/tutorial/src/ldpc_gen_codes.cpp
trunk/dsim/doc/tutorial/src/mimoconv.cpp
trunk/dsim/doc/tutorial/src/mog.cpp
trunk/dsim/doc/tutorial/src/qpsk_simulation.cpp
trunk/dsim/doc/tutorial/src/qpsk_simulation.ref
trunk/dsim/doc/tutorial/src/rayleigh.cpp
trunk/dsim/doc/tutorial/src/read_it_file.cpp
trunk/dsim/doc/tutorial/src/reedsolomon.cpp
trunk/dsim/doc/tutorial/src/reedsolomon.ref
trunk/dsim/doc/tutorial/src/sources.mk
trunk/dsim/doc/tutorial/src/spread.cpp
trunk/dsim/doc/tutorial/src/spread.ref
trunk/dsim/doc/tutorial/src/timer.cpp
trunk/dsim/doc/tutorial/src/timer.ref
trunk/dsim/doc/tutorial/src/vector_and_matrix.cpp
trunk/dsim/doc/tutorial/src/vector_and_matrix.ref
trunk/dsim/doc/tutorial/src/write_it_file.cpp
trunk/dsim/doc/tutorial/timer.doc
trunk/dsim/doc/tutorial/tutorial.doc
trunk/dsim/doc/tutorial/vector_and_matrix.doc
Property Changed:
----------------
trunk/dsim/doc/
trunk/dsim/test/master_slave/
Modified: trunk/dsim/COPYING
===================================================================
--- trunk/dsim/COPYING 2010-07-16 14:15:14 UTC (rev 101)
+++ trunk/dsim/COPYING 2010-07-20 22:17:42 UTC (rev 102)
@@ -1,674 +1,504 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
+ Preamble
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
- The precise terms and conditions for copying, distribution and
-modification follow.
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
- TERMS AND CONDITIONS
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
- 0. Definitions.
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
- "This License" refers to version 3 of the GNU General Public License.
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
- A "covered work" means either the unmodified Program or a work based
-on the Program.
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
- 1. Source Code.
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
+ a) The modified work must itself be a software library.
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
- The Corresponding Source for a work in source code form is that
-same work.
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
- 2. Basic Permissions.
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
- 4. Conveying Verbatim Copies.
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
- 5. Conveying Modified Source Versions.
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Libra...
[truncated message content] |