diff options
| author | Sebastien Guiriec <sebastien.guiriec@renault.com> | 2016-04-26 07:26:09 +0200 |
|---|---|---|
| committer | Eric Laurent <elaurent@google.com> | 2019-03-12 17:48:47 -0700 |
| commit | 67f663e08dfcebdfaea69df36ebae6167595a549 (patch) | |
| tree | 66e6f26a6a09209dafcfb350ce0531e0fca154be | |
| parent | 9a458296b14bbbf4d3d4760b809c8613d46fdafb (diff) | |
| download | platform_external_parameter-framework-67f663e08dfcebdfaea69df36ebae6167595a549.tar.gz platform_external_parameter-framework-67f663e08dfcebdfaea69df36ebae6167595a549.tar.bz2 platform_external_parameter-framework-67f663e08dfcebdfaea69df36ebae6167595a549.zip | |
[PFW] Integrate PFW core version 3.2.5 release
PFW 3.2.5 release notes:
https://github.com/intel/parameter-framework/releases/tag/v3.2.5
This release contains the following changes:
- CMake Package configuration file generation
- Preliminary and unofficial OSX support in Travis-CI
- Use clang-tidy for automatic code cleanup
- Some more cleanup and fixes
- Speed Travis-CI up by using CCache
Bug: 124767636
Test: build
Change-Id: Ib7ce6824430f3907c0508194e91f71a934bdcda8
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@renault.com>
198 files changed, 813 insertions, 738 deletions
diff --git a/support/android/parameter/version.h b/support/android/parameter/version.h index 7b0a43e..e7707cc 100644 --- a/support/android/parameter/version.h +++ b/support/android/parameter/version.h @@ -27,4 +27,4 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define PARAMETER_FRAMEWORK_VERSION "v3.2.4" +#define PARAMETER_FRAMEWORK_VERSION "v3.2.5" diff --git a/upstream/.travis.yml b/upstream/.travis.yml index db18b6f..5d4060b 100644 --- a/upstream/.travis.yml +++ b/upstream/.travis.yml @@ -1,15 +1,32 @@ +os: + - linux + - osx # Use travis docker infrastructure sudo: false +# Use a recent OSX image +# cf. +# https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions +osx_image: xcode7.2 language: cpp +cache: ccache env: global: - PREFIX=$HOME/prefix + - MY_CMAKE_OPTIONS="-DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$HOME/install" + - CTEST_OUTPUT_ON_FAILURE=1 + - LINUX=false + - OSX=false compiler: - gcc - clang +matrix: + exclude: + - os: osx + compiler: gcc + # Install a recent gcc and gcov, # it will not be necessary once travis worker is based on ubuntu > 12.04. # Install SWIG for bindings generation @@ -35,6 +52,12 @@ addons: - python3-dev - clang-format-3.8 +before_install: + # OS detection + # TODO: an explicit build matrix may be better but it has limitation, e.g. + # each matrix entry may only define a single env variable. + - if [ $TRAVIS_OS_NAME = linux ]; then export LINUX=true; fi + - if [ $TRAVIS_OS_NAME = osx ]; then export OSX=true; fi install: - wget https://codecov.io/bash -O $HOME/codecov; chmod +x $HOME/codecov # This version of catch is known to work. @@ -42,50 +65,66 @@ install: https://raw.github.com/philsquared/Catch/v1.2.1/single_include/catch.hpp - wget 'https://01.org/sites/default/files/asio-1.10.6.tar.gz' - tar xf asio-1.10.6.tar.gz -C $PREFIX --strip-components=1 + # Current limitations on OSX builds: no testing, no client-simulator + # (because we haven't found a straightforward way to have CMake find the + # python libraries (find_package(PythonLibs)). + - if $OSX; then + brew update; + for package in cmake; do + if brew list $package; then + brew outdated $package || brew upgrade $package; + else + brew install $package; + fi; + done; + fi before_script: - coverage=OFF # Force the manualy installed 4.8 version as it is not the default # Only enable coverage on gcc as clang segfault on coverage file write + # Workaround a bug with the ccache/g++-4.8.1 combination - if [ "$CC" = "gcc" ]; then export CC=gcc-4.8 CXX=g++-4.8; coverage=ON; + export CCACHE_CPP2=1; fi + - if $OSX; then export MY_CMAKE_OPTIONS+=" -DBUILD_TESTING=OFF -DPYTHON_BINDINGS=OFF"; fi # how to build script: # Check coding style - - git ls-files | grep -E '\.[ch](pp)?$' | xargs clang-format-3.8 -i && - git diff --exit-code || { git reset --hard; false; } + - if $LINUX; then (git ls-files | grep -E '\.[ch](pp)?$' | xargs clang-format-3.8 -i && + git diff --exit-code || { git reset --hard; false; }); fi - ( mkdir build_debug && cd build_debug && - cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=${coverage} .. && - make -j && - CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck ) + cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=${coverage} .. && + make -j$(nproc) && + (if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) ) - ( mkdir build && cd build && - cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release .. && - make -j && - CTEST_OUTPUT_ON_FAILURE=1 make test && + cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release .. && + make -j$(nproc) && + (if $LINUX; then make test; fi) && make install && - cpack --verbose -G DEB && dpkg --info *.deb) + (if $LINUX; then cpack --verbose -G DEB && dpkg --info *.deb; fi) ) - ( cd skeleton-subsystem && - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install . && - make && - CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalMemCheck && + cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release . && + make -j$(nproc) && + (if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) && make install ) - - ( cd tools/clientSimulator && - echo "TODO - install the generated .deb instead of using ../install." + - if $LINUX; then ( cd tools/clientSimulator && + echo "TODO - install the generated .deb instead of using \$HOME/install." "This would permit to test the packaging" && - cmake -DCMAKE_INSTALL_PREFIX=../install . && + cmake $MY_CMAKE_OPTIONS . && make && - make install ) + make install ); fi # Keep this last - ( mkdir build_less_features && cd build_less_features && rm -rf $PREFIX/asio-1.10.6 && - cmake -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_BUILD_TYPE=Debug + cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug -DNETWORKING=OFF -DPYTHON_BINDINGS=OFF -DC_BINDINGS=OFF .. && - make -j && - CTEST_OUTPUT_ON_FAILURE=1 make test ) + make -j$(nproc) && + (if $LINUX; then make test; fi) ) after_success: # Push coverage info on codecov.io. diff --git a/upstream/.version b/upstream/.version index dd5b792..793dd64 100644 --- a/upstream/.version +++ b/upstream/.version @@ -1 +1 @@ -$Format:%D$ +tag: v3.2.5 diff --git a/upstream/CMakeLists.txt b/upstream/CMakeLists.txt index 8bf7941..8174218 100644 --- a/upstream/CMakeLists.txt +++ b/upstream/CMakeLists.txt @@ -94,6 +94,10 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN true) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +# Automatically add the current source and build dirs to the private and +# interface include directories. +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) include(ctest/CMakeLists.txt) @@ -126,3 +130,4 @@ add_subdirectory(doc) add_subdirectory(schemas) add_subdirectory(cpack) +add_subdirectory(cmake) diff --git a/upstream/appveyor.yml b/upstream/appveyor.yml index f1e38dc..cd2f0df 100644 --- a/upstream/appveyor.yml +++ b/upstream/appveyor.yml @@ -88,7 +88,7 @@ build_script: # %INSTALL%\bin is where parameter.dll is installed # Also add the path where the release libxml2.dll has been extracted - set TEST_PATH=%RELEASE_LIBXML2_PATH%\bin;%INSTALL%\lib;%INSTALL%\bin - - cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%INSTALL% -DCMAKE_PREFIX_PATH=%INSTALL% %APPVEYOR_BUILD_FOLDER%\skeleton-subsystem + - cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%INSTALL% -DCMAKE_PREFIX_PATH="%INSTALL%;%RELEASE_LIBXML2_PATH%" %APPVEYOR_BUILD_FOLDER%\skeleton-subsystem # Unfortunately, the skeleton test currently doesn't work on # multi-configuration build systems (Visual Studio is one of those) without # installing the plugin diff --git a/upstream/asio/CMakeLists.txt b/upstream/asio/CMakeLists.txt index 9c0ef11..1270e05 100644 --- a/upstream/asio/CMakeLists.txt +++ b/upstream/asio/CMakeLists.txt @@ -44,7 +44,7 @@ if (NETWORKING) # Ubuntu 14.04 packages asio 1.10.1 and clang 3.4.1. # In this environment, asio stand alone (set ASIO_STANDALONE) - # does not correcly detect that the stl has CHRONO support (c++11). + # does not correctly detect that the stl has CHRONO support (c++11). # Force the use of std::chrono by setting ASIO_HAS_STD_CHRONO target_include_directories(asio SYSTEM INTERFACE "${ASIO_DIR}") target_link_libraries(asio INTERFACE "${CMAKE_THREAD_LIBS_INIT}") diff --git a/upstream/bindings/c/CMakeLists.txt b/upstream/bindings/c/CMakeLists.txt index 0c88412..c04ac3c 100644 --- a/upstream/bindings/c/CMakeLists.txt +++ b/upstream/bindings/c/CMakeLists.txt @@ -37,12 +37,6 @@ install(FILES ParameterFramework.h target_link_libraries(cparameter PRIVATE parameter pfw_utility) -target_include_directories(cparameter - # Fixme use an include folder - PUBLIC . - # Export symbol macro header - PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") - install(TARGETS cparameter LIBRARY DESTINATION lib RUNTIME DESTINATION bin) if(BUILD_TESTING) diff --git a/upstream/bindings/c/ParameterFramework.cpp b/upstream/bindings/c/ParameterFramework.cpp index 53f7a66..858994b 100644 --- a/upstream/bindings/c/ParameterFramework.cpp +++ b/upstream/bindings/c/ParameterFramework.cpp @@ -50,7 +50,7 @@ namespace pfw typedef ISelectionCriterionInterface Criterion; typedef std::map<string, Criterion *> Criteria; typedef CParameterMgrPlatformConnector Pfw; -} +} // namespace pfw /** Class to abstract the boolean+string status api. */ class Status @@ -110,7 +110,7 @@ static void defaultLogCb(void *, PfwLogLevel level, const char *logLine) }; } -static PfwLogger defaultLogger = {NULL, &defaultLogCb}; +static PfwLogger defaultLogger = {nullptr, &defaultLogCb}; class LogWrapper : public CParameterMgrPlatformConnector::ILogger { @@ -127,7 +127,7 @@ private: { // A LogWrapper should NOT be register to the pfw (thus log called) // if logCb is NULL. - assert(mLogger.logCb != NULL); + assert(mLogger.logCb != nullptr); mLogger.logCb(mLogger.userCtx, level, strLog.c_str()); } @@ -167,10 +167,10 @@ void pfwDestroy(PfwHandler *handle) void PfwHandler::setLogger(const PfwLogger *logger) { - if (logger != NULL and logger->logCb == NULL) { + if (logger != nullptr and logger->logCb == nullptr) { return; // There is no callback, do not log => do not add a logger } - mLogger = logger != NULL ? *logger : defaultLogger; + mLogger = logger != nullptr ? *logger : defaultLogger; pfw->setLogger(&mLogger); } @@ -180,10 +180,10 @@ bool PfwHandler::createCriteria(const PfwCriterion criteriaArray[], size_t crite // Add criteria for (size_t criterionIndex = 0; criterionIndex < criterionNb; ++criterionIndex) { const PfwCriterion &criterion = criteriaArray[criterionIndex]; - if (criterion.name == NULL) { + if (criterion.name == nullptr) { return status.failure("Criterion name is NULL"); } - if (criterion.values == NULL) { + if (criterion.values == nullptr) { return status.failure("Criterion values is NULL"); } // Check that the criterion does not exist @@ -194,9 +194,9 @@ bool PfwHandler::createCriteria(const PfwCriterion criteriaArray[], size_t crite // Create criterion type ISelectionCriterionTypeInterface *type = pfw->createSelectionCriterionType(criterion.inclusive); - assert(type != NULL); + assert(type != nullptr); // Add criterion values - for (size_t valueIndex = 0; criterion.values[valueIndex] != NULL; ++valueIndex) { + for (size_t valueIndex = 0; criterion.values[valueIndex] != nullptr; ++valueIndex) { int value; if (criterion.inclusive) { // Check that (int)1 << valueIndex would not overflow (UB) @@ -227,7 +227,7 @@ bool pfwStart(PfwHandler *handle, const char *configPath, const PfwCriterion cri // Check that the api is correctly used Status &status = handle->lastStatus; - if (handle->pfw != NULL) { + if (handle->pfw != nullptr) { return status.failure("Can not start an already started parameter framework"); } // Create a pfw @@ -249,19 +249,19 @@ const char *pfwGetLastError(const PfwHandler *handle) static pfw::Criterion *getCriterion(const pfw::Criteria &criteria, const string &name) { - pfw::Criteria::const_iterator it = criteria.find(name); - return it == criteria.end() ? NULL : it->second; + auto it = criteria.find(name); + return it == criteria.end() ? nullptr : it->second; } bool pfwSetCriterion(PfwHandler *handle, const char name[], int value) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { return status.failure("Can not set criterion \"" + string(name) + "\" as the parameter framework is not started."); } pfw::Criterion *criterion = getCriterion(handle->criteria, name); - if (criterion == NULL) { + if (criterion == nullptr) { return status.failure("Can not set criterion " + string(name) + " as does not exist"); } criterion->setCriterionState(value); @@ -270,12 +270,12 @@ bool pfwSetCriterion(PfwHandler *handle, const char name[], int value) bool pfwGetCriterion(const PfwHandler *handle, const char name[], int *value) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { return status.failure("Can not get criterion \"" + string(name) + "\" as the parameter framework is not started."); } pfw::Criterion *criterion = getCriterion(handle->criteria, name); - if (criterion == NULL) { + if (criterion == nullptr) { return status.failure("Can not get criterion " + string(name) + " as it does not exist"); } *value = criterion->getCriterionState(); @@ -285,7 +285,7 @@ bool pfwGetCriterion(const PfwHandler *handle, const char name[], int *value) bool pfwApplyConfigurations(const PfwHandler *handle) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { return status.failure("Can not commit criteria " "as the parameter framework is not started."); } @@ -306,17 +306,17 @@ struct PfwParameterHandler_ PfwParameterHandler *pfwBindParameter(PfwHandler *handle, const char path[]) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { status.failure("The parameter framework is not started, " "while trying to bind parameter \"" + string(path) + "\")"); - return NULL; + return nullptr; } CParameterHandle *paramHandle; paramHandle = handle->pfw->createParameterHandle(path, status.msg()); - if (paramHandle == NULL) { - return NULL; + if (paramHandle == nullptr) { + return nullptr; } status.success(); @@ -344,7 +344,7 @@ bool pfwSetIntParameter(PfwParameterHandler *handle, int32_t value) bool pfwGetStringParameter(const PfwParameterHandler *handle, char *value[]) { Status &status = handle->pfw.lastStatus; - *value = NULL; + *value = nullptr; string retValue; bool success = handle->parameter.getAsString(retValue, status.msg()); if (not success) { diff --git a/upstream/bindings/c/Test.cpp b/upstream/bindings/c/Test.cpp index 39f5df6..9d3b038 100644 --- a/upstream/bindings/c/Test.cpp +++ b/upstream/bindings/c/Test.cpp @@ -114,8 +114,8 @@ struct Test TEST_CASE_METHOD(Test, "Parameter-framework c api use") { // Create criteria - const char *letterList[] = {"a", "b", "c", NULL}; - const char *numberList[] = {"1", "2", "3", NULL}; + const char *letterList[] = {"a", "b", "c", nullptr}; + const char *numberList[] = {"1", "2", "3", nullptr}; const PfwCriterion criteria[] = { {"inclusiveCrit", true, letterList}, {"exclusiveCrit", false, numberList}, }; @@ -165,7 +165,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 2, &logger)); } WHEN ("The pfw is started with duplicated criterion value state") { - const char *values[] = {"a", "a", NULL}; + const char *values[] = {"a", "a", nullptr}; const PfwCriterion duplicatedCriteria[] = {{"name", true, values}}; WHEN ("Using test logger") { @@ -173,15 +173,15 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") } WHEN ("Using default logger") { // Test coverage of default logger warning - REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, NULL)); + REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, nullptr)); } } WHEN ("The pfw is started with NULL name criterion") { - const PfwCriterion duplicatedCriteria[] = {{NULL, true, letterList}}; + const PfwCriterion duplicatedCriteria[] = {{nullptr, true, letterList}}; REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } WHEN ("The pfw is started with NULL criterion state list") { - const PfwCriterion duplicatedCriteria[] = {{"name", true, NULL}}; + const PfwCriterion duplicatedCriteria[] = {{"name", true, nullptr}}; REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } GIVEN ("A criteria with lots of values") { @@ -192,7 +192,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") for (size_t i = 0; i < values.size(); ++i) { values[i] = &names[i]; } - values.back() = NULL; + values.back() = nullptr; /* The pfw c api requires criterion values to be a NULL terminated * array of string. Each string is a pointer to a NULL terminated * array of char. The pfw requires each string to be different @@ -225,7 +225,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } WHEN ("The pfw is started with max length criterion state list") { - values[values.size() - 2] = NULL; // Hide last value + values[values.size() - 2] = nullptr; // Hide last value REQUIRE_SUCCESS(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } } @@ -240,11 +240,11 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") } WHEN ("The pfw is started without a logger callback") { - PfwLogger noLog = {NULL, NULL}; + PfwLogger noLog = {nullptr, nullptr}; REQUIRE_SUCCESS(pfwStart(pfw, config, criteria, criterionNb, &noLog)); } WHEN ("The pfw is started with default logger") { - REQUIRE_SUCCESS(pfwStart(pfw, config, criteria, criterionNb, NULL)); + REQUIRE_SUCCESS(pfwStart(pfw, config, criteria, criterionNb, nullptr)); } WHEN ("Get criterion of a stopped pfw") { @@ -311,12 +311,12 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") REQUIRE_SUCCESS(pfwApplyConfigurations(pfw)); } WHEN ("Bind a non existing parameter") { - REQUIRE_FAILURE(pfwBindParameter(pfw, "do/not/exist") != NULL); + REQUIRE_FAILURE(pfwBindParameter(pfw, "do/not/exist") != nullptr); } GIVEN ("An integer parameter handle") { PfwParameterHandler *param = pfwBindParameter(pfw, intParameterPath); - REQUIRE_SUCCESS(param != NULL); + REQUIRE_SUCCESS(param != nullptr); WHEN ("Set parameter out of range") { REQUIRE_FAILURE(pfwSetIntParameter(param, 101)); @@ -335,7 +335,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") GIVEN ("An string parameter handle") { PfwParameterHandler *param = pfwBindParameter(pfw, stringParameterPath); - REQUIRE_SUCCESS(param != NULL); + REQUIRE_SUCCESS(param != nullptr); WHEN ("Set parameter out of range") { REQUIRE_FAILURE(pfwSetStringParameter(param, "ko_1234567")); diff --git a/upstream/cmake/CMakeLists.txt b/upstream/cmake/CMakeLists.txt new file mode 100644 index 0000000..29ce10a --- /dev/null +++ b/upstream/cmake/CMakeLists.txt @@ -0,0 +1,50 @@ +# Copyright (c) 2016, Intel Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +configure_file(ParameterFrameworkConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfig.cmake" + COPYONLY +) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfigVersion.cmake" + VERSION ${PF_VERSION_MAJOR}.${PF_VERSION_MINOR}.${PF_VERSION_PATCH} + COMPATIBILITY SameMajorVersion) + +export(EXPORT ParameterTargets + FILE "${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkTargets.cmake" + NAMESPACE ParameterFramework::) + +install(EXPORT ParameterTargets DESTINATION lib/cmake/ParameterFramework + FILE ParameterFrameworkTargets.cmake + NAMESPACE ParameterFramework::) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfigVersion.cmake" + DESTINATION lib/cmake/ParameterFramework) diff --git a/upstream/cmake/ParameterFrameworkConfig.cmake b/upstream/cmake/ParameterFrameworkConfig.cmake new file mode 100644 index 0000000..cc14d46 --- /dev/null +++ b/upstream/cmake/ParameterFrameworkConfig.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Intel Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include("${CMAKE_CURRENT_LIST_DIR}/ParameterFrameworkTargets.cmake") diff --git a/upstream/ctest/CMakeLists.txt b/upstream/ctest/CMakeLists.txt index d56c9a1..e80bc3f 100644 --- a/upstream/ctest/CMakeLists.txt +++ b/upstream/ctest/CMakeLists.txt @@ -71,7 +71,7 @@ function(set_test_env TestName) endif() - # With nmake and nmake, executables are build in: + # With nmake and nmake, executables are built in: # ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} => `bin/` # # Nevertheless Visual studio (and xcode) can build for debug and release diff --git a/upstream/parameter/ArrayParameter.h b/upstream/parameter/ArrayParameter.h index b2018c2..6410dbc 100644 --- a/upstream/parameter/ArrayParameter.h +++ b/upstream/parameter/ArrayParameter.h @@ -37,30 +37,30 @@ public: CArrayParameter(const std::string &strName, const CTypeElement *pTypeElement); // Instantiation, allocation - virtual size_t getFootPrint() const; + size_t getFootPrint() const override; /// Value access using CBaseParameter::access; bool access(std::vector<bool> &abValues, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; bool access(std::vector<uint32_t> &auiValues, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; bool access(std::vector<int32_t> &aiValues, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; bool access(std::vector<double> &adValues, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; bool access(std::vector<std::string> &astrValues, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; protected: // User set/get - virtual bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet, - CParameterAccessContext ¶meterAccessContext) const; + bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet, + CParameterAccessContext ¶meterAccessContext) const override; // Used for simulation and virtual subsystems - virtual void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const; + void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const override; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; private: // Array length diff --git a/upstream/parameter/BaseParameter.h b/upstream/parameter/BaseParameter.h index 1b80fb8..1efe902 100644 --- a/upstream/parameter/BaseParameter.h +++ b/upstream/parameter/BaseParameter.h @@ -43,12 +43,12 @@ public: CBaseParameter(const std::string &strName, const CTypeElement *pTypeElement); // XML configuration settings parsing/composing - virtual bool serializeXmlSettings( + bool serializeXmlSettings( CXmlElement &xmlConfigurationSettingsElementContent, - CConfigurationAccessContext &configurationAccessContext) const; + CConfigurationAccessContext &configurationAccessContext) const override; // Check element is a parameter - virtual bool isParameter() const; + bool isParameter() const override; // Boolean access virtual bool access(bool &bValue, bool bSet, @@ -85,12 +85,12 @@ public: CParameterAccessContext ¶meterAccessContext) const; void structureToXml(CXmlElement &xmlElement, - CXmlSerializingContext &serializingContext) const override final; + CXmlSerializingContext &serializingContext) const final; protected: // Parameter Access - virtual bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet, - CParameterAccessContext ¶meterAccessContext) const; + bool accessValue(CPathNavigator &pathNavigator, std::string &strValue, bool bSet, + CParameterAccessContext ¶meterAccessContext) const override; // Actual value access (to be implemented by derived) virtual bool doSetValue(const std::string &strValue, size_t offset, diff --git a/upstream/parameter/BitParameter.h b/upstream/parameter/BitParameter.h index cbe071e..0487cb4 100644 --- a/upstream/parameter/BitParameter.h +++ b/upstream/parameter/BitParameter.h @@ -39,22 +39,22 @@ public: CBitParameter(const std::string &strName, const CTypeElement *pTypeElement); // Instantiation, allocation - virtual size_t getFootPrint() const; + size_t getFootPrint() const override; // Type - virtual Type getType() const; + Type getType() const override; /// Value access // Boolean access bool access(bool &bValue, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; // Integer Access bool access(uint32_t &uiValue, bool bSet, - CParameterAccessContext ¶meterAccessContext) const override final; + CParameterAccessContext ¶meterAccessContext) const final; // AreaConfiguration creation - virtual CAreaConfiguration *createAreaConfiguration(const CSyncerSet *pSyncerSet) const; + CAreaConfiguration *createAreaConfiguration(const CSyncerSet *pSyncerSet) const override; // Size size_t getBelongingBlockSize() const; @@ -64,10 +64,10 @@ public: private: // String Access - virtual bool doSetValue(const std::string &strValue, size_t offset, - CParameterAccessContext ¶meterAccessContext) const; - virtual void doGetValue(std::string &strValue, size_t offset, - CParameterAccessContext ¶meterAccessContext) const; + bool doSetValue(const std::string &strValue, size_t offset, + CParameterAccessContext ¶meterAccessContext) const override; + void doGetValue(std::string &strValue, size_t offset, + CParameterAccessContext ¶meterAccessContext) const override; // Generic Access template <typename type> diff --git a/upstream/parameter/BitParameterBlock.h b/upstream/parameter/BitParameterBlock.h index f1068f6..e1e965c 100644 --- a/upstream/parameter/BitParameterBlock.h +++ b/upstream/parameter/BitParameterBlock.h @@ -37,18 +37,19 @@ public: CBitParameterBlock(const std::string &strName, const CTypeElement *pTypeElement); // Instantiation, allocation - virtual size_t getFootPrint() const; + size_t getFootPrint() const override; // Type - virtual Type getType() const; + Type getType() const override; // Size size_t getSize() const; // Used for simulation and virtual subsystems - virtual void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const; + void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const override; - void structureToXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const + void structureToXml(CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) const override { xmlElement.setAttribute("Size", getSize() * 8); CInstanceConfigurableElement::structureToXml(xmlElement, serializingContext); diff --git a/upstream/parameter/BitParameterBlockType.h b/upstream/parameter/BitParameterBlockType.h index 419d7aa..58b42d4 100644 --- a/upstream/parameter/BitParameterBlockType.h +++ b/upstream/parameter/BitParameterBlockType.h @@ -42,18 +42,19 @@ public: size_t getSize() const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Instantiation - virtual CInstanceConfigurableElement *doInstantiate() const; + CInstanceConfigurableElement *doInstantiate() const override; // Size in bytes size_t _size{0}; diff --git a/upstream/parameter/BitParameterType.cpp b/upstream/parameter/BitParameterType.cpp index 5a5c353..14421f1 100644 --- a/upstream/parameter/BitParameterType.cpp +++ b/upstream/parameter/BitParameterType.cpp @@ -123,7 +123,7 @@ bool CBitParameterType::toBlackboard(const string &strValue, uint64_t &uiValue, CParameterAccessContext ¶meterAccessContext) const { // Get value - uint64_t uiConvertedValue = strtoull(strValue.c_str(), NULL, 0); + uint64_t uiConvertedValue = strtoull(strValue.c_str(), nullptr, 0); if (uiConvertedValue > _uiMax) { @@ -225,20 +225,6 @@ uint64_t CBitParameterType::getMask() const return getMaxEncodableValue() << _bitPos; } -// Check data has no bit set outside available range -bool CBitParameterType::isEncodable(uint64_t uiData) const -{ - size_t uiShift = 8 * sizeof(uiData) - _uiBitSize; - - if (uiShift) { - - // Check high bits are clean - return !(uiData >> uiShift); - } - - return true; -} - // From IXmlSource void CBitParameterType::toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const diff --git a/upstream/parameter/BitParameterType.h b/upstream/parameter/BitParameterType.h index f8d67ed..a6745c8 100644 --- a/upstream/parameter/BitParameterType.h +++ b/upstream/parameter/BitParameterType.h @@ -44,10 +44,11 @@ public: CBitParameterType(const std::string &strName); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; /// Conversion // String bool toBlackboard(const std::string &strValue, uint64_t &uiValue, @@ -66,10 +67,10 @@ public: size_t getBitSize() const; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; /** * Get the position of the bit within the bit parameter block. @@ -80,13 +81,11 @@ public: size_t getBitPos() const { return _bitPos; } private: // Instantiation - virtual CInstanceConfigurableElement *doInstantiate() const; + CInstanceConfigurableElement *doInstantiate() const override; // Max encodable value uint64_t getMaxEncodableValue() const; // Biwise mask uint64_t getMask() const; - // Check data has no bit set outside available range - bool isEncodable(uint64_t uiData) const; // Pos in bits size_t _bitPos{0}; diff --git a/upstream/parameter/BitwiseAreaConfiguration.h b/upstream/parameter/BitwiseAreaConfiguration.h index 4a10c2c..5cb0e1b 100644 --- a/upstream/parameter/BitwiseAreaConfiguration.h +++ b/upstream/parameter/BitwiseAreaConfiguration.h @@ -41,6 +41,6 @@ public: private: // Blackboard copies - virtual void copyTo(CParameterBlackboard *pToBlackboard, size_t offset) const; - virtual void copyFrom(const CParameterBlackboard *pFromBlackboard, size_t offset); + void copyTo(CParameterBlackboard *pToBlackboard, size_t offset) const override; + void copyFrom(const CParameterBlackboard *pFromBlackboard, size_t offset) override; }; diff --git a/upstream/parameter/BooleanParameterType.h b/upstream/parameter/BooleanParameterType.h index 6a88488..bc6c4c9 100644 --- a/upstream/parameter/BooleanParameterType.h +++ b/upstream/parameter/BooleanParameterType.h @@ -37,25 +37,25 @@ class CBooleanParameterType : public CParameterType { public: CBooleanParameterType(const std::string &strName); - virtual ~CBooleanParameterType() = default; + ~CBooleanParameterType() override = default; // Kind - virtual std::string getKind() const; + std::string getKind() const override; /// Conversion // String - virtual bool toBlackboard(const std::string &strValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(const std::string &strValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Boolean - virtual bool toBlackboard(bool bUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(bool &bUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(bool bUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(bool &bUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Integer - virtual bool toBlackboard(uint32_t uiUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(uint32_t &uiUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(uint32_t uiUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(uint32_t &uiUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; }; diff --git a/upstream/parameter/CMakeLists.txt b/upstream/parameter/CMakeLists.txt index 230dd5f..05c90af 100644 --- a/upstream/parameter/CMakeLists.txt +++ b/upstream/parameter/CMakeLists.txt @@ -127,19 +127,32 @@ endif() configure_file(version.h.in "${CMAKE_CURRENT_BINARY_DIR}/version.h") target_link_libraries(parameter - # Unfortunatly xmlSink and xmlSource need to be exposed to the plugins - PUBLIC xmlserializer - PRIVATE pfw_utility remote-processor + PRIVATE xmlserializer pfw_utility remote-processor PRIVATE ${CMAKE_DL_LIBS}) target_include_directories(parameter - PUBLIC include log/include - # Export symbol macro header - PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" - # FIXE: define . as an PUBLIC include directory only for plugins - PUBLIC .) + PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/log/include>) + +install(TARGETS parameter EXPORT ParameterTargets + LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib + INCLUDES DESTINATION "include/parameter/client" "include/parameter/plugin") + +# Export an interface library for plugins to use (after the ParameterFramework +# project is built and installed). It makes them link against libparameter and +# use xmlserializer's and pfw_utilify's include directories. +add_library(plugin INTERFACE) +target_link_libraries(plugin INTERFACE parameter) +install(TARGETS plugin EXPORT ParameterTargets + INCLUDES DESTINATION "include/parameter/xmlserializer" "include/parameter/utility") +# Unfortunately, while the "plugin" interface library is suitable for external +# plugins (built using the installed Parameter Framework) we want to build some +# plugins before the whole project is installed. Therefore, they need to get +# xmlserializer's and pfw_utility's headers from the build tree. This +# "plugin-internal-hack" is for them. +add_library(plugin-internal-hack INTERFACE) +target_link_libraries(plugin-internal-hack INTERFACE parameter xmlserializer) -install(TARGETS parameter LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib) # Client headers install(FILES "${CMAKE_CURRENT_BINARY_DIR}/parameter_export.h" @@ -161,7 +174,6 @@ install(FILES Element.h ElementBuilder.h ElementLibrary.h - FileIncluderElementBuilder.h FormattedSubsystemObject.h InstanceConfigurableElement.h LoggingElementBuilderTemplate.h diff --git a/upstream/parameter/Component.h b/upstream/parameter/Component.h index b89ea0b..e200b46 100644 --- a/upstream/parameter/Component.h +++ b/upstream/parameter/Component.h @@ -42,5 +42,5 @@ public: } // Type - virtual Type getType() const { return EComponent; } + Type getType() const override { return EComponent; } }; diff --git a/upstream/parameter/ComponentInstance.h b/upstream/parameter/ComponentInstance.h index 27af963..3f71a54 100644 --- a/upstream/parameter/ComponentInstance.h +++ b/upstream/parameter/ComponentInstance.h @@ -41,26 +41,27 @@ public: CComponentInstance(const std::string &strName); // Mapping info - virtual bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const; - virtual bool hasMappingData() const; + bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const override; + bool hasMappingData() const override; /** * Returns the mapping associated to the current TypeElement instance * * @return A std::string containing the mapping as a comma separated key value pairs */ - virtual std::string getFormattedMapping() const; + std::string getFormattedMapping() const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; std::string getXmlElementName() const override; private: - virtual bool childrenAreDynamic() const; - virtual CInstanceConfigurableElement *doInstantiate() const; - virtual void populate(CElement *pElement) const; + bool childrenAreDynamic() const override; + CInstanceConfigurableElement *doInstantiate() const override; + void populate(CElement *pElement) const override; // Related component type const CComponentType *_pComponentType{nullptr}; diff --git a/upstream/parameter/ComponentLibrary.h b/upstream/parameter/ComponentLibrary.h index 572b062..a58a509 100644 --- a/upstream/parameter/ComponentLibrary.h +++ b/upstream/parameter/ComponentLibrary.h @@ -42,11 +42,12 @@ class CComponentLibrary : public CElement public: const CComponentType *getComponentType(const std::string &strName) const; - virtual std::string getKind() const; + std::string getKind() const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; private: - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; }; diff --git a/upstream/parameter/ComponentType.cpp b/upstream/parameter/ComponentType.cpp index 76fb211..55cd96e 100644 --- a/upstream/parameter/ComponentType.cpp +++ b/upstream/parameter/ComponentType.cpp @@ -129,5 +129,5 @@ CInstanceConfigurableElement *CComponentType::doInstantiate() const // Not supposed to be called directly (instantiation made through CComponentInstance object) assert(0); - return NULL; + return nullptr; } diff --git a/upstream/parameter/ComponentType.h b/upstream/parameter/ComponentType.h index e8c7fff..4e621e8 100644 --- a/upstream/parameter/ComponentType.h +++ b/upstream/parameter/ComponentType.h @@ -41,28 +41,29 @@ public: CComponentType(const std::string &strName); // Object creation - virtual void populate(CElement *pElement) const; + void populate(CElement *pElement) const override; // Mapping info - virtual bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const; - virtual bool hasMappingData() const; + bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const override; + bool hasMappingData() const override; /** * Returns the mapping associated to the current TypeElement instance * * @return A std::string containing the mapping as a comma separated key value pairs */ - virtual std::string getFormattedMapping() const; + std::string getFormattedMapping() const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: // CElement - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Component creation - virtual CInstanceConfigurableElement *doInstantiate() const; + CInstanceConfigurableElement *doInstantiate() const override; // Ref const CComponentType *_pExtendsComponentType{nullptr}; diff --git a/upstream/parameter/CompoundRule.h b/upstream/parameter/CompoundRule.h index 712ff70..bc3ef35 100644 --- a/upstream/parameter/CompoundRule.h +++ b/upstream/parameter/CompoundRule.h @@ -37,29 +37,30 @@ class CCompoundRule : public CRule { public: // Parse - virtual bool parse(CRuleParser &ruleParser, std::string &strError); + bool parse(CRuleParser &ruleParser, std::string &strError) override; // Dump std::string dump() const override; // Rule check - virtual bool matches() const; + bool matches() const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // Class kind - virtual std::string getKind() const; + std::string getKind() const override; private: // Content dumping std::string logValue(utility::ErrorContext &errorContext) const override; // Returns true if children dynamic creation is to be dealt with - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Type bool _bTypeAll{false}; diff --git a/upstream/parameter/ConfigurableDomain.cpp b/upstream/parameter/ConfigurableDomain.cpp index 2a74307..71bb3e8 100644 --- a/upstream/parameter/ConfigurableDomain.cpp +++ b/upstream/parameter/ConfigurableDomain.cpp @@ -301,7 +301,7 @@ bool CConfigurableDomain::parseConfigurableElements(const CXmlElement &xmlElemen } // Add found element to domain core::Results infos; - if (!addConfigurableElement(pConfigurableElement, NULL, infos)) { + if (!addConfigurableElement(pConfigurableElement, nullptr, infos)) { strError = utility::asString(infos); serializingContext.setError(strError); @@ -439,7 +439,7 @@ CParameterBlackboard *CConfigurableDomain::findConfigurationBlackboard( strError = "Domain configuration " + strConfiguration + " not found"; - return NULL; + return nullptr; } // Parse all configurable elements @@ -463,7 +463,7 @@ CParameterBlackboard *CConfigurableDomain::findConfigurationBlackboard( strError = "Element not associated to the Domain"; - return NULL; + return nullptr; } // Domain splitting @@ -535,7 +535,7 @@ const CDomainConfiguration *CConfigurableDomain::getPendingConfiguration() const } } - return NULL; + return nullptr; } // Configuration application if required @@ -551,7 +551,7 @@ void CConfigurableDomain::apply(CParameterBlackboard *pParameterBlackboard, CSyn if (bForce) { // Force a configuration restore by forgetting about last applied configuration - _pLastAppliedConfiguration = NULL; + _pLastAppliedConfiguration = nullptr; } const CDomainConfiguration *pApplicableDomainConfiguration = findApplicableDomainConfiguration(); @@ -569,7 +569,7 @@ void CConfigurableDomain::apply(CParameterBlackboard *pParameterBlackboard, CSyn bool bSync = !pSyncerSet && _bSequenceAware; // Do the restore - pApplicableDomainConfiguration->restore(pParameterBlackboard, bSync, NULL); + pApplicableDomainConfiguration->restore(pParameterBlackboard, bSync, nullptr); // Record last applied configuration _pLastAppliedConfiguration = pApplicableDomainConfiguration; @@ -627,7 +627,7 @@ bool CConfigurableDomain::createConfiguration(const string &strName, } // Creation - CDomainConfiguration *pDomainConfiguration = new CDomainConfiguration(strName); + auto pDomainConfiguration = new CDomainConfiguration(strName); // Configurable elements association ConfigurableElementListIterator it; @@ -672,7 +672,7 @@ bool CConfigurableDomain::deleteConfiguration(const string &strName, string &str if (pDomainConfiguration == _pLastAppliedConfiguration) { // Forget about it - _pLastAppliedConfiguration = NULL; + _pLastAppliedConfiguration = nullptr; } // Hierarchy @@ -719,7 +719,7 @@ bool CConfigurableDomain::restoreConfiguration(const string &configurationName, const CDomainConfiguration *configuration = findConfiguration(configurationName, error); - if (configuration == NULL) { + if (configuration == nullptr) { errors.push_back(error); return false; @@ -994,7 +994,7 @@ const CDomainConfiguration *CConfigurableDomain::findValidDomainConfiguration( return pDomainConfiguration; } } - return NULL; + return nullptr; } // Search for an applicable configuration @@ -1012,7 +1012,7 @@ const CDomainConfiguration *CConfigurableDomain::findApplicableDomainConfigurati return pDomainConfiguration; } } - return NULL; + return nullptr; } // Gather set of configurable elements @@ -1106,7 +1106,7 @@ void CConfigurableDomain::doAddConfigurableElement(CConfigurableElement *pConfig pConfigurableElement->addAttachedConfigurableDomain(this); // Create associated syncer set - CSyncerSet *pSyncerSet = new CSyncerSet; + auto pSyncerSet = new CSyncerSet; // Add to sync set the configurable element one pConfigurableElement->fillSyncerSet(*pSyncerSet); @@ -1182,8 +1182,7 @@ void CConfigurableDomain::doRemoveConfigurableElement(CConfigurableElement *pCon CSyncerSet *CConfigurableDomain::getSyncerSet( const CConfigurableElement *pConfigurableElement) const { - ConfigurableElementToSyncerSetMapIterator mapIt = - _configurableElementToSyncerSetMap.find(pConfigurableElement); + auto mapIt = _configurableElementToSyncerSetMap.find(pConfigurableElement); ALWAYS_ASSERT(mapIt != _configurableElementToSyncerSetMap.end(), "Could not find syncer set for " << getName() << " configurable domain"); @@ -1202,7 +1201,7 @@ CDomainConfiguration *CConfigurableDomain::findConfiguration(const string &strCo strError = "Domain configuration " + strConfiguration + " not found"; - return NULL; + return nullptr; } return pDomainConfiguration; } @@ -1217,7 +1216,7 @@ const CDomainConfiguration *CConfigurableDomain::findConfiguration(const string strError = "Domain configuration " + strConfiguration + " not found"; - return NULL; + return nullptr; } return pDomainConfiguration; } diff --git a/upstream/parameter/ConfigurableDomain.h b/upstream/parameter/ConfigurableDomain.h index 256e602..736ed8f 100644 --- a/upstream/parameter/ConfigurableDomain.h +++ b/upstream/parameter/ConfigurableDomain.h @@ -53,7 +53,7 @@ class CConfigurableDomain : public CElement public: CConfigurableDomain() = default; CConfigurableDomain(const std::string &strName); - virtual ~CConfigurableDomain(); + ~CConfigurableDomain() override; // Sequence awareness void setSequenceAwareness(bool bSequenceAware); @@ -146,15 +146,16 @@ public: bool isApplicableConfigurationValid(const CConfigurableElement *pConfigurableElement) const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; - virtual void childrenToXml(CXmlElement &xmlElement, - CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; + void childrenToXml(CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) const override; // Class kind - virtual std::string getKind() const; + std::string getKind() const override; protected: // Content dumping @@ -169,7 +170,7 @@ private: // Returns true if children dynamic creation is to be dealt with (here, will allow child // deletion upon clean) - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Ensure validity on areas related to configurable element void validateAreas(const CConfigurableElement *pConfigurableElement, @@ -218,7 +219,7 @@ private: * element are validated. */ void doAddConfigurableElement(CConfigurableElement *pConfigurableElement, core::Results &infos, - const CParameterBlackboard *pMainBlackboard = NULL); + const CParameterBlackboard *pMainBlackboard = nullptr); void doRemoveConfigurableElement(CConfigurableElement *pConfigurableElement, bool bRecomputeSyncSet); diff --git a/upstream/parameter/ConfigurableDomains.cpp b/upstream/parameter/ConfigurableDomains.cpp index 7c51083..35674fd 100644 --- a/upstream/parameter/ConfigurableDomains.cpp +++ b/upstream/parameter/ConfigurableDomains.cpp @@ -84,7 +84,7 @@ void CConfigurableDomains::apply(CParameterBlackboard *pParameterBlackboard, CSy } } // Synchronize those collected syncers - syncerSet.sync(*pParameterBlackboard, false, NULL); + syncerSet.sync(*pParameterBlackboard, false, nullptr); // Then deal with domains that need to synchronize along apply for (size_t child = 0; child < uiNbConfigurableDomains; child++) { @@ -94,7 +94,7 @@ void CConfigurableDomains::apply(CParameterBlackboard *pParameterBlackboard, CSy std::string info; // Apply and synchronize when relevant - pChildConfigurableDomain->apply(pParameterBlackboard, NULL, bForce, info); + pChildConfigurableDomain->apply(pParameterBlackboard, nullptr, bForce, info); if (!info.empty()) { infos.push_back(info); } @@ -304,7 +304,7 @@ bool CConfigurableDomains::split(const string &domainName, CConfigurableElement std::string error; CConfigurableDomain *domain = findConfigurableDomain(domainName, error); - if (domain == NULL) { + if (domain == nullptr) { infos.push_back(error); return false; @@ -411,7 +411,7 @@ bool CConfigurableDomains::restoreConfiguration(const string &domainName, // Find domain const CConfigurableDomain *domain = findConfigurableDomain(domainName, error); - if (domain == NULL) { + if (domain == nullptr) { errors.push_back(error); return false; @@ -541,7 +541,7 @@ bool CConfigurableDomains::addConfigurableElementToDomain( std::string error; CConfigurableDomain *domain = findConfigurableDomain(domainName, error); - if (domain == NULL) { + if (domain == nullptr) { infos.push_back(error); return false; @@ -574,7 +574,7 @@ CParameterBlackboard *CConfigurableDomains::findConfigurationBlackboard( if (!pConfigurableDomain) { - return NULL; + return nullptr; } // Check that element belongs to the domain @@ -583,7 +583,7 @@ CParameterBlackboard *CConfigurableDomains::findConfigurationBlackboard( strError = "Element \"" + pConfigurableElement->getPath() + "\" does not belong to domain \"" + strDomain + "\""; - return NULL; + return nullptr; } // Find Configuration Blackboard and Base Offset @@ -612,7 +612,7 @@ const CConfigurableDomain *CConfigurableDomains::findConfigurableDomain(const st strError = "Configurable domain " + strDomain + " not found"; - return NULL; + return nullptr; } return pConfigurableDomain; diff --git a/upstream/parameter/ConfigurableDomains.h b/upstream/parameter/ConfigurableDomains.h index 70e943b..5a096a5 100644 --- a/upstream/parameter/ConfigurableDomains.h +++ b/upstream/parameter/ConfigurableDomains.h @@ -161,7 +161,7 @@ public: std::string &strError) const; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // Ensure validity on whole domains from main blackboard void validate(const CParameterBlackboard *pMainBlackboard); @@ -177,7 +177,7 @@ public: core::Results &infos) const; // Class kind - virtual std::string getKind() const; + std::string getKind() const override; private: /** Delete a domain @@ -189,7 +189,7 @@ private: */ void deleteDomain(CConfigurableDomain &configurableDomain); // Returns true if children dynamic creation is to be dealt with - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Gather owned configurable elements owned by any domain void gatherAllOwnedConfigurableElements( std::set<const CConfigurableElement *> &configurableElementSet) const; diff --git a/upstream/parameter/ConfigurableElement.cpp b/upstream/parameter/ConfigurableElement.cpp index 615d72b..1aecf11 100644 --- a/upstream/parameter/ConfigurableElement.cpp +++ b/upstream/parameter/ConfigurableElement.cpp @@ -378,7 +378,7 @@ ISyncer *CConfigurableElement::getSyncer() const return static_cast<const CConfigurableElement *>(pParent)->getSyncer(); } - return NULL; + return nullptr; } // Syncer set (me, ascendant or descendant ones) @@ -630,7 +630,7 @@ const CSubsystem *CConfigurableElement::getBelongingSubsystem() const // Stop at system class if (!pParent->getParent()) { - return NULL; + return nullptr; } return static_cast<const CConfigurableElement *>(pParent)->getBelongingSubsystem(); diff --git a/upstream/parameter/ConfigurableElement.h b/upstream/parameter/ConfigurableElement.h index e511447..b17521d 100644 --- a/upstream/parameter/ConfigurableElement.h +++ b/upstream/parameter/ConfigurableElement.h @@ -53,7 +53,7 @@ class PARAMETER_EXPORT CConfigurableElement : public CElement public: CConfigurableElement(const std::string &strName = ""); - virtual ~CConfigurableElement() = default; + ~CConfigurableElement() override = default; // Offset in main blackboard void setOffset(size_t offset); @@ -143,7 +143,7 @@ public: virtual void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; /** * Get the value associated to a mapping key in the object's mapping @@ -165,11 +165,9 @@ public: CXmlElement &xmlConfigurationSettingsElementContent, CConfigurationAccessContext &configurationAccessContext) const; - bool fromXml(const CXmlElement &xmlElement, - CXmlSerializingContext &serializingContext) override final; + bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) final; - void toXml(CXmlElement &xmlElement, - CXmlSerializingContext &serializingContext) const override final; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const final; /** Deserialize the structure from xml. */ virtual bool structureFromXml(const CXmlElement &xmlElement, @@ -210,7 +208,7 @@ private: // Elements should be called with the overloaded version taking a // "Parameter Access Context" (The name is misleading as it is actually // used to access any Configurable Element). - std::string logValue(utility::ErrorContext &errorContext) const override final; + std::string logValue(utility::ErrorContext &errorContext) const final; virtual std::string logValue(CParameterAccessContext &context) const; // Configurable domain association diff --git a/upstream/parameter/ConfigurationAccessContext.h b/upstream/parameter/ConfigurationAccessContext.h index 10ffd4f..d433cc4 100644 --- a/upstream/parameter/ConfigurationAccessContext.h +++ b/upstream/parameter/ConfigurationAccessContext.h @@ -45,7 +45,7 @@ public: // Serialization direction bool serializeOut() const; - bool serializeSettings() const override final { return true; } + bool serializeSettings() const final { return true; } private: // Serialization direction diff --git a/upstream/parameter/DefaultElementLibrary.h b/upstream/parameter/DefaultElementLibrary.h index 9223021..dcc4dbf 100644 --- a/upstream/parameter/DefaultElementLibrary.h +++ b/upstream/parameter/DefaultElementLibrary.h @@ -47,7 +47,7 @@ template <class CDefaultElementBuilder> class CDefaultElementLibrary : public CElementLibrary { public: - virtual ~CDefaultElementLibrary() = default; + ~CDefaultElementLibrary() override = default; /** Set the default builder used in fallback mechanism. * @see createElement() for more detail on this mechanism. @@ -81,14 +81,14 @@ CElement *CDefaultElementLibrary<CDefaultElementBuilder>::createElement( { CElement *builtElement = CElementLibrary::createElement(xmlElement); - if (builtElement != NULL) { + if (builtElement != nullptr) { // The element was created, return it return builtElement; } if (_defaultBuilder == nullptr) { // The default builder mechanism is not enabled - return NULL; + return nullptr; } // Use the default builder diff --git a/upstream/parameter/DomainConfiguration.cpp b/upstream/parameter/DomainConfiguration.cpp index a272c14..f5d7182 100644 --- a/upstream/parameter/DomainConfiguration.cpp +++ b/upstream/parameter/DomainConfiguration.cpp @@ -275,7 +275,7 @@ bool CDomainConfiguration::setApplicationRule( CRuleParser ruleParser(strApplicationRule, pSelectionCriteriaDefinition); // Attempt to parse it - if (!ruleParser.parse(NULL, strError)) { + if (!ruleParser.parse(nullptr, strError)) { return false; } @@ -288,7 +288,7 @@ bool CDomainConfiguration::setApplicationRule( void CDomainConfiguration::clearApplicationRule() { // Replace compound rule - setRule(NULL); + setRule(nullptr); } string CDomainConfiguration::getApplicationRule() const @@ -478,7 +478,7 @@ const CCompoundRule *CDomainConfiguration::getRule() const // Rule created return static_cast<const CCompoundRule *>(getChild(ECompoundRule)); } - return NULL; + return nullptr; } CCompoundRule *CDomainConfiguration::getRule() @@ -487,7 +487,7 @@ CCompoundRule *CDomainConfiguration::getRule() // Rule created return static_cast<CCompoundRule *>(getChild(ECompoundRule)); } - return NULL; + return nullptr; } void CDomainConfiguration::setRule(CCompoundRule *pRule) diff --git a/upstream/parameter/DomainConfiguration.h b/upstream/parameter/DomainConfiguration.h index f45c155..5160369 100644 --- a/upstream/parameter/DomainConfiguration.h +++ b/upstream/parameter/DomainConfiguration.h @@ -92,7 +92,7 @@ public: * @return true if success false otherwise */ bool restore(CParameterBlackboard *pMainBlackboard, bool bSync, - core::Results *errors = NULL) const; + core::Results *errors = nullptr) const; // Ensure validity for configurable element area configuration void validate(const CConfigurableElement *pConfigurableElement, @@ -122,7 +122,7 @@ public: CXmlDomainExportContext &context) const; // Class kind - virtual std::string getKind() const; + std::string getKind() const override; private: using AreaConfiguration = std::unique_ptr<CAreaConfiguration>; @@ -130,7 +130,7 @@ private: // Returns true if children dynamic creation is to be dealt with (here, will allow child // deletion upon clean) - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // XML configuration settings serializing bool importOneConfigurableElementSettings(CAreaConfiguration *areaConfiguration, CXmlElement &xmlConfigurableElementSettingsElement, diff --git a/upstream/parameter/Element.cpp b/upstream/parameter/Element.cpp index 77dfd9d..8317299 100644 --- a/upstream/parameter/Element.cpp +++ b/upstream/parameter/Element.cpp @@ -308,7 +308,7 @@ CElement *CElement::createChild(const CXmlElement &childElement, elementSerializingContext.setError("Unable to create XML element " + childElement.getPath()); - return NULL; + return nullptr; } // Store created child! addChild(pChild); @@ -419,7 +419,7 @@ const CElement *CElement::findDescendant(CPathNavigator &pathNavigator) const if (!pChild) { - return NULL; + return nullptr; } return pChild->findDescendant(pathNavigator); @@ -438,7 +438,7 @@ CElement *CElement::findDescendant(CPathNavigator &pathNavigator) if (!pChild) { - return NULL; + return nullptr; } return pChild->findDescendant(pathNavigator); @@ -467,7 +467,7 @@ CElement *CElement::findChild(const string &strName) } } - return NULL; + return nullptr; } const CElement *CElement::findChild(const string &strName) const @@ -480,7 +480,7 @@ const CElement *CElement::findChild(const string &strName) const } } - return NULL; + return nullptr; } CElement *CElement::findChildOfKind(const string &strKind) @@ -493,7 +493,7 @@ CElement *CElement::findChildOfKind(const string &strKind) } } - return NULL; + return nullptr; } const CElement *CElement::findChildOfKind(const string &strKind) const @@ -506,7 +506,7 @@ const CElement *CElement::findChildOfKind(const string &strKind) const } } - return NULL; + return nullptr; } string CElement::getPath() const diff --git a/upstream/parameter/Element.h b/upstream/parameter/Element.h index 11d41b5..b7cdc6d 100644 --- a/upstream/parameter/Element.h +++ b/upstream/parameter/Element.h @@ -43,13 +43,13 @@ class CXmlElementSerializingContext; namespace utility { class ErrorContext; -} +} // namespace utility class PARAMETER_EXPORT CElement : public IXmlSink, public IXmlSource { public: CElement(const std::string &strName = ""); - virtual ~CElement(); + ~CElement() override; // Description void setDescription(const std::string &strDescription); @@ -106,10 +106,11 @@ public: bool isDescendantOf(const CElement *pCandidateAscendant) const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; /** * Serialize the children to XML diff --git a/upstream/parameter/ElementBuilderTemplate.h b/upstream/parameter/ElementBuilderTemplate.h index 8f7c44f..86f8b03 100644 --- a/upstream/parameter/ElementBuilderTemplate.h +++ b/upstream/parameter/ElementBuilderTemplate.h @@ -35,5 +35,5 @@ template <class ElementType> class TElementBuilderTemplate : public CElementBuilder { public: - virtual CElement *createElement(const CXmlElement & /*elem*/) const { return new ElementType; } + CElement *createElement(const CXmlElement & /*elem*/) const override { return new ElementType; } }; diff --git a/upstream/parameter/ElementLibrary.cpp b/upstream/parameter/ElementLibrary.cpp index bde9b91..aaeaa08 100644 --- a/upstream/parameter/ElementLibrary.cpp +++ b/upstream/parameter/ElementLibrary.cpp @@ -48,13 +48,13 @@ void CElementLibrary::clean() CElement *CElementLibrary::createElement(const CXmlElement &xmlElement) const { - ElementBuilderMapConstIterator it = _elementBuilderMap.find(getBuilderType(xmlElement)); + auto it = _elementBuilderMap.find(getBuilderType(xmlElement)); if (it != _elementBuilderMap.end()) { return it->second->createElement(xmlElement); } - return NULL; + return nullptr; } void CElementLibrary::addElementBuilder(const std::string &type, diff --git a/upstream/parameter/EnumParameterType.h b/upstream/parameter/EnumParameterType.h index b8f67f4..2103377 100644 --- a/upstream/parameter/EnumParameterType.h +++ b/upstream/parameter/EnumParameterType.h @@ -39,31 +39,32 @@ public: CEnumParameterType(const std::string &strName); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; /// Conversion // String - virtual bool toBlackboard(const std::string &strValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(const std::string &strValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Integer - virtual bool toBlackboard(int32_t iUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(int32_t &iUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(int32_t iUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(int32_t &iUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Default value handling (simulation only) - virtual uint32_t getDefaultValue() const; + uint32_t getDefaultValue() const override; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: // Specialized version of toBlackboard in case the access context is in raw @@ -72,7 +73,7 @@ private: CParameterAccessContext ¶meterAccessContext) const; // Returns true if children dynamic creation is to be dealt with - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Literal - numerical conversions bool getLiteral(int32_t iNumerical, std::string &strLiteral) const; diff --git a/upstream/parameter/EnumValuePair.h b/upstream/parameter/EnumValuePair.h index 46d5578..8a7100d 100644 --- a/upstream/parameter/EnumValuePair.h +++ b/upstream/parameter/EnumValuePair.h @@ -39,13 +39,14 @@ public: std::string getNumericalAsString() const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; protected: // Content dumping diff --git a/upstream/parameter/FileIncluderElementBuilder.h b/upstream/parameter/FileIncluderElementBuilder.h index d66065c..eb71c90 100644 --- a/upstream/parameter/FileIncluderElementBuilder.h +++ b/upstream/parameter/FileIncluderElementBuilder.h @@ -47,7 +47,7 @@ public: { } - virtual CElement *createElement(const CXmlElement &xmlElement) const + CElement *createElement(const CXmlElement &xmlElement) const override { return new CXmlFileIncluderElement(xmlElement.getNameAttribute(), xmlElement.getType(), _bValidateWithSchemas, _schemaBaseUri); diff --git a/upstream/parameter/FixedPointParameterType.h b/upstream/parameter/FixedPointParameterType.h index d4e96b6..943992a 100644 --- a/upstream/parameter/FixedPointParameterType.h +++ b/upstream/parameter/FixedPointParameterType.h @@ -39,34 +39,35 @@ public: CFixedPointParameterType(const std::string &strName); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // XML Serialization value space handling // Value space handling for configuration import - virtual void handleValueSpaceAttribute( + void handleValueSpaceAttribute( CXmlElement &xmlConfigurableElementSettingsElement, - CConfigurationAccessContext &configurationAccessContext) const; + CConfigurationAccessContext &configurationAccessContext) const override; /// Conversion // String - virtual bool toBlackboard(const std::string &strValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(const std::string &strValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Double - virtual bool toBlackboard(double dUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(double &dUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(double dUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(double &dUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: // Util size diff --git a/upstream/parameter/FloatingPointParameterType.h b/upstream/parameter/FloatingPointParameterType.h index aafb5e2..b56c9aa 100644 --- a/upstream/parameter/FloatingPointParameterType.h +++ b/upstream/parameter/FloatingPointParameterType.h @@ -37,25 +37,26 @@ class CFloatingPointParameterType : public CParameterType public: CFloatingPointParameterType(const std::string &strName); - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; - virtual void handleValueSpaceAttribute( + void handleValueSpaceAttribute( CXmlElement &xmlConfigurableElementSettingsElement, - CConfigurationAccessContext &configurationAccessContext) const; + CConfigurationAccessContext &configurationAccessContext) const override; - virtual bool toBlackboard(const std::string &strValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool toBlackboard(double dUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(double &dUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(const std::string &strValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool toBlackboard(double dUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(double &dUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; - virtual std::string getKind() const; + std::string getKind() const override; private: typedef CParameterType base; diff --git a/upstream/parameter/FormattedSubsystemObject.h b/upstream/parameter/FormattedSubsystemObject.h index 4793635..4a4bcea 100644 --- a/upstream/parameter/FormattedSubsystemObject.h +++ b/upstream/parameter/FormattedSubsystemObject.h @@ -71,14 +71,14 @@ public: core::log::Logger &logger, const std::string &strMappingValue, size_t firstAmendKey, size_t nbAmendKeys, const CMappingContext &context); - virtual ~CFormattedSubsystemObject() = default; + ~CFormattedSubsystemObject() override = default; /** * Returns the formatted mapping value associated to the element. * * @return A std::string containing the mapping */ - virtual std::string getFormattedMappingValue() const; + std::string getFormattedMappingValue() const override; private: /** diff --git a/upstream/parameter/FrameworkConfigurationGroup.h b/upstream/parameter/FrameworkConfigurationGroup.h index 551cb5e..27fdc18 100644 --- a/upstream/parameter/FrameworkConfigurationGroup.h +++ b/upstream/parameter/FrameworkConfigurationGroup.h @@ -42,5 +42,5 @@ public: } private: - virtual bool childrenAreDynamic() const { return true; } + bool childrenAreDynamic() const override { return true; } }; diff --git a/upstream/parameter/FrameworkConfigurationLocation.h b/upstream/parameter/FrameworkConfigurationLocation.h index 7182db9..bafa2c7 100644 --- a/upstream/parameter/FrameworkConfigurationLocation.h +++ b/upstream/parameter/FrameworkConfigurationLocation.h @@ -43,7 +43,8 @@ public: const std::string &getUri() const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; private: std::string _configurationUri; diff --git a/upstream/parameter/HardwareBackSynchronizer.cpp b/upstream/parameter/HardwareBackSynchronizer.cpp index dbc23eb..c46e6dd 100644 --- a/upstream/parameter/HardwareBackSynchronizer.cpp +++ b/upstream/parameter/HardwareBackSynchronizer.cpp @@ -51,5 +51,5 @@ CHardwareBackSynchronizer::CHardwareBackSynchronizer( void CHardwareBackSynchronizer::sync() { // Perform back synchronization - _backSyncerSet.sync(*_pParameterBlackboard, true, NULL); + _backSyncerSet.sync(*_pParameterBlackboard, true, nullptr); } diff --git a/upstream/parameter/HardwareBackSynchronizer.h b/upstream/parameter/HardwareBackSynchronizer.h index fd2e70d..03aaa04 100644 --- a/upstream/parameter/HardwareBackSynchronizer.h +++ b/upstream/parameter/HardwareBackSynchronizer.h @@ -39,7 +39,7 @@ public: CParameterBlackboard *pParameterBlackboard); // Back synchronization - virtual void sync(); + void sync() override; private: // Back syncer set diff --git a/upstream/parameter/InstanceConfigurableElement.cpp b/upstream/parameter/InstanceConfigurableElement.cpp index f9afa20..25a7ec9 100644 --- a/upstream/parameter/InstanceConfigurableElement.cpp +++ b/upstream/parameter/InstanceConfigurableElement.cpp @@ -145,7 +145,7 @@ void CInstanceConfigurableElement::setSyncer(ISyncer *pSyncer) void CInstanceConfigurableElement::unsetSyncer() { - _pSyncer = NULL; + _pSyncer = nullptr; } // Syncer diff --git a/upstream/parameter/InstanceConfigurableElement.h b/upstream/parameter/InstanceConfigurableElement.h index 0b4a7f9..d1b52f1 100644 --- a/upstream/parameter/InstanceConfigurableElement.h +++ b/upstream/parameter/InstanceConfigurableElement.h @@ -59,7 +59,7 @@ public: // Instantiated type const CTypeElement *getTypeElement() const; - virtual bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const; + bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const override; /** * Returns the mapping data associated to the type element of the current @@ -70,7 +70,7 @@ public: std::string getFormattedMapping() const override; // From CElement - virtual std::string getKind() const; + std::string getKind() const override; std::string getXmlElementName() const override; // Syncer to/from HW @@ -84,7 +84,7 @@ public: bool map(IMapper &mapper, std::string &strError); // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // Scalar or Array? bool isScalar() const; @@ -92,14 +92,14 @@ public: // Array Length size_t getArrayLength() const; - virtual void structureToXml(CXmlElement &xmlElement, - CXmlSerializingContext &serializingContext) const; + void structureToXml(CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) const override; protected: // Syncer - virtual ISyncer *getSyncer() const; + ISyncer *getSyncer() const override; // Syncer set (descendant) - virtual void fillSyncerSetFromDescendant(CSyncerSet &syncerSet) const; + void fillSyncerSetFromDescendant(CSyncerSet &syncerSet) const override; /** * Performs the sync if the AutoSync is enabled. diff --git a/upstream/parameter/InstanceDefinition.cpp b/upstream/parameter/InstanceDefinition.cpp index e461fa4..12d5126 100644 --- a/upstream/parameter/InstanceDefinition.cpp +++ b/upstream/parameter/InstanceDefinition.cpp @@ -47,7 +47,7 @@ CInstanceConfigurableElement *CInstanceDefinition::doInstantiate() const // Element not supposed to be instantiated direcly assert(0); - return NULL; + return nullptr; } void CInstanceDefinition::createInstances(CElement *pFatherElement) diff --git a/upstream/parameter/InstanceDefinition.h b/upstream/parameter/InstanceDefinition.h index 212c535..0624c94 100644 --- a/upstream/parameter/InstanceDefinition.h +++ b/upstream/parameter/InstanceDefinition.h @@ -38,9 +38,9 @@ class CInstanceDefinition : public CTypeElement public: void createInstances(CElement *pFatherElement); - virtual std::string getKind() const; + std::string getKind() const override; private: - virtual bool childrenAreDynamic() const; - virtual CInstanceConfigurableElement *doInstantiate() const; + bool childrenAreDynamic() const override; + CInstanceConfigurableElement *doInstantiate() const override; }; diff --git a/upstream/parameter/IntegerParameterType.h b/upstream/parameter/IntegerParameterType.h index 5eea40b..bf7bc97 100644 --- a/upstream/parameter/IntegerParameterType.h +++ b/upstream/parameter/IntegerParameterType.h @@ -42,48 +42,49 @@ public: CIntegerParameterType(const std::string &strName); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; /// Conversion // String - virtual bool toBlackboard(const std::string &strValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(const std::string &strValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(std::string &strValue, const uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Integer - virtual bool toBlackboard(uint32_t uiUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(uint32_t &uiUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(uint32_t uiUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(uint32_t &uiUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Signed Integer - virtual bool toBlackboard(int32_t iUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(int32_t &iUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(int32_t iUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(int32_t &iUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Double - virtual bool toBlackboard(double dUserValue, uint32_t &uiValue, - CParameterAccessContext ¶meterAccessContext) const; - virtual bool fromBlackboard(double &dUserValue, uint32_t uiValue, - CParameterAccessContext ¶meterAccessContext) const; + bool toBlackboard(double dUserValue, uint32_t &uiValue, + CParameterAccessContext ¶meterAccessContext) const override; + bool fromBlackboard(double &dUserValue, uint32_t uiValue, + CParameterAccessContext ¶meterAccessContext) const override; // Default value handling (simulation only) - virtual uint32_t getDefaultValue() const; + uint32_t getDefaultValue() const override; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // Integer conversion - virtual int toPlainInteger(int iSizeOptimizedData) const; + int toPlainInteger(int iSizeOptimizedData) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: // Returns true if children dynamic creation is to be dealt with - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Conversion from std::string bool convertValueFromString(const std::string &strValue, int64_t &iData, diff --git a/upstream/parameter/KindElement.h b/upstream/parameter/KindElement.h index 848180a..608a832 100644 --- a/upstream/parameter/KindElement.h +++ b/upstream/parameter/KindElement.h @@ -41,7 +41,7 @@ public: { } - virtual std::string getKind() const { return _strKind; } + std::string getKind() const override { return _strKind; } private: std::string _strKind; }; diff --git a/upstream/parameter/KindElementBuilderTemplate.h b/upstream/parameter/KindElementBuilderTemplate.h index ffce475..22666e6 100644 --- a/upstream/parameter/KindElementBuilderTemplate.h +++ b/upstream/parameter/KindElementBuilderTemplate.h @@ -37,7 +37,7 @@ class TKindElementBuilderTemplate : public CElementBuilder public: TKindElementBuilderTemplate() : CElementBuilder() {} - virtual CElement *createElement(const CXmlElement &xmlElement) const + CElement *createElement(const CXmlElement &xmlElement) const override { return new ElementType(xmlElement.getNameAttribute(), xmlElement.getType()); } diff --git a/upstream/parameter/LinearParameterAdaptation.h b/upstream/parameter/LinearParameterAdaptation.h index 0c6ff5e..ac349af 100644 --- a/upstream/parameter/LinearParameterAdaptation.h +++ b/upstream/parameter/LinearParameterAdaptation.h @@ -40,14 +40,15 @@ public: CLinearParameterAdaptation(const std::string &strType); // Conversions - virtual int64_t fromUserValue(double dValue) const; - virtual double toUserValue(int64_t iValue) const; + int64_t fromUserValue(double dValue) const override; + double toUserValue(int64_t iValue) const override; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; private: // Slope attributes diff --git a/upstream/parameter/LogarithmicParameterAdaptation.h b/upstream/parameter/LogarithmicParameterAdaptation.h index 9c2553b..fc3d3d6 100644 --- a/upstream/parameter/LogarithmicParameterAdaptation.h +++ b/upstream/parameter/LogarithmicParameterAdaptation.h @@ -53,12 +53,13 @@ public: * f'(y) * log(base) = log (x) * exp(f'(y)*log(base)) = x */ - virtual int64_t fromUserValue(double dValue) const; - virtual double toUserValue(int64_t iValue) const; + int64_t fromUserValue(double dValue) const override; + double toUserValue(int64_t iValue) const override; - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; private: /** diff --git a/upstream/parameter/LoggingElementBuilderTemplate.cpp b/upstream/parameter/LoggingElementBuilderTemplate.cpp index 8c87a47..b640c93 100644 --- a/upstream/parameter/LoggingElementBuilderTemplate.cpp +++ b/upstream/parameter/LoggingElementBuilderTemplate.cpp @@ -37,4 +37,4 @@ std::string getName(const CXmlElement &xmlElement) { return xmlElement.getNameAttribute(); } -} +} // namespace details diff --git a/upstream/parameter/LoggingElementBuilderTemplate.h b/upstream/parameter/LoggingElementBuilderTemplate.h index 1bfff06..a4b407b 100644 --- a/upstream/parameter/LoggingElementBuilderTemplate.h +++ b/upstream/parameter/LoggingElementBuilderTemplate.h @@ -58,7 +58,7 @@ namespace details * */ std::string PARAMETER_EXPORT getName(const CXmlElement &xmlElement); -} +} // namespace details /** * Builder for elements which need logger at construction @@ -85,7 +85,7 @@ public: * * @return pointer to the generated element */ - virtual CElement *createElement(const CXmlElement &xmlElement) const + CElement *createElement(const CXmlElement &xmlElement) const override { return new ElementType(details::getName(xmlElement), mLogger); } diff --git a/upstream/parameter/MappingContext.cpp b/upstream/parameter/MappingContext.cpp index 1235e31..3599296 100644 --- a/upstream/parameter/MappingContext.cpp +++ b/upstream/parameter/MappingContext.cpp @@ -63,15 +63,15 @@ size_t CMappingContext::getItemAsInteger(size_t itemType) const return 0; } - return strtoul(mItems[itemType].strItem->c_str(), NULL, 0); + return strtoul(mItems[itemType].strItem->c_str(), nullptr, 0); } const string *CMappingContext::getItem(const string &strKey) const { auto itemFound = find_if(begin(mItems), end(mItems), [&](const SItem &item) { - return item.strKey != NULL && strKey == *item.strKey; + return item.strKey != nullptr && strKey == *item.strKey; }); - return (itemFound != end(mItems)) ? itemFound->strKey : NULL; + return (itemFound != end(mItems)) ? itemFound->strKey : nullptr; } bool CMappingContext::iSet(size_t itemType) const diff --git a/upstream/parameter/MappingData.cpp b/upstream/parameter/MappingData.cpp index cc34103..3ea054e 100644 --- a/upstream/parameter/MappingData.cpp +++ b/upstream/parameter/MappingData.cpp @@ -73,7 +73,7 @@ bool CMappingData::init(const std::string &rawMapping, std::string &error) bool CMappingData::getValue(const std::string &strkey, const std::string *&pStrValue) const { - KeyToValueMapConstIterator it = _keyToValueMap.find(strkey); + auto it = _keyToValueMap.find(strkey); if (it != _keyToValueMap.end()) { diff --git a/upstream/parameter/NamedElementBuilderTemplate.h b/upstream/parameter/NamedElementBuilderTemplate.h index 8c22956..26bff26 100644 --- a/upstream/parameter/NamedElementBuilderTemplate.h +++ b/upstream/parameter/NamedElementBuilderTemplate.h @@ -35,7 +35,7 @@ template <class ElementType> class TNamedElementBuilderTemplate : public CElementBuilder { public: - virtual CElement *createElement(const CXmlElement &xmlElement) const + CElement *createElement(const CXmlElement &xmlElement) const override { return new ElementType(xmlElement.getNameAttribute()); } diff --git a/upstream/parameter/Parameter.h b/upstream/parameter/Parameter.h index 2c97409..f6fa60a 100644 --- a/upstream/parameter/Parameter.h +++ b/upstream/parameter/Parameter.h @@ -41,15 +41,15 @@ public: CParameter(const std::string &strName, const CTypeElement *pTypeElement); // Instantiation, allocation - virtual size_t getFootPrint() const; + size_t getFootPrint() const override; // Type - virtual Type getType() const; + Type getType() const override; // XML configuration settings parsing/composing - virtual bool serializeXmlSettings( + bool serializeXmlSettings( CXmlElement &xmlConfigurationSettingsElementContent, - CConfigurationAccessContext &configurationAccessContext) const; + CConfigurationAccessContext &configurationAccessContext) const override; // Boolean access bool access(bool &bValue, bool bSet, @@ -69,13 +69,13 @@ public: protected: // Used for simulation and virtual subsystems - virtual void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const; + void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const override; // Actual value access - virtual bool doSetValue(const std::string &strValue, size_t offset, - CParameterAccessContext ¶meterAccessContext) const; - virtual void doGetValue(std::string &strValue, size_t offset, - CParameterAccessContext ¶meterAccessContext) const; + bool doSetValue(const std::string &strValue, size_t offset, + CParameterAccessContext ¶meterAccessContext) const override; + void doGetValue(std::string &strValue, size_t offset, + CParameterAccessContext ¶meterAccessContext) const override; // Value space handling for configuration import void handleValueSpaceAttribute(CXmlElement &xmlConfigurableElementSettingsElement, diff --git a/upstream/parameter/ParameterAdaptation.h b/upstream/parameter/ParameterAdaptation.h index d9cbe4b..d600161 100644 --- a/upstream/parameter/ParameterAdaptation.h +++ b/upstream/parameter/ParameterAdaptation.h @@ -39,17 +39,18 @@ public: CParameterAdaptation(const std::string &strType); // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // Conversions virtual int64_t fromUserValue(double dValue) const; virtual double toUserValue(int64_t iValue) const; // CElement - virtual std::string getKind() const; + std::string getKind() const override; protected: // Attributes diff --git a/upstream/parameter/ParameterBlock.h b/upstream/parameter/ParameterBlock.h index 0ebfdbe..a1d037c 100644 --- a/upstream/parameter/ParameterBlock.h +++ b/upstream/parameter/ParameterBlock.h @@ -42,5 +42,5 @@ public: } // Type - virtual Type getType() const { return EParameterBlock; } + Type getType() const override { return EParameterBlock; } }; diff --git a/upstream/parameter/ParameterBlockType.h b/upstream/parameter/ParameterBlockType.h index 6d81ee8..3662a0f 100644 --- a/upstream/parameter/ParameterBlockType.h +++ b/upstream/parameter/ParameterBlockType.h @@ -39,12 +39,12 @@ public: CParameterBlockType(const std::string &strName); // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; // Instantiation - virtual CInstanceConfigurableElement *doInstantiate() const; + CInstanceConfigurableElement *doInstantiate() const override; // Population - virtual void populate(CElement *pElement) const; + void populate(CElement *pElement) const override; }; diff --git a/upstream/parameter/ParameterFrameworkConfiguration.h b/upstream/parameter/ParameterFrameworkConfiguration.h index a94f7ef..8972beb 100644 --- a/upstream/parameter/ParameterFrameworkConfiguration.h +++ b/upstream/parameter/ParameterFrameworkConfiguration.h @@ -46,11 +46,12 @@ public: uint16_t getServerPort() const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; private: - virtual std::string getKind() const; - virtual bool childrenAreDynamic() const; + std::string getKind() const override; + bool childrenAreDynamic() const override; // System class name std::string _strSystemClassName; diff --git a/upstream/parameter/ParameterMgr.cpp b/upstream/parameter/ParameterMgr.cpp index f450563..d56277c 100644 --- a/upstream/parameter/ParameterMgr.cpp +++ b/upstream/parameter/ParameterMgr.cpp @@ -433,7 +433,7 @@ bool CParameterMgr::loadFrameworkConfiguration(string &strError) _xmlDoc *doc = CXmlDocSource::mkXmlDoc(_xmlConfigurationUri, true, true, elementSerializingContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -517,7 +517,7 @@ bool CParameterMgr::loadStructure(string &strError) LOG_CONTEXT("Importing system structure from file " + structureUri); _xmlDoc *doc = CXmlDocSource::mkXmlDoc(structureUri, true, true, parameterBuildContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -608,7 +608,7 @@ bool CParameterMgr::loadSettingsFromConfigFile(string &strError) _xmlDoc *doc = CXmlDocSource::mkXmlDoc(configurationDomainsUri, true, true, xmlDomainImportContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -702,7 +702,7 @@ const CConfigurableElement *CParameterMgr::getConfigurableElement(const string & // Nagivate through system class if (!pathNavigator.navigateThrough(getConstSystemClass()->getName(), strError)) { - return NULL; + return nullptr; } // Find element @@ -712,7 +712,7 @@ const CConfigurableElement *CParameterMgr::getConfigurableElement(const string & strError = "Path not found: " + strPath; - return NULL; + return nullptr; } // Check found element is a parameter @@ -739,7 +739,7 @@ CParameterHandle *CParameterMgr::createParameterHandle(const string &strPath, st // Element not found strError = "Element not found: " + strPath; - return NULL; + return nullptr; } if (!pConfigurableElement->isParameter()) { @@ -747,7 +747,7 @@ CParameterHandle *CParameterMgr::createParameterHandle(const string &strPath, st // Element is not parameter strError = "Not a parameter: " + strPath; - return NULL; + return nullptr; } // Convert as parameter and return new handle @@ -1355,7 +1355,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listElementsCommand { CElementLocator elementLocator(getSystemClass(), false); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1382,7 +1382,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listParametersComma { CElementLocator elementLocator(getSystemClass(), false); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1408,7 +1408,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementStructure { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1432,7 +1432,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementBytesComm { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1479,7 +1479,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setElementBytesComm // Retrieve configurable element CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1622,7 +1622,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::dumpElementCommandP { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1645,7 +1645,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementSizeComma { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1667,7 +1667,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::showPropertiesComma { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1715,7 +1715,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listBelongingDomain { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1737,7 +1737,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listAssociatedDomai { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -2012,7 +2012,7 @@ bool CParameterMgr::accessConfigurationValue(const string &strDomain, { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strPath, &pLocatedElement, strError)) { @@ -2028,7 +2028,7 @@ bool CParameterMgr::accessConfigurationValue(const string &strDomain, size_t baseOffset; bool bIsLastApplied; - CParameterBlackboard *pConfigurationBlackboard = NULL; + CParameterBlackboard *pConfigurationBlackboard = nullptr; { pConfigurationBlackboard = getConstConfigurableDomains()->findConfigurationBlackboard( @@ -2400,7 +2400,7 @@ bool CParameterMgr::addConfigurableElementToDomain(const string &strDomain, CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) { @@ -2443,7 +2443,7 @@ bool CParameterMgr::removeConfigurableElementFromDomain(const string &strDomain, CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) { @@ -2475,7 +2475,7 @@ bool CParameterMgr::split(const string &strDomain, const string &strConfigurable CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) { @@ -2603,7 +2603,7 @@ bool CParameterMgr::wrapLegacyXmlImport(const string &xmlSource, bool fromFile, // It doesn't make sense to resolve XIncludes on an imported file because // we can't reliably decide of a "base url" _xmlDoc *doc = CXmlDocSource::mkXmlDoc(xmlSource, fromFile, false, xmlDomainImportContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -2654,7 +2654,7 @@ bool CParameterMgr::exportSingleDomainXml(string &xmlDest, const string &domainN const CConfigurableDomain *requestedDomain = getConstConfigurableDomains()->findConfigurableDomain(domainName, errorMsg); - if (requestedDomain == NULL) { + if (requestedDomain == nullptr) { return false; } @@ -2738,7 +2738,7 @@ CParameterBlackboard *CParameterMgr::getParameterBlackboard() void CParameterMgr::feedElementLibraries() { // Global Configuration handling - CElementLibrary *pFrameworkConfigurationLibrary = new CElementLibrary; + auto pFrameworkConfigurationLibrary = new CElementLibrary; pFrameworkConfigurationLibrary->addElementBuilder( "ParameterFrameworkConfiguration", @@ -2759,7 +2759,7 @@ void CParameterMgr::feedElementLibraries() _pElementLibrarySet->addElementLibrary(pFrameworkConfigurationLibrary); // Parameter creation - CElementLibrary *pParameterCreationLibrary = new CElementLibrary; + auto pParameterCreationLibrary = new CElementLibrary; pParameterCreationLibrary->addElementBuilder( "Subsystem", new CSubsystemElementBuilder(getSystemClass()->getSubsystemLibrary())); @@ -2798,7 +2798,7 @@ void CParameterMgr::feedElementLibraries() _pElementLibrarySet->addElementLibrary(pParameterCreationLibrary); // Parameter Configuration Domains creation - CElementLibrary *pParameterConfigurationLibrary = new CElementLibrary; + auto pParameterConfigurationLibrary = new CElementLibrary; pParameterConfigurationLibrary->addElementBuilder( "ConfigurableDomain", new TElementBuilderTemplate<CConfigurableDomain>()); @@ -2863,7 +2863,7 @@ bool CParameterMgr::handleRemoteProcessingInterface(string &strError) return false; } - if (_pRemoteProcessorServer == NULL) { + if (_pRemoteProcessorServer == nullptr) { strError = "ParameterMgr: Unable to create Remote Processor Server"; return false; } diff --git a/upstream/parameter/ParameterMgr.h b/upstream/parameter/ParameterMgr.h index 784f55f..bc0726d 100644 --- a/upstream/parameter/ParameterMgr.h +++ b/upstream/parameter/ParameterMgr.h @@ -85,7 +85,7 @@ class CParameterMgr : private CElement public: // Construction CParameterMgr(const std::string &strConfigurationFilePath, core::log::ILogger &logger); - virtual ~CParameterMgr(); + ~CParameterMgr() override; /** Load plugins, structures and settings from the config file given. * @@ -388,14 +388,14 @@ public: std::string &strResult) const; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: CParameterMgr(const CParameterMgr &); CParameterMgr &operator=(const CParameterMgr &); // Init - virtual bool init(std::string &strError); + bool init(std::string &strError) override; // Version std::string getVersion() const; diff --git a/upstream/parameter/ParameterMgrLogger.h b/upstream/parameter/ParameterMgrLogger.h index aafb76a..778a203 100644 --- a/upstream/parameter/ParameterMgrLogger.h +++ b/upstream/parameter/ParameterMgrLogger.h @@ -43,9 +43,9 @@ class CParameterMgrLogger : public core::log::ILogger, private utility::NonCopya public: CParameterMgrLogger(T ¶meterMgrConnector) : _parameterMgrConnector(parameterMgrConnector) {} - virtual void info(const std::string &log) { _parameterMgrConnector.info(log); } + void info(const std::string &log) override { _parameterMgrConnector.info(log); } - virtual void warning(const std::string &log) { _parameterMgrConnector.warning(log); } + void warning(const std::string &log) override { _parameterMgrConnector.warning(log); } private: // Log destination diff --git a/upstream/parameter/ParameterMgrPlatformConnector.cpp b/upstream/parameter/ParameterMgrPlatformConnector.cpp index 8eff7c9..c69d76e 100644 --- a/upstream/parameter/ParameterMgrPlatformConnector.cpp +++ b/upstream/parameter/ParameterMgrPlatformConnector.cpp @@ -39,7 +39,7 @@ CParameterMgrPlatformConnector::CParameterMgrPlatformConnector( const string &strConfigurationFilePath) : _pParameterMgrLogger(new CParameterMgrLogger<CParameterMgrPlatformConnector>(*this)), _pParameterMgr(new CParameterMgr(strConfigurationFilePath, *_pParameterMgrLogger)), - _bStarted(false), _pLogger(NULL) + _bStarted(false), _pLogger(nullptr) { } diff --git a/upstream/parameter/ParameterType.h b/upstream/parameter/ParameterType.h index 5cb32d9..b3a5685 100644 --- a/upstream/parameter/ParameterType.h +++ b/upstream/parameter/ParameterType.h @@ -45,7 +45,7 @@ class PARAMETER_EXPORT CParameterType : public CTypeElement { public: CParameterType(const std::string &strName); - virtual ~CParameterType() = default; + ~CParameterType() override = default; // Size size_t getSize() const; @@ -55,10 +55,11 @@ public: void setUnit(const std::string &strUnit); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; /// Conversions // String @@ -104,7 +105,7 @@ public: CConfigurationAccessContext &configurationAccessContext) const; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // Default value handling (simulation only) virtual uint32_t getDefaultValue() const; @@ -125,7 +126,7 @@ public: protected: // Object creation - virtual void populate(CElement *pElement) const; + void populate(CElement *pElement) const override; // Size void setSize(size_t size); @@ -151,7 +152,7 @@ private: void setXmlUnitAttribute(CXmlElement &xmlElement) const; // Instantiation - virtual CInstanceConfigurableElement *doInstantiate() const; + CInstanceConfigurableElement *doInstantiate() const override; // Generic Access template <typename type> void doSignExtend(type &data) const; diff --git a/upstream/parameter/PathNavigator.cpp b/upstream/parameter/PathNavigator.cpp index 36deaea..22cf19a 100644 --- a/upstream/parameter/PathNavigator.cpp +++ b/upstream/parameter/PathNavigator.cpp @@ -87,7 +87,7 @@ std::string *CPathNavigator::next() return &_astrItems[_currentIndex++]; } - return NULL; + return nullptr; } std::string CPathNavigator::getCurrentPath() const diff --git a/upstream/parameter/PluginLocation.h b/upstream/parameter/PluginLocation.h index 2a663d2..cf7d4db 100644 --- a/upstream/parameter/PluginLocation.h +++ b/upstream/parameter/PluginLocation.h @@ -39,7 +39,8 @@ public: CPluginLocation(const std::string &strName, const std::string &strKind); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // Folder const std::string &getFolder() const; diff --git a/upstream/parameter/Results.h b/upstream/parameter/Results.h index 3f7a13c..d0dbaae 100644 --- a/upstream/parameter/Results.h +++ b/upstream/parameter/Results.h @@ -38,4 +38,4 @@ namespace core /** String list type which can hold list of error/info */ typedef std::list<std::string> Results; -} /** core namespace */ +} // namespace core diff --git a/upstream/parameter/RuleParser.cpp b/upstream/parameter/RuleParser.cpp index 72424d2..e069cd1 100644 --- a/upstream/parameter/RuleParser.cpp +++ b/upstream/parameter/RuleParser.cpp @@ -70,7 +70,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError) case EBeginCompoundRule: { // Create new compound rule - CCompoundRule *pCompoundRule = new CCompoundRule; + auto pCompoundRule = new CCompoundRule; // Parse if (!pCompoundRule->parse(*this, strError)) { @@ -104,7 +104,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError) break; case ECriterionRule: { // Create new criterion rule - CSelectionCriterionRule *pCriterionRule = new CSelectionCriterionRule; + auto pCriterionRule = new CSelectionCriterionRule; // Parse if (!pCriterionRule->parse(*this, strError)) { @@ -114,7 +114,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError) return false; } - ALWAYS_ASSERT(pParentRule != NULL, "Invalid parent rule given to rule parser"); + ALWAYS_ASSERT(pParentRule != nullptr, "Invalid parent rule given to rule parser"); // Chain pParentRule->addChild(pCriterionRule); @@ -232,7 +232,7 @@ CCompoundRule *CRuleParser::grabRootRule() assert(pRootRule); - _pRootRule = NULL; + _pRootRule = nullptr; return pRootRule; } diff --git a/upstream/parameter/SelectionCriteria.h b/upstream/parameter/SelectionCriteria.h index 22f4de1..daa1b95 100644 --- a/upstream/parameter/SelectionCriteria.h +++ b/upstream/parameter/SelectionCriteria.h @@ -68,7 +68,7 @@ public: bool bHumanReadable) const; // Base - virtual std::string getKind() const; + std::string getKind() const override; // Reset the modified status of the children void resetModifiedStatus(); diff --git a/upstream/parameter/SelectionCriteriaDefinition.cpp b/upstream/parameter/SelectionCriteriaDefinition.cpp index 12f1aa2..dc8259c 100644 --- a/upstream/parameter/SelectionCriteriaDefinition.cpp +++ b/upstream/parameter/SelectionCriteriaDefinition.cpp @@ -39,7 +39,7 @@ std::string CSelectionCriteriaDefinition::getKind() const CSelectionCriterion *CSelectionCriteriaDefinition::createSelectionCriterion( const std::string &strName, const CSelectionCriterionType *pType, core::log::Logger &logger) { - CSelectionCriterion *pSelectionCriterion = new CSelectionCriterion(strName, pType, logger); + auto pSelectionCriterion = new CSelectionCriterion(strName, pType, logger); addChild(pSelectionCriterion); diff --git a/upstream/parameter/SelectionCriteriaDefinition.h b/upstream/parameter/SelectionCriteriaDefinition.h index a8fa75a..1d9a648 100644 --- a/upstream/parameter/SelectionCriteriaDefinition.h +++ b/upstream/parameter/SelectionCriteriaDefinition.h @@ -52,7 +52,7 @@ public: bool bHumanReadable) const; // Base - virtual std::string getKind() const; + std::string getKind() const override; // Reset the modified status of the children void resetModifiedStatus(); diff --git a/upstream/parameter/SelectionCriterion.h b/upstream/parameter/SelectionCriterion.h index 76ec0ff..9c2dfe2 100644 --- a/upstream/parameter/SelectionCriterion.h +++ b/upstream/parameter/SelectionCriterion.h @@ -47,12 +47,12 @@ public: /// From ISelectionCriterionInterface // State - virtual void setCriterionState(int iState); - virtual int getCriterionState() const; + void setCriterionState(int iState) override; + int getCriterionState() const override; // Name - virtual std::string getCriterionName() const; + std::string getCriterionName() const override; // Type - virtual const ISelectionCriterionTypeInterface *getCriterionType() const; + const ISelectionCriterionTypeInterface *getCriterionType() const override; // Modified status bool hasBeenModified() const; void resetModifiedStatus(); @@ -67,7 +67,7 @@ public: std::string getFormattedDescription(bool bWithTypeInfo, bool bHumanReadable) const; /// From CElement - virtual std::string getKind() const; + std::string getKind() const override; /** * Export to XML @@ -76,7 +76,7 @@ public: * @param[in] serializingContext The serializing context * */ - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; private: // Current state diff --git a/upstream/parameter/SelectionCriterionLibrary.cpp b/upstream/parameter/SelectionCriterionLibrary.cpp index fc9e943..09fda7c 100644 --- a/upstream/parameter/SelectionCriterionLibrary.cpp +++ b/upstream/parameter/SelectionCriterionLibrary.cpp @@ -39,7 +39,7 @@ std::string CSelectionCriterionLibrary::getKind() const // Type creation CSelectionCriterionType *CSelectionCriterionLibrary::createSelectionCriterionType(bool bIsInclusive) { - CSelectionCriterionType *pSelectionCriterionType = new CSelectionCriterionType(bIsInclusive); + auto pSelectionCriterionType = new CSelectionCriterionType(bIsInclusive); addChild(pSelectionCriterionType); diff --git a/upstream/parameter/SelectionCriterionLibrary.h b/upstream/parameter/SelectionCriterionLibrary.h index a152258..0ff9ac9 100644 --- a/upstream/parameter/SelectionCriterionLibrary.h +++ b/upstream/parameter/SelectionCriterionLibrary.h @@ -39,5 +39,5 @@ public: CSelectionCriterionType *createSelectionCriterionType(bool bIsInclusive); // CElement - virtual std::string getKind() const; + std::string getKind() const override; }; diff --git a/upstream/parameter/SelectionCriterionRule.h b/upstream/parameter/SelectionCriterionRule.h index c51bfa2..7dac343 100644 --- a/upstream/parameter/SelectionCriterionRule.h +++ b/upstream/parameter/SelectionCriterionRule.h @@ -56,22 +56,23 @@ class CSelectionCriterionRule : public CRule public: // Parse - virtual bool parse(CRuleParser &ruleParser, std::string &strError); + bool parse(CRuleParser &ruleParser, std::string &strError) override; // Dump std::string dump() const override; // Rule check - virtual bool matches() const; + bool matches() const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // Class kind - virtual std::string getKind() const; + std::string getKind() const override; protected: // Content dumping diff --git a/upstream/parameter/SelectionCriterionType.cpp b/upstream/parameter/SelectionCriterionType.cpp index 3354702..d97d18b 100644 --- a/upstream/parameter/SelectionCriterionType.cpp +++ b/upstream/parameter/SelectionCriterionType.cpp @@ -118,7 +118,7 @@ bool CSelectionCriterionType::getNumericalValue(const std::string &strValue, int bool CSelectionCriterionType::getAtomicNumericalValue(const std::string &strValue, int &iValue) const { - NumToLitMapConstIt it = _numToLitMap.find(strValue); + auto it = _numToLitMap.find(strValue); if (it != _numToLitMap.end()) { diff --git a/upstream/parameter/SelectionCriterionType.h b/upstream/parameter/SelectionCriterionType.h index 5c13c8f..4b2f767 100644 --- a/upstream/parameter/SelectionCriterionType.h +++ b/upstream/parameter/SelectionCriterionType.h @@ -42,7 +42,7 @@ public: CSelectionCriterionType(bool bIsInclusive); // From ISelectionCriterionTypeInterface - virtual bool addValuePair(int iValue, const std::string &strValue, std::string &strError); + bool addValuePair(int iValue, const std::string &strValue, std::string &strError) override; /** * Retrieve the numerical value from the std::string representation of the criterion type. * @@ -53,15 +53,15 @@ public: * * @return true if integer value retrieved from the std::string one, false otherwise. */ - virtual bool getNumericalValue(const std::string &strValue, int &iValue) const; - virtual bool getLiteralValue(int iValue, std::string &strValue) const; - virtual bool isTypeInclusive() const; + bool getNumericalValue(const std::string &strValue, int &iValue) const override; + bool getLiteralValue(int iValue, std::string &strValue) const override; + bool isTypeInclusive() const override; // Value list std::string listPossibleValues() const; // Formatted state - virtual std::string getFormattedState(int iValue) const; + std::string getFormattedState(int iValue) const override; /** * Export to XML @@ -70,10 +70,10 @@ public: * @param[in] serializingContext The serializing context * */ - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // From CElement - virtual std::string getKind() const; + std::string getKind() const override; private: /** diff --git a/upstream/parameter/SimulatedBackSynchronizer.h b/upstream/parameter/SimulatedBackSynchronizer.h index f561b89..e8e15f5 100644 --- a/upstream/parameter/SimulatedBackSynchronizer.h +++ b/upstream/parameter/SimulatedBackSynchronizer.h @@ -43,7 +43,7 @@ public: CParameterBlackboard *pParameterBlackboard); // Back synchronization - virtual void sync(); + void sync() override; private: // Fake error for parameter context creation diff --git a/upstream/parameter/StringParameter.h b/upstream/parameter/StringParameter.h index 6adede9..a7bba8e 100644 --- a/upstream/parameter/StringParameter.h +++ b/upstream/parameter/StringParameter.h @@ -39,20 +39,20 @@ public: CStringParameter(const std::string &strName, const CTypeElement *pTypeElement); // Instantiation, allocation - virtual size_t getFootPrint() const; + size_t getFootPrint() const override; // Type - virtual Type getType() const; + Type getType() const override; protected: // Used for simulation and virtual subsystems - virtual void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const; + void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const override; // Actual value access (tuning) - virtual bool doSetValue(const std::string &strValue, size_t offset, - CParameterAccessContext ¶meterAccessContext) const; - virtual void doGetValue(std::string &strValue, size_t offset, - CParameterAccessContext ¶meterAccessContext) const; + bool doSetValue(const std::string &strValue, size_t offset, + CParameterAccessContext ¶meterAccessContext) const override; + void doGetValue(std::string &strValue, size_t offset, + CParameterAccessContext ¶meterAccessContext) const override; // Size size_t getSize() const; diff --git a/upstream/parameter/StringParameterType.h b/upstream/parameter/StringParameterType.h index 9d8786f..9e00ec5 100644 --- a/upstream/parameter/StringParameterType.h +++ b/upstream/parameter/StringParameterType.h @@ -44,20 +44,21 @@ public: size_t getMaxLength() const; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // CElement - virtual std::string getKind() const; + std::string getKind() const override; private: // Instantiation - virtual CInstanceConfigurableElement *doInstantiate() const; + CInstanceConfigurableElement *doInstantiate() const override; // Max length in bytes size_t _maxLength{0}; diff --git a/upstream/parameter/Subsystem.cpp b/upstream/parameter/Subsystem.cpp index 43e633d..c422a88 100644 --- a/upstream/parameter/Subsystem.cpp +++ b/upstream/parameter/Subsystem.cpp @@ -252,7 +252,7 @@ string CSubsystem::getFormattedSubsystemMappingData( findSubsystemObjectFromConfigurableElement(pInstanceConfigurableElement); // Exit if node does not correspond to a SubsystemObject - if (pSubsystemObject == NULL) { + if (pSubsystemObject == nullptr) { return ""; } diff --git a/upstream/parameter/Subsystem.h b/upstream/parameter/Subsystem.h index af7e1fb..fa18ce7 100644 --- a/upstream/parameter/Subsystem.h +++ b/upstream/parameter/Subsystem.h @@ -61,10 +61,10 @@ public: * @param[in] logger the main logger of the application */ CSubsystem(const std::string &strName, core::log::Logger &logger); - virtual ~CSubsystem(); + ~CSubsystem() override; - virtual bool structureFromXml(const CXmlElement &xmlElement, - CXmlSerializingContext &serializingContext); + bool structureFromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // Susbsystem sanity virtual bool isAlive() const; @@ -73,9 +73,9 @@ public: virtual bool needResync(bool bClear); // from CElement - virtual std::string getKind() const; + std::string getKind() const override; - virtual bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const; + bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const override; std::string getFormattedMapping() const override; /** @@ -98,7 +98,7 @@ public: protected: // Used for simulation and virtual subsystems - virtual void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const; + void setDefaultValues(CParameterAccessContext ¶meterAccessContext) const override; /// Functionality intendedn for derived Subsystems // Subsystem context mapping keys publication @@ -111,7 +111,7 @@ private: CSubsystem &operator=(const CSubsystem &); // Belonging subsystem - virtual const CSubsystem *getBelongingSubsystem() const; + const CSubsystem *getBelongingSubsystem() const override; // Mapping execution bool mapSubsystemElements(std::string &strError); @@ -130,9 +130,9 @@ private: * * @return true on success, false on failure */ - virtual bool mapBegin(CInstanceConfigurableElement *pInstanceConfigurableElement, - bool &bKeepDiving, std::string &strError); - virtual void mapEnd(); + bool mapBegin(CInstanceConfigurableElement *pInstanceConfigurableElement, bool &bKeepDiving, + std::string &strError) override; + void mapEnd() override; // Mapping access /** diff --git a/upstream/parameter/SubsystemElementBuilder.h b/upstream/parameter/SubsystemElementBuilder.h index 4dfe78f..2a6e0a6 100644 --- a/upstream/parameter/SubsystemElementBuilder.h +++ b/upstream/parameter/SubsystemElementBuilder.h @@ -38,7 +38,7 @@ class CSubsystemElementBuilder : public CElementBuilder public: CSubsystemElementBuilder(const CSubsystemLibrary *pSubsystemLibrary); - virtual CElement *createElement(const CXmlElement &xmlElement) const; + CElement *createElement(const CXmlElement &xmlElement) const override; private: const CSubsystemLibrary *_pSubsystemLibrary; diff --git a/upstream/parameter/SubsystemLibrary.h b/upstream/parameter/SubsystemLibrary.h index f3082e2..fa73da8 100644 --- a/upstream/parameter/SubsystemLibrary.h +++ b/upstream/parameter/SubsystemLibrary.h @@ -48,7 +48,7 @@ class CSubsystemLibrary { private: // Builder type (based on element's name attribute) - virtual std::string getBuilderType(const CXmlElement &xmlElement) const + std::string getBuilderType(const CXmlElement &xmlElement) const override { // Xml element's name attribute std::string type; diff --git a/upstream/parameter/SubsystemObject.h b/upstream/parameter/SubsystemObject.h index 2400573..11d8299 100644 --- a/upstream/parameter/SubsystemObject.h +++ b/upstream/parameter/SubsystemObject.h @@ -46,7 +46,7 @@ class PARAMETER_EXPORT CSubsystemObject : private ISyncer public: CSubsystemObject(CInstanceConfigurableElement *pInstanceConfigurableElement, core::log::Logger &logger); - virtual ~CSubsystemObject(); + ~CSubsystemObject() override; /** * Return the mapping value of the SubystemObject. @@ -100,8 +100,7 @@ private: /** This method is not supposed to be overridden by plugins * as if not called, plugins will not work (sets _blackboard). */ - bool sync(CParameterBlackboard ¶meterBlackboard, bool bBack, - std::string &strError) override final; + bool sync(CParameterBlackboard ¶meterBlackboard, bool bBack, std::string &strError) final; // Default back synchronization void setDefaultValues(CParameterBlackboard ¶meterBlackboard) const; diff --git a/upstream/parameter/SubsystemPlugins.h b/upstream/parameter/SubsystemPlugins.h index c5eb1c6..5123c28 100644 --- a/upstream/parameter/SubsystemPlugins.h +++ b/upstream/parameter/SubsystemPlugins.h @@ -42,5 +42,5 @@ public: } private: - virtual bool childrenAreDynamic() const { return true; } + bool childrenAreDynamic() const override { return true; } }; diff --git a/upstream/parameter/SyncerSet.cpp b/upstream/parameter/SyncerSet.cpp index c27245c..b2c0913 100644 --- a/upstream/parameter/SyncerSet.cpp +++ b/upstream/parameter/SyncerSet.cpp @@ -68,7 +68,7 @@ bool CSyncerSet::sync(CParameterBlackboard ¶meterBlackboard, bool bBack, if (!pSyncer->sync(parameterBlackboard, bBack, strError)) { - if (errors != NULL) { + if (errors != nullptr) { errors->push_back(strError); } diff --git a/upstream/parameter/SystemClass.cpp b/upstream/parameter/SystemClass.cpp index 21c7a86..ef2383b 100644 --- a/upstream/parameter/SystemClass.cpp +++ b/upstream/parameter/SystemClass.cpp @@ -182,7 +182,7 @@ bool CSystemClass::loadPlugins(list<string> &lstrPluginFiles, core::Results &err bool bAtLeastOneSubsystemPluginSuccessfullyLoaded = false; - list<string>::iterator it = lstrPluginFiles.begin(); + auto it = lstrPluginFiles.begin(); while (it != lstrPluginFiles.end()) { diff --git a/upstream/parameter/SystemClass.h b/upstream/parameter/SystemClass.h index 43a581b..bb9a8aa 100644 --- a/upstream/parameter/SystemClass.h +++ b/upstream/parameter/SystemClass.h @@ -48,7 +48,7 @@ public: * it need to be given to the subsystem library */ CSystemClass(core::log::Logger &logger); - virtual ~CSystemClass(); + ~CSystemClass() override; /** Load subsystem plugin and fill the corresponding libraries. * @@ -81,7 +81,7 @@ public: void cleanSubsystemsNeedToResync(); // base - virtual std::string getKind() const; + std::string getKind() const override; bool getMappingData(const std::string &strKey, const std::string *&pStrValue) const override; std::string getFormattedMapping() const override; @@ -90,7 +90,7 @@ private: CSystemClass(const CSystemClass &); CSystemClass &operator=(const CSystemClass &); // base - virtual bool childrenAreDynamic() const; + bool childrenAreDynamic() const override; /** Load shared libraries subsystem plugins. * diff --git a/upstream/parameter/TypeElement.h b/upstream/parameter/TypeElement.h index 9d8f46f..e73987c 100644 --- a/upstream/parameter/TypeElement.h +++ b/upstream/parameter/TypeElement.h @@ -41,7 +41,7 @@ class PARAMETER_EXPORT CTypeElement : public CElement { public: CTypeElement(const std::string &strName = ""); - virtual ~CTypeElement(); + ~CTypeElement() override; // Instantiation CInstanceConfigurableElement *instantiate() const; @@ -58,13 +58,14 @@ public: virtual std::string getFormattedMapping() const; // Element properties - virtual void showProperties(std::string &strResult) const; + void showProperties(std::string &strResult) const override; // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; // From IXmlSource - virtual void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const; + void toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const override; // Scalar or Array? bool isScalar() const; diff --git a/upstream/parameter/VirtualSubsystem.h b/upstream/parameter/VirtualSubsystem.h index 8590361..1b3f63f 100644 --- a/upstream/parameter/VirtualSubsystem.h +++ b/upstream/parameter/VirtualSubsystem.h @@ -43,11 +43,11 @@ public: * @param[in] logger the main logger of the application */ CVirtualSubsystem(const std::string &strName, core::log::Logger &logger); - virtual ~CVirtualSubsystem(); + ~CVirtualSubsystem() override; protected: // Syncer - virtual ISyncer *getSyncer() const; + ISyncer *getSyncer() const override; /** * Fill Syncer Set From descendant nodes @@ -59,9 +59,9 @@ protected: private: // From IMapper - virtual bool mapBegin(CInstanceConfigurableElement *pInstanceConfigurableElement, - bool &bKeepDiving, std::string &strError); - virtual void mapEnd(); + bool mapBegin(CInstanceConfigurableElement *pInstanceConfigurableElement, bool &bKeepDiving, + std::string &strError) override; + void mapEnd() override; // Subsystem level dummy syncer CVirtualSyncer *_pVirtualSyncer; diff --git a/upstream/parameter/VirtualSyncer.h b/upstream/parameter/VirtualSyncer.h index 3942678..1139f0c 100644 --- a/upstream/parameter/VirtualSyncer.h +++ b/upstream/parameter/VirtualSyncer.h @@ -39,7 +39,8 @@ public: CVirtualSyncer(const CConfigurableElement *pConfigurableElement); // from ISyncer - virtual bool sync(CParameterBlackboard ¶meterBlackboard, bool bBack, std::string &strError); + bool sync(CParameterBlackboard ¶meterBlackboard, bool bBack, + std::string &strError) override; private: const CConfigurableElement *_pConfigurableElement; diff --git a/upstream/parameter/XmlFileIncluderElement.h b/upstream/parameter/XmlFileIncluderElement.h index 144e078..ab864e6 100644 --- a/upstream/parameter/XmlFileIncluderElement.h +++ b/upstream/parameter/XmlFileIncluderElement.h @@ -40,7 +40,8 @@ public: CXmlFileIncluderElement(const std::string &strName, const std::string &strKind, bool bValidateWithSchemas, const std::string &schemaBaseUri); // From IXmlSink - virtual bool fromXml(const CXmlElement &xmlElement, CXmlSerializingContext &serializingContext); + bool fromXml(const CXmlElement &xmlElement, + CXmlSerializingContext &serializingContext) override; private: // Element type diff --git a/upstream/parameter/log/include/log/Context.h b/upstream/parameter/log/include/log/Context.h index a3d5fd4..b03f9ca 100644 --- a/upstream/parameter/log/include/log/Context.h +++ b/upstream/parameter/log/include/log/Context.h @@ -68,5 +68,5 @@ private: Logger &mLogger; }; -} /** log namespace */ -} /** core namespace */ +} // namespace log +} // namespace core diff --git a/upstream/parameter/log/include/log/ILogger.h b/upstream/parameter/log/include/log/ILogger.h index 9b72813..c405f5e 100644 --- a/upstream/parameter/log/include/log/ILogger.h +++ b/upstream/parameter/log/include/log/ILogger.h @@ -47,5 +47,5 @@ protected: virtual ~ILogger() {} }; -} /** log namespace */ -} /** core namespace */ +} // namespace log +} // namespace core diff --git a/upstream/parameter/log/include/log/LogWrapper.h b/upstream/parameter/log/include/log/LogWrapper.h index 14624e4..8226876 100644 --- a/upstream/parameter/log/include/log/LogWrapper.h +++ b/upstream/parameter/log/include/log/LogWrapper.h @@ -131,6 +131,6 @@ typedef details::LogWrapper<false> Info; /** Default warning logger type */ typedef details::LogWrapper<true> Warning; -} /** details namespace */ -} /** log namespace */ -} /** core namespace */ +} // namespace details +} // namespace log +} // namespace core diff --git a/upstream/parameter/log/include/log/Logger.h b/upstream/parameter/log/include/log/Logger.h index b224d35..ea16f4e 100644 --- a/upstream/parameter/log/include/log/Logger.h +++ b/upstream/parameter/log/include/log/Logger.h @@ -76,5 +76,5 @@ private: std::string mProlog; }; -} /** log namespace */ -} /** core namespace */ +} // namespace log +} // namespace core diff --git a/upstream/remote-processor/AnswerMessage.h b/upstream/remote-processor/AnswerMessage.h index 8275d5d..2bc5147 100644 --- a/upstream/remote-processor/AnswerMessage.h +++ b/upstream/remote-processor/AnswerMessage.h @@ -47,13 +47,13 @@ public: private: // Fill data to send - virtual void fillDataToSend(); + void fillDataToSend() override; // Collect received data - virtual void collectReceivedData(); + void collectReceivedData() override; /** @return size of the answer message in bytes */ - virtual size_t getDataSize() const; + size_t getDataSize() const override; // Answer void setAnswer(const std::string &strAnswer); diff --git a/upstream/remote-processor/BackgroundRemoteProcessorServer.h b/upstream/remote-processor/BackgroundRemoteProcessorServer.h index 1c17fca..221c08b 100644 --- a/upstream/remote-processor/BackgroundRemoteProcessorServer.h +++ b/upstream/remote-processor/BackgroundRemoteProcessorServer.h @@ -43,7 +43,7 @@ public: BackgroundRemoteProcessorServer(uint16_t uiPort, std::unique_ptr<IRemoteCommandHandler> &&commandHandler); - ~BackgroundRemoteProcessorServer(); + ~BackgroundRemoteProcessorServer() override; bool start(std::string &error) override; diff --git a/upstream/remote-processor/CMakeLists.txt b/upstream/remote-processor/CMakeLists.txt index ee21f55..5887bf5 100644 --- a/upstream/remote-processor/CMakeLists.txt +++ b/upstream/remote-processor/CMakeLists.txt @@ -40,12 +40,7 @@ generate_export_header(remote-processor set(CMAKE_THREAD_PREFER_PTHREAD 1) find_package(Threads REQUIRED) -target_include_directories(remote-processor - # Symbol export macro header - PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" - # TODO: separate remote-processor's includes in half (public/private) - PUBLIC .) - target_link_libraries(remote-processor PRIVATE pfw_utility asio ${CMAKE_THREAD_LIBS_INIT}) -install(TARGETS remote-processor LIBRARY DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS remote-processor EXPORT ParameterTargets + LIBRARY DESTINATION lib RUNTIME DESTINATION bin) diff --git a/upstream/remote-processor/RemoteCommand.h b/upstream/remote-processor/RemoteCommand.h index 025a133..7560206 100644 --- a/upstream/remote-processor/RemoteCommand.h +++ b/upstream/remote-processor/RemoteCommand.h @@ -48,7 +48,7 @@ public: * @returns a reference to a vector containing all the arguments. */ virtual const std::vector<std::string> &getArguments() const = 0; - virtual const std::string packArguments(size_t startArgument, size_t nbArguments) const = 0; + virtual std::string packArguments(size_t startArgument, size_t nbArguments) const = 0; protected: virtual ~IRemoteCommand() {} diff --git a/upstream/remote-processor/RemoteCommandHandlerTemplate.h b/upstream/remote-processor/RemoteCommandHandlerTemplate.h index db59a5b..3d1ef55 100644 --- a/upstream/remote-processor/RemoteCommandHandlerTemplate.h +++ b/upstream/remote-processor/RemoteCommandHandlerTemplate.h @@ -116,9 +116,9 @@ public: : _pCommandParser(pCommandParser), _maxCommandUsageLength(0) { // Help Command - addCommandParser("help", NULL, 0, "", "Show commands description and usage"); + addCommandParser("help", nullptr, 0, "", "Show commands description and usage"); } - ~TRemoteCommandHandlerTemplate() + ~TRemoteCommandHandlerTemplate() override { // FIXME use unique_ptr for (auto *parser : _remoteCommandParserVector) { @@ -147,7 +147,7 @@ public: private: // Command processing - bool remoteCommandProcess(const IRemoteCommand &remoteCommand, std::string &strResult) + bool remoteCommandProcess(const IRemoteCommand &remoteCommand, std::string &strResult) override { // Dispatch const CRemoteCommandParserItem *pRemoteCommandParserItem = @@ -216,7 +216,7 @@ private: return pRemoteCommandParserItem; } } - return NULL; + return nullptr; } private: diff --git a/upstream/remote-processor/RequestMessage.cpp b/upstream/remote-processor/RequestMessage.cpp index 0eb1e85..0c32438 100644 --- a/upstream/remote-processor/RequestMessage.cpp +++ b/upstream/remote-processor/RequestMessage.cpp @@ -28,6 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "RequestMessage.h" +#include "Utility.h" #include <assert.h> #include <algorithm> #include <ctype.h> @@ -81,30 +82,12 @@ const string &CRequestMessage::getArgument(size_t argument) const return _argumentVector[argument]; } -const string CRequestMessage::packArguments(size_t uiStartArgument, size_t uiNbArguments) const +string CRequestMessage::packArguments(size_t uiStartArgument, size_t uiNbArguments) const { - string strPackedArguments; - assert(uiStartArgument + uiNbArguments <= _argumentVector.size()); - // Pack arguments, separating them with a space - bool bFirst = true; - - for (size_t argument = uiStartArgument; argument < uiStartArgument + uiNbArguments; - argument++) { - - if (!bFirst) { - - strPackedArguments += " "; - } else { - - bFirst = false; - } - - strPackedArguments += _argumentVector[argument]; - } - - return strPackedArguments; + auto start = begin(_argumentVector) + uiStartArgument; + return utility::asString(std::vector<std::string>(start, start + uiNbArguments), " "); } // Fill data to send diff --git a/upstream/remote-processor/RequestMessage.h b/upstream/remote-processor/RequestMessage.h index 7c78db6..57c0be0 100644 --- a/upstream/remote-processor/RequestMessage.h +++ b/upstream/remote-processor/RequestMessage.h @@ -44,14 +44,14 @@ public: // Command Name void setCommand(const std::string &strCommand); - virtual const std::string &getCommand() const; + const std::string &getCommand() const override; // Arguments - virtual void addArgument(const std::string &strArgument); - virtual size_t getArgumentCount() const; - virtual const std::string &getArgument(size_t argument) const; - virtual const std::vector<std::string> &getArguments() const; - virtual const std::string packArguments(size_t startArgument, size_t nbArguments) const; + void addArgument(const std::string &strArgument) override; + size_t getArgumentCount() const override; + const std::string &getArgument(size_t argument) const override; + const std::vector<std::string> &getArguments() const override; + std::string packArguments(size_t startArgument, size_t nbArguments) const override; private: /** @@ -62,14 +62,14 @@ private: static const char *const gacDelimiters; // Fill data to send - virtual void fillDataToSend(); + void fillDataToSend() override; // Collect received data - virtual void collectReceivedData(); + void collectReceivedData() override; // Size /** * @return size of the request message in bytes */ - virtual size_t getDataSize() const; + size_t getDataSize() const override; // Trim input std::string static std::string trim(const std::string &strToTrim); diff --git a/upstream/skeleton-subsystem/CMakeLists.txt b/upstream/skeleton-subsystem/CMakeLists.txt index 1ec822d..1bc1d87 100644 --- a/upstream/skeleton-subsystem/CMakeLists.txt +++ b/upstream/skeleton-subsystem/CMakeLists.txt @@ -31,6 +31,8 @@ cmake_minimum_required(VERSION 2.8.12) project(parameter-framework-plugins-skeleton) +find_package(ParameterFramework REQUIRED) + if(WIN32) # Force include iso646.h to support alternative operator form (and, or, not...) # Such support is require by the standard and can be enabled with /Za @@ -45,29 +47,16 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN true) # Force libs and executable to all be at a known place - simplifies a lot of -# things, expecially setting the test environment +# things, especially setting the test environment set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) -# -# Find PFW libraries and include directories -# -find_path(PFW_INCLUDE_ROOT NAMES parameter/plugin/Plugin.h) - -find_library(PFW_CORE_LIBRARY NAMES parameter) - -set(PFW_INCLUDE_DIRS - ${PFW_INCLUDE_ROOT}/parameter/plugin - ${PFW_INCLUDE_ROOT}/xmlserializer - ${PFW_INCLUDE_ROOT}/utility) - add_library(skeleton-subsystem MODULE SkeletonSubsystemBuilder.cpp SkeletonSubsystem.cpp SkeletonSubsystemObject.cpp) -target_include_directories(skeleton-subsystem PRIVATE ${PFW_INCLUDE_DIRS}) -target_link_libraries(skeleton-subsystem ${PFW_CORE_LIBRARY}) +target_link_libraries(skeleton-subsystem PRIVATE ParameterFramework::plugin) install(TARGETS skeleton-subsystem LIBRARY DESTINATION lib diff --git a/upstream/skeleton-subsystem/test/CMakeLists.txt b/upstream/skeleton-subsystem/test/CMakeLists.txt index 46cb669..d36d456 100644 --- a/upstream/skeleton-subsystem/test/CMakeLists.txt +++ b/upstream/skeleton-subsystem/test/CMakeLists.txt @@ -30,8 +30,7 @@ configure_file(structure.xml "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) configure_file(toplevel.xml "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) add_executable(skeleton-test main.cpp) -target_include_directories(skeleton-test PRIVATE "${PFW_INCLUDE_ROOT}/parameter/client") -target_link_libraries(skeleton-test "${PFW_CORE_LIBRARY}") +target_link_libraries(skeleton-test PRIVATE ParameterFramework::parameter) add_test(NAME skeleton-test WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Domains/tDomain_Configuration.py b/upstream/test/functional-tests-legacy/PfwTestCase/Domains/tDomain_Configuration.py index 8c5e641..3bc1d03 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Domains/tDomain_Configuration.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Domains/tDomain_Configuration.py @@ -308,7 +308,7 @@ class TestCases(PfwTestCase): - no configuration created - existent configurations not affected by error """ - print self.test_Conf_Renaming_Error.__doc__ + print(self.test_Conf_Renaming_Error.__doc__) # New domain creation for testing purpose log.I("New domain creation for testing purpose : %s" % (self.domain_name)) log.I("command [createDomain]") diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Export_Import_Domains.py b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Export_Import_Domains.py index 2bfc50a..09dbbff 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Export_Import_Domains.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Export_Import_Domains.py @@ -46,7 +46,7 @@ Test cases : - Testing import errors - Testing export errors """ -import os, commands +import os import unittest from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Sync.py b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Sync.py index d95318d..4d6c994 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Sync.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_Sync.py @@ -44,7 +44,7 @@ Test cases : - Testing sync nominal case - Testing errors """ -import commands, os +import os import unittest from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_getParameter.py b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_getParameter.py index e0c7fb9..53abd42 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_getParameter.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_getParameter.py @@ -71,6 +71,6 @@ class TestCases(PfwTestCase): #Get undefined parameter value log.I("Get undefined parameter value") out, err = self.pfw.sendCmd("getParameter", "Undefined_parameter", expectSuccess=False) - print str(out) + print(str(out)) assert err == None, "Error when getting parameter : %s" % (err) assert out != "Done", "Error not detected when getting an undefined parameter" diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_listingFunctions.py b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_listingFunctions.py index 327f2e4..f0e8f3a 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_listingFunctions.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Functions/tFunction_listingFunctions.py @@ -41,7 +41,7 @@ Test cases : - Testing dumpDomains function on nominal case - Testing dumpElements function on nominal case """ -import commands, os +import os import unittest from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBit_Block.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBit_Block.py index f0161ad..f530997 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBit_Block.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBit_Block.py @@ -55,7 +55,6 @@ Test cases : """ import os -import commands import unittest from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBoolean.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBoolean.py index 9c95692..f9db199 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBoolean.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tBoolean.py @@ -126,7 +126,7 @@ class TestCases(PfwTestCase): ~~~~~~~~~~~~~~~~~ - Error detected, boolean not updated """ - print self.testBooleanNegative.__doc__ + print(self.testBooleanNegative.__doc__) value = "-1" out, err = self.pfw.sendCmd("setParameter", self.param_name, value, expectSuccess=False) assert err == None, log.E("When setting parameter %s : %s" % (self.param_name, err)) @@ -152,7 +152,7 @@ class TestCases(PfwTestCase): ~~~~~~~~~~~~~~~~~ - Error detected, boolean not updated """ - print self.testBooleanOverflow.__doc__ + print(self.testBooleanOverflow.__doc__) value = "2" out, err = self.pfw.sendCmd("setParameter", self.param_name, value, expectSuccess=False) assert err == None, log.E("When setting parameter %s : %s" % (self.param_name, err)) diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tEnum.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tEnum.py index 524e763..88199dd 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tEnum.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tEnum.py @@ -51,7 +51,6 @@ Test cases : - Enum parameter undefined value = UNDEF """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q0_15.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q0_15.py index 0c9e273..692fbc6 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q0_15.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q0_15.py @@ -52,7 +52,6 @@ Test cases : - FP16_Q0.15 parameter in nominal case = 0.2453 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q15_0.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q15_0.py index 11e237b..bf46e82 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q15_0.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q15_0.py @@ -52,7 +52,6 @@ Test cases : - FP16_Q15.0 parameter in nominal case = 2222 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q7_8.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q7_8.py index 2fb44d3..0e06602 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q7_8.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP16_Q7_8.py @@ -52,7 +52,6 @@ Test cases : - FP16_Q7.8 parameter in nominal case = 23.59 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q0_31.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q0_31.py index 133d481..4dcb7a0 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q0_31.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q0_31.py @@ -52,7 +52,6 @@ Test cases : - FP16_Q0.31 parameter in nominal case = 0.5000000000 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q15_16.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q15_16.py index 013855a..2acc8a0 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q15_16.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q15_16.py @@ -52,7 +52,6 @@ Test cases : - FP32_Q15.16 parameter in nominal case = 12345.12345 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q31_0.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q31_0.py index 4497d52..4373209 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q31_0.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q31_0.py @@ -52,7 +52,6 @@ Test cases : - FP32_Q31.0 parameter in nominal case = 2222 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q8_20.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q8_20.py index 126a6a2..a2d85f1 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q8_20.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP32_Q8_20.py @@ -52,7 +52,6 @@ Test cases : - FP32_Q8.20 parameter in nominal case = -128.123456 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q0_7.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q0_7.py index dc1d733..8748a22 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q0_7.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q0_7.py @@ -52,7 +52,6 @@ Test cases : - FP8_Q0.7 parameter in nominal case = 0.50 """ import os -import commands import unittest from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q3_4.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q3_4.py index 825d3d2..15cab87 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q3_4.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q3_4.py @@ -52,7 +52,6 @@ Test cases : - FP8_Q0.7 parameter in nominal case = 4.3 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q7_0.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q7_0.py index 4918aa7..e783691 100755 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q7_0.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tFP8_Q7_0.py @@ -52,7 +52,6 @@ Test cases : - FP8_Q7.0 parameter in nominal case = 64 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16.py index 774bc56..3443f1a 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16.py @@ -51,7 +51,6 @@ Test cases : - INT16 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_ARRAY.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_ARRAY.py index 34fa1cc..d280c07 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_ARRAY.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_ARRAY.py @@ -52,7 +52,6 @@ Test cases : - Testing array index out of bounds """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() @@ -66,9 +65,9 @@ class TestCases(PfwTestCase): def setUp(self): self.param_name = "/Test/Test/TEST_DIR/INT16_ARRAY" self.param_short_name = os.environ["PFW_RESULT"] + "/INT16_ARRAY" - print '\r' + print('\r') self.pfw.sendCmd("setTuningMode", "on") - print '\r' + print('\r') self.array_size = 5 self.array_min = -50 self.array_max = 50 @@ -302,7 +301,7 @@ class TestCases(PfwTestCase): log.D(self.test_Array_Index_Overflow.__doc__) index_values = (self.array_size-1, self.array_size+1, -1) for index in index_values: - print index + print(index) indexed_array_value = self.array_max indexed_array_value_path = "".join([self.param_name, "/", str(index)]) #Check parameter value setting diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_Max.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_Max.py index 62d2db1..53cecb3 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_Max.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT16_Max.py @@ -51,7 +51,6 @@ Test cases : - INT16_Max parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32.py index fc82b03..b1cc0de 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32.py @@ -51,7 +51,6 @@ Test cases : - INT32 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() @@ -83,8 +82,8 @@ class TestCases(PfwTestCase): - INT32 parameter set to 50 - Blackboard and filesystem values checked """ - print self.test_Nominal_Case.__doc__ - print "INFO : INT32 parameter in nominal case = 50" + print(self.test_Nominal_Case.__doc__) + print("INFO : INT32 parameter in nominal case = 50") value = "50" hex_value = "0x32" #Set parameter value @@ -97,7 +96,7 @@ class TestCases(PfwTestCase): assert out == value, "BLACKBOARD : Incorrect value for %s, expected: %s, found: %s" % (self.param_name, value, out) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] == hex_value, "FILESYSTEM : parameter update error" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMin(self): """ @@ -117,8 +116,8 @@ class TestCases(PfwTestCase): - INT32 parameter set to -1000 - Blackboard and filesystem values checked """ - print self.test_TypeMin.__doc__ - print "INFO : INT32 parameter min value = -1000" + print(self.test_TypeMin.__doc__) + print("INFO : INT32 parameter min value = -1000") value = "-1000" hex_value = "0xfffffc18" #Set parameter value @@ -131,7 +130,7 @@ class TestCases(PfwTestCase): assert out == value, "BLACKBOARD : Incorrect value for %s, expected: %s, found: %s" % (self.param_name, value, out) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] == hex_value, "FILESYSTEM : parameter update error" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMin_Overflow(self): """ @@ -152,8 +151,8 @@ class TestCases(PfwTestCase): - INT32 parameter not updated - Blackboard and filesystem values checked """ - print self.test_TypeMin_Overflow.__doc__ - print "INFO : INT32 parameter min value out of bounds = -1001" + print(self.test_TypeMin_Overflow.__doc__) + print("INFO : INT32 parameter min value out of bounds = -1001") value = "-1001" param_check = open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] #Set parameter value @@ -162,7 +161,7 @@ class TestCases(PfwTestCase): assert out != "Done", "PFW : Error not detected when setting parameter %s out of bounds" % (self.param_name) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] == param_check, "FILESYSTEM : Forbiden parameter change" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMax(self): """ @@ -182,8 +181,8 @@ class TestCases(PfwTestCase): - INT32 parameter set to 1000 - Blackboard and filesystem values checked """ - print self.test_TypeMax.__doc__ - print "INFO : INT32 parameter max value = 1000" + print(self.test_TypeMax.__doc__) + print("INFO : INT32 parameter max value = 1000") value = "1000" hex_value = "0x3e8" #Set parameter value @@ -196,7 +195,7 @@ class TestCases(PfwTestCase): assert out == value, "BLACKBOARD : Incorrect value for %s, expected: %s, found: %s" % (self.param_name, value, out) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] == hex_value, "FILESYSTEM : parameter update error" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMax_Overflow(self): """ @@ -217,8 +216,8 @@ class TestCases(PfwTestCase): - INT32 parameter not updated - Blackboard and filesystem values checked """ - print self.test_TypeMax_Overflow.__doc__ - print "INFO : INT32 parameter max value out of bounds = 1001" + print(self.test_TypeMax_Overflow.__doc__) + print("INFO : INT32 parameter max value out of bounds = 1001") value = "1001" param_check = open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] #Set parameter value @@ -227,4 +226,4 @@ class TestCases(PfwTestCase): assert out != "Done", "PFW : Error not detected when setting parameter %s out of bounds" % (self.param_name) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT32").read()[:-1] == param_check, "FILESYSTEM : Forbiden parameter change" - print "INFO : test OK" + print("INFO : test OK") diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32_Max.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32_Max.py index 15e5dde..5d8b2b9 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32_Max.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT32_Max.py @@ -51,7 +51,6 @@ Test cases : - INT32_Max parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8.py index f82a524..884fb5d 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8.py @@ -51,7 +51,6 @@ Test cases : - INT8 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8_Max.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8_Max.py index 9eff0bb..46e0476 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8_Max.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tINT8_Max.py @@ -51,7 +51,6 @@ Test cases : - INT8_Max parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() @@ -83,8 +82,8 @@ class TestCases(PfwTestCase): - INT8_Max parameter set to 50 - Blackboard and filesystem values checked """ - print self.test_Nominal_Case.__doc__ - print "INFO : INT8_Max parameter in nominal case = 50" + print(self.test_Nominal_Case.__doc__) + print("INFO : INT8_Max parameter in nominal case = 50") value = "50" hex_value = "0x32" #Set parameter value @@ -97,7 +96,7 @@ class TestCases(PfwTestCase): assert out == value, "BLACKBOARD : Incorrect value for %s, expected: %s, found: %s" % (self.param_name, value, out) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] == hex_value, "FILESYSTEM : parameter update error" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMin(self): """ @@ -117,8 +116,8 @@ class TestCases(PfwTestCase): - INT8_Max parameter set to -128 - Blackboard and filesystem values checked """ - print self.test_TypeMin.__doc__ - print "INFO : INT8_Max parameter min value = -128" + print(self.test_TypeMin.__doc__) + print("INFO : INT8_Max parameter min value = -128") value = "-128" hex_value = "0x80" #Set parameter value @@ -131,7 +130,7 @@ class TestCases(PfwTestCase): assert out == value, "BLACKBOARD : Incorrect value for %s, expected: %s, found: %s" % (self.param_name, value, out) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] == hex_value, "FILESYSTEM : parameter update error" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMin_Overflow(self): """ @@ -152,8 +151,8 @@ class TestCases(PfwTestCase): - INT8_Max parameter not updated - Blackboard and filesystem values checked """ - print self.test_TypeMin_Overflow.__doc__ - print "INFO : INT8_Max parameter min value out of bounds = -129" + print(self.test_TypeMin_Overflow.__doc__) + print("INFO : INT8_Max parameter min value out of bounds = -129") value = "-129" param_check = open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] #Set parameter value @@ -162,7 +161,7 @@ class TestCases(PfwTestCase): assert out != "Done", "PFW : Error not detected when setting parameter %s out of bounds" % (self.param_name) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] == param_check, "FILESYSTEM : Forbiden parameter change" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMax(self): """ @@ -182,8 +181,8 @@ class TestCases(PfwTestCase): - INT8_Max parameter set to 127 - Blackboard and filesystem values checked """ - print self.test_TypeMax.__doc__ - print "INFO : INT8_Max parameter max value = 127" + print(self.test_TypeMax.__doc__) + print("INFO : INT8_Max parameter max value = 127") value = "127" hex_value = "0x7f" #Set parameter value @@ -196,7 +195,7 @@ class TestCases(PfwTestCase): assert out == value, "BLACKBOARD : Incorrect value for %s, expected: %s, found: %s" % (self.param_name, value, out) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] == hex_value, "FILESYSTEM : parameter update error" - print "INFO : test OK" + print("INFO : test OK") def test_TypeMax_Overflow(self): """ @@ -217,8 +216,8 @@ class TestCases(PfwTestCase): - INT8_Max parameter not updated - Blackboard and filesystem values checked """ - print self.test_TypeMax_Overflow.__doc__ - print "INFO : INT8_Max parameter max value out of bounds = 128" + print(self.test_TypeMax_Overflow.__doc__) + print("INFO : INT8_Max parameter max value out of bounds = 128") value = "128" param_check = open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] #Set parameter value @@ -227,4 +226,4 @@ class TestCases(PfwTestCase): assert out != "Done", "PFW : Error not detected when setting parameter %s out of bounds" % (self.param_name) #Check parameter value on filesystem assert open(os.environ["PFW_RESULT"] + "/INT8_Max").read()[:-1] == param_check, "FILESYSTEM : Forbiden parameter change" - print "INFO : test OK" + print("INFO : test OK") diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tParameter_Block.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tParameter_Block.py index 76317b4..bff1e47 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tParameter_Block.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tParameter_Block.py @@ -51,7 +51,6 @@ Test cases : - Testing error : Try to set an undefined param """ import os -import commands import unittest from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tRAW.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tRAW.py index eb7dc5b..023267a 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tRAW.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tRAW.py @@ -67,7 +67,6 @@ Test cases : - Writing Raw """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py index 78f829f..44af52d 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py @@ -29,7 +29,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os -import commands, string, random +import string, random from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16.py index f7fc72e..3ff0796 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16.py @@ -54,7 +54,6 @@ Test cases : - UINT16 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16_Max.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16_Max.py index 805017e..5368ed1 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16_Max.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT16_Max.py @@ -53,7 +53,6 @@ Test cases : - UINT16_Max parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32.py index e33296b..2813567 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32.py @@ -53,7 +53,6 @@ Test cases : - UINT32 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_ARRAY.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_ARRAY.py index c277a06..41060c8 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_ARRAY.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_ARRAY.py @@ -54,7 +54,6 @@ Test cases : - Testing value format error """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() @@ -67,9 +66,9 @@ class TestCases(PfwTestCase): def setUp(self): self.param_name = "/Test/Test/TEST_DIR/UINT32_ARRAY" self.param_short_name = os.environ["PFW_RESULT"] + "/UINT32_ARRAY" - print '\r' + print('\r') self.pfw.sendCmd("setTuningMode", "on") - print '\r' + print('\r') self.array_size = 100 self.array_min = 0 self.array_max = 100 @@ -303,7 +302,7 @@ class TestCases(PfwTestCase): log.D(self.test_Array_Index_Overflow.__doc__) index_values = (self.array_size-1, self.array_size+1, -1) for index in index_values: - print index + print(index) indexed_array_value = self.array_max indexed_array_value_path = "".join([self.param_name, "/", str(index)]) #Check parameter value setting diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_Max.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_Max.py index 9966ac3..5a5af92 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_Max.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT32_Max.py @@ -53,7 +53,6 @@ Test cases : - UINT16 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8.py index 8a6c815..674c7f1 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8.py @@ -53,7 +53,6 @@ Test cases : - UINT8 parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_ARRAY.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_ARRAY.py index 88c2e58..9090d1b 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_ARRAY.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_ARRAY.py @@ -54,7 +54,6 @@ Test cases : - Testing value format error """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() @@ -67,9 +66,9 @@ class TestCases(PfwTestCase): def setUp(self): self.param_name = "/Test/Test/TEST_DIR/UINT8_ARRAY" self.param_short_name = os.environ["PFW_RESULT"] + "/UINT8_ARRAY" - print '\r' + print('\r') self.pfw.sendCmd("setTuningMode", "on") - print '\r' + print('\r') self.array_size = 5 self.array_min = 0 self.array_max = 15 @@ -303,7 +302,7 @@ class TestCases(PfwTestCase): log.D(self.test_Array_Index_Overflow.__doc__) index_values = (self.array_size-1, self.array_size+1, -1) for index in index_values: - print index + print(index) indexed_array_value = self.array_max indexed_array_value_path = "".join([self.param_name, "/", str(index)]) #Check parameter value setting diff --git a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_Max.py b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_Max.py index 71bfdab..b12cdb1 100644 --- a/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_Max.py +++ b/upstream/test/functional-tests-legacy/PfwTestCase/Types/tUINT8_Max.py @@ -53,7 +53,6 @@ Test cases : - UINT8_Max parameter in nominal case = 50 """ import os -import commands from Util.PfwUnitTestLib import PfwTestCase from Util import ACTLogging log=ACTLogging.Logger() diff --git a/upstream/test/functional-tests-legacy/Util/ACTLogging.py b/upstream/test/functional-tests-legacy/Util/ACTLogging.py index fdc71ef..23bed09 100644 --- a/upstream/test/functional-tests-legacy/Util/ACTLogging.py +++ b/upstream/test/functional-tests-legacy/Util/ACTLogging.py @@ -30,19 +30,19 @@ class Logger(object) : def E(self, string): - print "\nERROR: %s\n" % (string) + print("\nERROR: %s\n" % (string)) return "ERROR: %s" % (string) def F(self, string): - print "\nFAIL : %s\n" % (string) + print("\nFAIL : %s\n" % (string)) return "FAIL : %s" % (string) def I(self, string): - print "INFO : %s" % (string) + print("INFO : %s" % (string)) return "INFO : %s" % (string) def D(self, string): - print "\n======================================================================" - print "%s" %(string) - print "======================================================================" + print("\n======================================================================") + print("%s" %(string)) + print("======================================================================") return string diff --git a/upstream/test/functional-tests-legacy/Util/PfwUnitTestLib.py b/upstream/test/functional-tests-legacy/Util/PfwUnitTestLib.py index 78b1f76..d75084c 100644 --- a/upstream/test/functional-tests-legacy/Util/PfwUnitTestLib.py +++ b/upstream/test/functional-tests-legacy/Util/PfwUnitTestLib.py @@ -55,12 +55,12 @@ class RemoteCli(object): sys_cmd = self.platform_command + [cmd] if args is not None: sys_cmd += args - print "CMD : %s" % sys_cmd + print("CMD : %s" % sys_cmd) try: p = subprocess.Popen(sys_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except Exception as (errno, strerror): - return None, strerror + except OSError as error: + return None, error.strerror out, err = p.communicate() out = out.rstrip('\r\n') diff --git a/upstream/test/functional-tests/AutoSync.cpp b/upstream/test/functional-tests/AutoSync.cpp index 9353b8d..d23c0f7 100644 --- a/upstream/test/functional-tests/AutoSync.cpp +++ b/upstream/test/functional-tests/AutoSync.cpp @@ -130,4 +130,4 @@ SCENARIO_METHOD(BoolPF, "Auto sync") } } } -} +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/Basic.cpp b/upstream/test/functional-tests/Basic.cpp index 60e6bbc..b414460 100644 --- a/upstream/test/functional-tests/Basic.cpp +++ b/upstream/test/functional-tests/Basic.cpp @@ -178,4 +178,4 @@ SCENARIO_METHOD(ParameterFramework, "Raw value space") } } -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/CMakeLists.txt b/upstream/test/functional-tests/CMakeLists.txt index 1ab0449..fdc0f69 100644 --- a/upstream/test/functional-tests/CMakeLists.txt +++ b/upstream/test/functional-tests/CMakeLists.txt @@ -42,7 +42,8 @@ if(BUILD_TESTING) find_package(LibXml2 REQUIRED) target_link_libraries(parameterFunctionalTest - PRIVATE parameter catch tmpfile LibXml2::libxml2 introspection-subsystem) + PRIVATE parameter + PRIVATE pfw_utility catch tmpfile LibXml2::libxml2 introspection-subsystem) add_test(NAME parameterFunctionalTest COMMAND parameterFunctionalTest) diff --git a/upstream/test/functional-tests/FloatingPoint.cpp b/upstream/test/functional-tests/FloatingPoint.cpp index fd41797..5581cd4 100644 --- a/upstream/test/functional-tests/FloatingPoint.cpp +++ b/upstream/test/functional-tests/FloatingPoint.cpp @@ -176,4 +176,4 @@ SCENARIO_METHOD(FloatsPF, "Floating points", "[floating points]") } } } -} +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/Config.hpp b/upstream/test/functional-tests/include/Config.hpp index 3d3f117..3f80290 100644 --- a/upstream/test/functional-tests/include/Config.hpp +++ b/upstream/test/functional-tests/include/Config.hpp @@ -79,4 +79,4 @@ struct Config std::string subsystemType = "Virtual"; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/ConfigFiles.hpp b/upstream/test/functional-tests/include/ConfigFiles.hpp index 3d14b86..2aa7107 100644 --- a/upstream/test/functional-tests/include/ConfigFiles.hpp +++ b/upstream/test/functional-tests/include/ConfigFiles.hpp @@ -124,4 +124,4 @@ private: utility::TmpFile mConfigFile; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/ElementHandle.hpp b/upstream/test/functional-tests/include/ElementHandle.hpp index fe42b71..a2f5475 100644 --- a/upstream/test/functional-tests/include/ElementHandle.hpp +++ b/upstream/test/functional-tests/include/ElementHandle.hpp @@ -112,4 +112,4 @@ public: void setAsBytes(const std::vector<uint8_t> &settings) { mayFailSet(&EH::setAsBytes, settings); } }; -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/Exception.hpp b/upstream/test/functional-tests/include/Exception.hpp index 8ae0597..d9e0658 100644 --- a/upstream/test/functional-tests/include/Exception.hpp +++ b/upstream/test/functional-tests/include/Exception.hpp @@ -41,4 +41,4 @@ struct Exception : std::runtime_error using std::runtime_error::runtime_error; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/FailureWrapper.hpp b/upstream/test/functional-tests/include/FailureWrapper.hpp index 753e1dc..41c643a 100644 --- a/upstream/test/functional-tests/include/FailureWrapper.hpp +++ b/upstream/test/functional-tests/include/FailureWrapper.hpp @@ -133,4 +133,4 @@ private: return res; } }; -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/ParameterFramework.hpp b/upstream/test/functional-tests/include/ParameterFramework.hpp index f6f36a8..207733c 100644 --- a/upstream/test/functional-tests/include/ParameterFramework.hpp +++ b/upstream/test/functional-tests/include/ParameterFramework.hpp @@ -170,4 +170,4 @@ private: friend class ElementHandle; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/StoreLogger.hpp b/upstream/test/functional-tests/include/StoreLogger.hpp index 8364157..1943a99 100644 --- a/upstream/test/functional-tests/include/StoreLogger.hpp +++ b/upstream/test/functional-tests/include/StoreLogger.hpp @@ -70,7 +70,7 @@ public: const Logs &getLogs() const { return logs; } - const Logs filter(Log::Level level) const + Logs filter(Log::Level level) const { return filter([&level](const Log &log) { return log.level == level; }); }; @@ -115,4 +115,4 @@ std::ostream &operator<<(std::ostream &os, const StoreLogger::Log &log) return os << log.level << log.msg << std::endl; } -} // parameterFramework +} // namespace parameterFramework diff --git a/upstream/test/functional-tests/include/Test.hpp b/upstream/test/functional-tests/include/Test.hpp index 51f397a..bdc6ca7 100644 --- a/upstream/test/functional-tests/include/Test.hpp +++ b/upstream/test/functional-tests/include/Test.hpp @@ -128,4 +128,4 @@ struct WarningPF : public ParameterFramework setFailureOnFailedSettingsLoad(false); } }; -} +} // namespace parameterFramework diff --git a/upstream/test/introspection-subsystem/CMakeLists.txt b/upstream/test/introspection-subsystem/CMakeLists.txt index faccab3..b59be40 100644 --- a/upstream/test/introspection-subsystem/CMakeLists.txt +++ b/upstream/test/introspection-subsystem/CMakeLists.txt @@ -52,7 +52,7 @@ if (BUILD_TESTING) # # Note : headers located in root project directory remain private. target_include_directories(introspection-subsystem - PUBLIC "include" "${CMAKE_CURRENT_BINARY_DIR}") + PUBLIC "include") - target_link_libraries(introspection-subsystem PRIVATE parameter) + target_link_libraries(introspection-subsystem PRIVATE plugin-internal-hack) endif() diff --git a/upstream/test/introspection-subsystem/IntrospectionEntryPoint.cpp b/upstream/test/introspection-subsystem/IntrospectionEntryPoint.cpp index b26e938..b5028be 100644 --- a/upstream/test/introspection-subsystem/IntrospectionEntryPoint.cpp +++ b/upstream/test/introspection-subsystem/IntrospectionEntryPoint.cpp @@ -40,5 +40,5 @@ bool getParameterValue() { return SubsystemObject::getSingletonInstanceValue(); } -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/upstream/test/introspection-subsystem/IntrospectionSubsystem.cpp b/upstream/test/introspection-subsystem/IntrospectionSubsystem.cpp index 7c3e945..450e052 100644 --- a/upstream/test/introspection-subsystem/IntrospectionSubsystem.cpp +++ b/upstream/test/introspection-subsystem/IntrospectionSubsystem.cpp @@ -41,5 +41,5 @@ Subsystem::Subsystem(const std::string &name, core::log::Logger &logger) : base( { addSubsystemObjectFactory(new TSubsystemObjectFactory<SubsystemObject>("Object", 0)); } -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/upstream/test/introspection-subsystem/IntrospectionSubsystem.h b/upstream/test/introspection-subsystem/IntrospectionSubsystem.h index 1f89841..76abd26 100644 --- a/upstream/test/introspection-subsystem/IntrospectionSubsystem.h +++ b/upstream/test/introspection-subsystem/IntrospectionSubsystem.h @@ -46,5 +46,5 @@ public: private: using base = CSubsystem; }; -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.cpp b/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.cpp index 2a05981..3e5ea37 100644 --- a/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.cpp +++ b/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.cpp @@ -79,5 +79,5 @@ bool SubsystemObject::receiveFromHW(std::string & /*error*/) blackboardRead(&mParameter, parameterSize); return true; } -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.h b/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.h index f91f686..ab21cb9 100644 --- a/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.h +++ b/upstream/test/introspection-subsystem/IntrospectionSubsystemObject.h @@ -85,5 +85,5 @@ private: bool mParameter; }; -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/upstream/test/introspection-subsystem/include/IntrospectionEntryPoint.h b/upstream/test/introspection-subsystem/include/IntrospectionEntryPoint.h index ce3e22c..b7feea9 100644 --- a/upstream/test/introspection-subsystem/include/IntrospectionEntryPoint.h +++ b/upstream/test/introspection-subsystem/include/IntrospectionEntryPoint.h @@ -37,5 +37,5 @@ namespace introspectionSubsystem { INTROSPECTION_SUBSYSTEM_EXPORT bool getParameterValue(); -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/upstream/test/test-platform/TestPlatform.cpp b/upstream/test/test-platform/TestPlatform.cpp index e022131..69715ea 100644 --- a/upstream/test/test-platform/TestPlatform.cpp +++ b/upstream/test/test-platform/TestPlatform.cpp @@ -156,9 +156,9 @@ CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterionFro CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterion( const IRemoteCommand &remoteCommand, string &strResult) { - return createExclusiveSelectionCriterion(remoteCommand.getArgument(0), - strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), - strResult) + return createExclusiveSelectionCriterion( + remoteCommand.getArgument(0), + strtoul(remoteCommand.getArgument(1).c_str(), nullptr, 0), strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } @@ -166,9 +166,9 @@ CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterion( CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterion( const IRemoteCommand &remoteCommand, string &strResult) { - return createInclusiveSelectionCriterion(remoteCommand.getArgument(0), - strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), - strResult) + return createInclusiveSelectionCriterion( + remoteCommand.getArgument(0), + strtoul(remoteCommand.getArgument(1).c_str(), nullptr, 0), strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } @@ -258,7 +258,7 @@ bool CTestPlatform::createExclusiveSelectionCriterionFromStateList( ISelectionCriterionTypeInterface *pCriterionType = mParameterMgrPlatformConnector.createSelectionCriterionType(false); - assert(pCriterionType != NULL); + assert(pCriterionType != nullptr); size_t nbStates = remoteCommand.getArgumentCount() - 1; @@ -286,7 +286,7 @@ bool CTestPlatform::createInclusiveSelectionCriterionFromStateList( ISelectionCriterionTypeInterface *pCriterionType = mParameterMgrPlatformConnector.createSelectionCriterionType(true); - assert(pCriterionType != NULL); + assert(pCriterionType != nullptr); size_t nbStates = remoteCommand.getArgumentCount() - 1; diff --git a/upstream/test/test-subsystem/CMakeLists.txt b/upstream/test/test-subsystem/CMakeLists.txt index eeaa7de..e5e752b 100644 --- a/upstream/test/test-subsystem/CMakeLists.txt +++ b/upstream/test/test-subsystem/CMakeLists.txt @@ -35,5 +35,5 @@ if (BUILD_TESTING) TESTSubsystemString.cpp TESTSubsystemBuilder.cpp) - target_link_libraries(test-subsystem PRIVATE parameter) + target_link_libraries(test-subsystem PRIVATE plugin-internal-hack) endif() diff --git a/upstream/test/test-subsystem/TESTSubsystem.cpp b/upstream/test/test-subsystem/TESTSubsystem.cpp index 473d923..5a1f0e5 100644 --- a/upstream/test/test-subsystem/TESTSubsystem.cpp +++ b/upstream/test/test-subsystem/TESTSubsystem.cpp @@ -60,14 +60,14 @@ CTESTSubsystem::CTESTSubsystem(const std::string &strName, core::log::Logger &lo // Susbsystem sanity health bool CTESTSubsystem::isAlive() const { - assert(gacFwNamePropName != NULL); + assert(gacFwNamePropName != nullptr); return read(std::string(gacFwNamePropName) + "/isAlive") == "true"; } // Resynchronization after subsystem restart needed bool CTESTSubsystem::needResync(bool bClear) { - assert(gacFwNamePropName != NULL); + assert(gacFwNamePropName != nullptr); std::string strNeedResyncFile = std::string(gacFwNamePropName) + "/needResync"; bool bNeedResync; diff --git a/upstream/test/tmpfile/CMakeLists.txt b/upstream/test/tmpfile/CMakeLists.txt index 84818e7..0dba1a1 100644 --- a/upstream/test/tmpfile/CMakeLists.txt +++ b/upstream/test/tmpfile/CMakeLists.txt @@ -34,5 +34,4 @@ if(BUILD_TESTING) endif () add_library(tmpfile STATIC ${OS_SPECIFIC_TMPFILE}) - target_include_directories(tmpfile PUBLIC .) endif() diff --git a/upstream/test/tmpfile/TmpFile.hpp b/upstream/test/tmpfile/TmpFile.hpp index ebefa93..edde7f2 100644 --- a/upstream/test/tmpfile/TmpFile.hpp +++ b/upstream/test/tmpfile/TmpFile.hpp @@ -102,5 +102,5 @@ private: std::string mPath; }; -} // utility -} // parameterFramework +} // namespace utility +} // namespace parameterFramework diff --git a/upstream/test/tmpfile/posix/TmpFile.cpp b/upstream/test/tmpfile/posix/TmpFile.cpp index 36efbd6..5968cde 100644 --- a/upstream/test/tmpfile/posix/TmpFile.cpp +++ b/upstream/test/tmpfile/posix/TmpFile.cpp @@ -53,5 +53,5 @@ std::string TmpFile::mktmp() return path; } -} // utility -} // parameterFramework +} // namespace utility +} // namespace parameterFramework diff --git a/upstream/tools/xmlGenerator/EddParser.py b/upstream/tools/xmlGenerator/EddParser.py index 97a59a7..6465758 100755 --- a/upstream/tools/xmlGenerator/EddParser.py +++ b/upstream/tools/xmlGenerator/EddParser.py @@ -34,8 +34,12 @@ import re import sys import copy -from itertools import izip -from itertools import imap +# For Python 2.x/3.x compatibility +try: + from itertools import izip as zip + from itertools import imap as map +except: + pass # ===================================================================== """ Context classes, used during propagation and the "to PFW script" step """ @@ -113,13 +117,13 @@ class PropagationContext() : class Options () : """handle element options""" def __init__(self, options=[], optionNames=[]) : - self.options = dict(izip(optionNames, options)) + self.options = dict(zip(optionNames, options)) # print(options,optionNames,self.options) def __str__(self) : ops2str = [] - for name, argument in self.options.items() : + for name, argument in list(self.options.items()) : ops2str.append(str(name) + "=\"" + str(argument) + "\"") return " ".join(ops2str) @@ -176,7 +180,7 @@ class Element(object): options = line.split(self.optionDelimiter, len(self.optionNames) - 1) # get ride of leftover spaces - optionsStrip = list(imap(str.strip, options)) + optionsStrip = list(map(str.strip, options)) return optionsStrip @@ -877,12 +881,12 @@ the rest is the rest of the line.""" context.append(myelement) context[-2].addChild(myelement) - except MySyntaxWarning, ex: + except MySyntaxWarning as ex: ex.setLine(line, num + 1) if verbose : - print >>sys.stderr, ex + sys.stderr.write("{}\n".format(ex)) - except MySyntaxError, ex : + except MySyntaxErro as ex : ex.setLine(line, num + 1) raise diff --git a/upstream/tools/xmlGenerator/PFWScriptGenerator.py b/upstream/tools/xmlGenerator/PFWScriptGenerator.py index f43e317..145295d 100755 --- a/upstream/tools/xmlGenerator/PFWScriptGenerator.py +++ b/upstream/tools/xmlGenerator/PFWScriptGenerator.py @@ -133,7 +133,7 @@ def main (): try: myroot.propagate() - except EddParser.MyPropagationError, ex : + except EddParser.MyPropagationError as ex : printE(ex) printE("EXIT ON FAILURE") exit(1) diff --git a/upstream/tools/xmlGenerator/domainGenerator.py b/upstream/tools/xmlGenerator/domainGenerator.py index 0fade85..12a26f1 100755 --- a/upstream/tools/xmlGenerator/domainGenerator.py +++ b/upstream/tools/xmlGenerator/domainGenerator.py @@ -140,7 +140,7 @@ def parseEdd(EDDFiles): try: root.propagate() - except EddParser.MyPropagationError, ex : + except EddParser.MyPropagationError as ex : logging.critical(str(ex)) logging.info("EXIT ON FAILURE") exit(1) diff --git a/upstream/utility/CMakeLists.txt b/upstream/utility/CMakeLists.txt index 49e01e2..8173eca 100644 --- a/upstream/utility/CMakeLists.txt +++ b/upstream/utility/CMakeLists.txt @@ -38,8 +38,6 @@ add_library(pfw_utility STATIC Utility.cpp DynamicLibrary.cpp) -target_include_directories(pfw_utility PUBLIC .) - # Needed for linking against shared libraries on Linux (no-op on Windows) set_target_properties(pfw_utility PROPERTIES POSITION_INDEPENDENT_CODE TRUE) @@ -48,7 +46,7 @@ install(FILES ErrorContext.hpp Utility.h convert.hpp - DESTINATION "include/utility") + DESTINATION "include/parameter/utility") if(BUILD_TESTING) # Add unit test diff --git a/upstream/utility/Utility.cpp b/upstream/utility/Utility.cpp index bf94422..8b476e3 100644 --- a/upstream/utility/Utility.cpp +++ b/upstream/utility/Utility.cpp @@ -39,14 +39,6 @@ using std::string; namespace utility { -// Format string list -std::string asString(const std::list<std::string> &lstr, const std::string &strSeparator) -{ - return join<std::string>(begin(lstr), end(lstr), [strSeparator](string acc, string right) { - return acc + strSeparator + right; - }); -} - // Format string map std::string asString(const std::map<std::string, std::string> &mapStr, const std::string &strItemSeparator, const std::string &strKeyValueSeparator) diff --git a/upstream/utility/Utility.h b/upstream/utility/Utility.h index c32095a..0f2aec3 100644 --- a/upstream/utility/Utility.h +++ b/upstream/utility/Utility.h @@ -35,6 +35,7 @@ #include <map> #include <sstream> #include <numeric> +#include <type_traits> namespace utility { @@ -62,15 +63,24 @@ T join(InputIt first, InputIt last, BinaryOperation op, T empty = T{}) } /** -* Format the items of a map into a string as a list of key-value pairs. The map must be -* composed of pairs of strings. +* Format the items of a sequence container of strings into a string. * +* @tparam Sequence the string sequence container (e.g. list or vector) * @param[in] lstr A list of strings * @param[in] separator The separator to use between each item * * @return the concatenated elements. */ -std::string asString(const std::list<std::string> &lstr, const std::string &separator = "\n"); +template <class Sequence> +std::string asString(const Sequence &lstr, const std::string &separator = "\n") +{ + static_assert(std::is_same<typename Sequence::value_type, std::string>::value, + "asString called on a sequence container that does not contains strings"); + + return join<std::string>( + begin(lstr), end(lstr), + [separator](std::string acc, std::string right) { return acc + separator + right; }); +} /** * Format the items of a map into a string as a list of key-value pairs. The map must be @@ -99,4 +109,4 @@ void appendTitle(std::string &strTo, const std::string &strTitle); */ bool isHexadecimal(const std::string &strValue); -} // utility +} // namespace utility diff --git a/upstream/utility/posix/DynamicLibrary.cpp b/upstream/utility/posix/DynamicLibrary.cpp index 1a3af60..10b5e17 100644 --- a/upstream/utility/posix/DynamicLibrary.cpp +++ b/upstream/utility/posix/DynamicLibrary.cpp @@ -44,7 +44,7 @@ DynamicLibrary::DynamicLibrary(const std::string &path) : _path(osSanitizePathNa if (_handle == nullptr) { const char *dlError = dlerror(); - throw std::runtime_error((dlError != NULL) ? dlError : "unknown dlopen error"); + throw std::runtime_error((dlError != nullptr) ? dlError : "unknown dlopen error"); } } @@ -60,7 +60,7 @@ void *DynamicLibrary::osGetSymbol(const std::string &symbol) const if (sym == nullptr) { const char *dlError = dlerror(); - throw std::runtime_error((dlError != NULL) ? dlError : "unknown dlsym error"); + throw std::runtime_error((dlError != nullptr) ? dlError : "unknown dlsym error"); } return sym; diff --git a/upstream/xmlserializer/CMakeLists.txt b/upstream/xmlserializer/CMakeLists.txt index 067a00e..91f51d2 100644 --- a/upstream/xmlserializer/CMakeLists.txt +++ b/upstream/xmlserializer/CMakeLists.txt @@ -60,16 +60,13 @@ if(NOT XML2_XINCLUDE_SUPPORT) "please install a version of libxml2 supporting it.") endif() -target_include_directories(xmlserializer PUBLIC .) - target_link_libraries(xmlserializer PUBLIC pfw_utility # For NonCopyable and ErrorContext PRIVATE LibXml2::libxml2) - install(FILES XmlSink.h XmlSource.h XmlElement.h XmlSerializingContext.h - DESTINATION "include/xmlserializer") + DESTINATION "include/parameter/xmlserializer") diff --git a/upstream/xmlserializer/XmlDocSource.cpp b/upstream/xmlserializer/XmlDocSource.cpp index ed366bf..c4ec5fa 100644 --- a/upstream/xmlserializer/XmlDocSource.cpp +++ b/upstream/xmlserializer/XmlDocSource.cpp @@ -61,7 +61,7 @@ CXmlDocSource::~CXmlDocSource() if (_pDoc) { // Free XML doc xmlFreeDoc(_pDoc); - _pDoc = NULL; + _pDoc = nullptr; } } @@ -110,7 +110,7 @@ _xmlDoc *CXmlDocSource::getDoc() const bool CXmlDocSource::isParsable() const { // Check that the doc has been created - return _pDoc != NULL; + return _pDoc != nullptr; } bool CXmlDocSource::populate(CXmlSerializingContext &serializingContext) @@ -167,7 +167,7 @@ bool CXmlDocSource::isInstanceDocumentValid() #ifdef LIBXML_SCHEMAS_ENABLED string schemaUri = getSchemaUri(); - xmlDocPtr pSchemaDoc = xmlReadFile(schemaUri.c_str(), NULL, XML_PARSE_NONET); + xmlDocPtr pSchemaDoc = xmlReadFile(schemaUri.c_str(), nullptr, XML_PARSE_NONET); if (!pSchemaDoc) { // Unable to load Schema @@ -233,28 +233,28 @@ std::string CXmlDocSource::mkUri(const std::string &base, const std::string &rel _xmlDoc *CXmlDocSource::mkXmlDoc(const string &source, bool fromFile, bool xincludes, CXmlSerializingContext &serializingContext) { - _xmlDoc *doc = NULL; + _xmlDoc *doc = nullptr; if (fromFile) { - doc = xmlReadFile(source.c_str(), NULL, 0); + doc = xmlReadFile(source.c_str(), nullptr, 0); } else { - doc = xmlReadMemory(source.c_str(), (int)source.size(), "", NULL, 0); + doc = xmlReadMemory(source.c_str(), (int)source.size(), "", nullptr, 0); } - if (doc == NULL) { + if (doc == nullptr) { string errorMsg = "libxml failed to read"; if (fromFile) { errorMsg += " \"" + source + "\""; } serializingContext.appendLineToError(errorMsg); - return NULL; + return nullptr; } if (xincludes and (xmlXIncludeProcess(doc) < 0)) { serializingContext.appendLineToError("libxml failed to resolve XIncludes"); xmlFreeDoc(doc); - doc = NULL; + doc = nullptr; } return doc; diff --git a/upstream/xmlserializer/XmlDocSource.h b/upstream/xmlserializer/XmlDocSource.h index 85b4114..8093a27 100644 --- a/upstream/xmlserializer/XmlDocSource.h +++ b/upstream/xmlserializer/XmlDocSource.h @@ -57,7 +57,7 @@ public: * @param[in] pRootNode a pointer to the root element of the document. * @param[in] bValidateWithSchema a boolean that toggles schema validation */ - CXmlDocSource(_xmlDoc *pDoc, bool bValidateWithSchema = false, _xmlNode *pRootNode = NULL); + CXmlDocSource(_xmlDoc *pDoc, bool bValidateWithSchema = false, _xmlNode *pRootNode = nullptr); /** * Constructor diff --git a/upstream/xmlserializer/XmlElement.cpp b/upstream/xmlserializer/XmlElement.cpp index 902d0d9..5fac6d4 100644 --- a/upstream/xmlserializer/XmlElement.cpp +++ b/upstream/xmlserializer/XmlElement.cpp @@ -38,7 +38,7 @@ CXmlElement::CXmlElement(_xmlNode *pXmlElement) : _pXmlElement(pXmlElement) { } -CXmlElement::CXmlElement() : _pXmlElement(NULL) +CXmlElement::CXmlElement() : _pXmlElement(nullptr) { } @@ -73,7 +73,7 @@ string CXmlElement::getPath() const bool CXmlElement::hasAttribute(const string &strAttributeName) const { - return xmlHasProp(_pXmlElement, (const xmlChar *)strAttributeName.c_str()) != NULL; + return xmlHasProp(_pXmlElement, (const xmlChar *)strAttributeName.c_str()) != nullptr; } template <> @@ -85,7 +85,7 @@ bool CXmlElement::getAttribute<std::string>(const string &name, string &value) c string backup = value; xmlChar *pucXmlValue = xmlGetProp((xmlNode *)_pXmlElement, (const xmlChar *)name.c_str()); - if (pucXmlValue == NULL) { + if (pucXmlValue == nullptr) { value = backup; return false; } @@ -124,7 +124,7 @@ string CXmlElement::getNameAttribute() const string CXmlElement::getTextContent() const { xmlChar *pucXmlContent = xmlNodeGetContent(_pXmlElement); - if (pucXmlContent == NULL) { + if (pucXmlContent == nullptr) { return ""; } @@ -234,7 +234,7 @@ void CXmlElement::setTextContent(const string &strContent) void CXmlElement::createChild(CXmlElement &childElement, const string &strType) { #ifdef LIBXML_TREE_ENABLED - xmlNodePtr pChildNode = xmlNewChild(_pXmlElement, NULL, BAD_CAST strType.c_str(), NULL); + xmlNodePtr pChildNode = xmlNewChild(_pXmlElement, nullptr, BAD_CAST strType.c_str(), nullptr); childElement.setXmlElement(pChildNode); #endif diff --git a/upstream/xmlserializer/XmlMemoryDocSink.h b/upstream/xmlserializer/XmlMemoryDocSink.h index b91c2aa..5562878 100644 --- a/upstream/xmlserializer/XmlMemoryDocSink.h +++ b/upstream/xmlserializer/XmlMemoryDocSink.h @@ -57,7 +57,8 @@ private: * * @return false if any error occurs */ - virtual bool doProcess(CXmlDocSource &xmlDocSource, CXmlSerializingContext &serializingContext); + bool doProcess(CXmlDocSource &xmlDocSource, + CXmlSerializingContext &serializingContext) override; // Xml Sink IXmlSink *_pXmlSink; diff --git a/upstream/xmlserializer/XmlMemoryDocSource.cpp b/upstream/xmlserializer/XmlMemoryDocSource.cpp index 41b5ef2..37e3551 100644 --- a/upstream/xmlserializer/XmlMemoryDocSource.cpp +++ b/upstream/xmlserializer/XmlMemoryDocSource.cpp @@ -39,7 +39,7 @@ CXmlMemoryDocSource::CXmlMemoryDocSource(const IXmlSource *pXmlSource, bool bVal const std::string &strProduct, const std::string &strVersion) : base(xmlNewDoc(BAD_CAST "1.0"), bValidateWithSchema, - xmlNewNode(NULL, BAD_CAST strRootElementType.c_str())), + xmlNewNode(nullptr, BAD_CAST strRootElementType.c_str())), _pXmlSource(pXmlSource), _strProduct(strProduct), _strVersion(strVersion) { init(); diff --git a/upstream/xmlserializer/XmlMemoryDocSource.h b/upstream/xmlserializer/XmlMemoryDocSource.h index c8a0d55..be92ca2 100644 --- a/upstream/xmlserializer/XmlMemoryDocSource.h +++ b/upstream/xmlserializer/XmlMemoryDocSource.h @@ -61,7 +61,7 @@ public: * * @return false if any error occurs */ - virtual bool populate(CXmlSerializingContext &serializingContext); + bool populate(CXmlSerializingContext &serializingContext) override; private: /** diff --git a/upstream/xmlserializer/XmlSerializingContext.cpp b/upstream/xmlserializer/XmlSerializingContext.cpp index 4666c54..0b08bab 100644 --- a/upstream/xmlserializer/XmlSerializingContext.cpp +++ b/upstream/xmlserializer/XmlSerializingContext.cpp @@ -40,7 +40,7 @@ CXmlSerializingContext::CXmlSerializingContext(std::string &strError) CXmlSerializingContext::~CXmlSerializingContext() { // TODO: restore the previous handler - xmlSetStructuredErrorFunc(NULL, NULL); + xmlSetStructuredErrorFunc(nullptr, nullptr); prependToError(_strXmlError); } @@ -59,7 +59,7 @@ void CXmlSerializingContext::structuredErrorHandler(void *userData, xmlErrorPtr { CXmlSerializingContext *self = static_cast<CXmlSerializingContext *>(userData); - std::string filename = (error->file != NULL) ? error->file : "(user input)"; + std::string filename = (error->file != nullptr) ? error->file : "(user input)"; // xmlErrorPtr->int2 contains the column; see xmlerror.h self->_strXmlError += filename + ":" + std::to_string(error->line) + ":" + std::to_string(error->int2) + ": " + error->message; diff --git a/upstream/xmlserializer/XmlStreamDocSink.cpp b/upstream/xmlserializer/XmlStreamDocSink.cpp index 4acd089..0cb281e 100644 --- a/upstream/xmlserializer/XmlStreamDocSink.cpp +++ b/upstream/xmlserializer/XmlStreamDocSink.cpp @@ -39,7 +39,7 @@ CXmlStreamDocSink::CXmlStreamDocSink(std::ostream &output) : _output(output) bool CXmlStreamDocSink::doProcess(CXmlDocSource &xmlDocSource, CXmlSerializingContext &serializingContext) { - xmlChar *dumpedDoc = NULL; + xmlChar *dumpedDoc = nullptr; int iSize; xmlDocDumpFormatMemoryEnc(xmlDocSource.getDoc(), &dumpedDoc, &iSize, "UTF-8", 1); diff --git a/upstream/xmlserializer/XmlStreamDocSink.h b/upstream/xmlserializer/XmlStreamDocSink.h index 368505d..32e1e81 100644 --- a/upstream/xmlserializer/XmlStreamDocSink.h +++ b/upstream/xmlserializer/XmlStreamDocSink.h @@ -55,7 +55,8 @@ private: * * @return false if any error occurs */ - virtual bool doProcess(CXmlDocSource &xmlDocSource, CXmlSerializingContext &serializingContext); + bool doProcess(CXmlDocSource &xmlDocSource, + CXmlSerializingContext &serializingContext) override; /** * Result ostream containing the XML informations |
