CSVFileReader is a specialisation of TextFileReader, that allow reading
a CSV line field by field.
TextFileReader:
- Make private attributes protected to allow derivation.
- Add attribute current_line_nb.
- Add function read_nonblank_line().
- Delete useless accessor get_name().
Update InputCSV to use CSVFileReader.
Adapt unit tests for InputCSV and InputLogCSV: EOF is not reached right
after reading the last line, but after trying (and failing) to read one
more line.
TextFileReader read lines from a text file. It is aimed to be used by
all classes that read from a text file, as TextFileWriter is used by
those which write to a text file.
Code of TextFileReader is taken from class InputCSV.
Minor fixes on the TextFileWriter unit test.
Fix mistake in TextFileWriter::TextFileWriter(), that thrown
error_opening_input_file instead of error_opening_output_file.
Creation of class error_opening_output_file in posexcept.
- Add function set_coordinates(float, float, float).
- Add function distance_to_sphere().
- Suppress calls by reference for simple types (use const float instead
of const &float).
TextFileWriter:
- OutputFileMedium becomes TextFileWriter.
- Method write_string_to_file() becomes write_text() and is made public.
- Add a unit test.
InputLogCSV and OutputCSV do not extend OutputFileMedium anymore, but
use a TextFileWriter as an attribute.
OutputCSV writes Result to a CSV file. It extends OutputFileMedium.
Update:
- Output.
- UserInterface (add option "output.csv-file").
- posexcept (add class no_output_csv_file).
OutputFileMedium is designed to be a super-class for classes that need
to write to a text file. It could also be a simple writer if the method
write_string_to_file() was public (maybe we should change that and
rename OutputFileMedium to OutputFileWriter or something like that).
InputLogCSV:
- Now extends InputLogMedium *and* OutputFileMedium.
- Make log_request() inline.
Add Positioning creation in owlps-positioning, so the program is usable,
configuration is checked in Positioning, Input and Output, and objects
are created and run normally.
UserInterface: Minor modification, config_file_name is not initialised
in constructor anymore, it is now a default value of the configuration
entry "config-file".
- Where possible, use initialisation lists in class definition instead
of explicit variable initialisations in source file.
- Rename some variables (use of "source" in copy constructors and
operators…).
- Suppress useless Doxygen comments, allow non-documented members in
Doxyfile.
In cxxtest, TS_ASSERT_DIFFERS(a, b) tests !(a == b) and not (a != b).
Therefore, to test a::operator!=(b), we must avoid TS_ASSERT_DIFFERS()
(that will test !a::operator==(b)) and write instead TS_ASSERT(a != b).
The new class Positioning is the interface between Input and Output,
using positioning algorithms to compute results from requests.
Update UserInterface to add option "positioning.algorithm"; update posexcept.
PositioningAlgorithm is the super-class of all positioning algorithms.
RealPosition is the first "positioning algorithm" (it actually computes
nothing, but returns the position declared in a CalibrationRequest).
- Replace occurences of `container.size() == 0` with
`container.empty()`.
- Fix an allocation in posexcept.cc (false positive?).
- UserInterface: in constructor, handle bad_alloc exception possibly
thrown by `new`.
InputLogCSV now handles calibration requests.
TestUtil:
- Request list become a Request pointer list (to handle polymorphism).
- Add a ReferencePoint list.
- Reorganise create_test_csv_file().
InputCSV now handles CalibrationRequest, adding position and direction
information.
Input:
- Add add_request_to_stock().
Stock:
- Add list of ReferencePoint.
- Add list of CalibrationRequest.
The new class Direction will be used to represent the direction of a
calibration request.
Update posexcept.hh to add new exception bad_direction, used in class
Direction.
InputMedium:
- Split into two files (inputmedium.{hh,cc}).
- Add polymorphic handling of CalibrationRequest.
- Write unit tests.
InputCSV:
- Use new code of InputMedium to handle calibration requests.
- We detect if the read request is a calibration request, but
specific attributes are not initialised.
Delete class CalibrationMeasurement and add class CalibrationRequest:
the ReferencePoint must be linked by the Request, not by each
Measurement of the Request.
Adapt ReferencePoint to link a CalibrationRequest instead of a
CalibrationMeasurement.
Request:
- Destructor is now virtual to allow polymorphism.
- Reactivate tests on get_measurements() and set_measurements().
Work on unit tests:
- TestUtil:
- Add set_up(), that sets up lists of Request, Mobile and AccessPoint,
primarily to be used with create_test_csv_file().
- Add public attributes for these lists.
- Update create_test_csv_file() to use these lists.
- Update InputCSV_test to use new TestUtil.
- Add class TestSetUp, a global fixture class. Before all tests off all
test suites, it calls TestUtil::set_up().
- Update and clean Makefile.
- Add files posexcept.{hh,cc} that contains exception classes.
- Add class Input, that handles InputMedium (and InputLogMedium, in the
future). Note that for the moment, the unit test is *very* minimal.
- UserInterface: Add options for the input medium and the CSV file.
Add the class TestUtil, that provides functions used in several unit
tests. For the moment, it contains two function:
- fill_file(), that creates and fills a test file.
- remove_file(), that deletes a test file.