Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
df01d8b
Remove unused AutoLog header from SelectionCriterion class
clero Feb 26, 2015
f2dd767
Move logging up to ParameterMgr
clero Mar 2, 2015
249f328
Introduce Results type to avoid copy paste
clero Mar 10, 2015
c58e516
Remove plugin load attempt log
clero Mar 3, 2015
2f66b4f
Remove unused XmlFileIncluderElement header from ParameterMgr
clero Mar 3, 2015
00a4af2
Remove log from XmlFileIncluderElement
clero Mar 3, 2015
f9ff872
Delegate addValuePair error logging to client
clero Mar 3, 2015
36b3b1d
Temporarily remove Subsystems logging ability
clero Feb 26, 2015
5f56c58
Change Criterion modifications counter type
clero Apr 13, 2015
1554cfe
Rework project log
clero Feb 25, 2015
8eb4c34
Remove unused remote-processor include location from test-subsystem
clero Apr 7, 2015
ca361e3
Enable subsystems logging
clero Mar 4, 2015
e85bd06
Update Skeleton Subsystem for log ability.
clero Mar 5, 2015
390f97c
Update domainGenerator python script to use the new log API
clero Apr 2, 2015
3cfeff4
Merge pull request #87 from clero/log_contextualisable_subsystems int…
dawagner Apr 14, 2015
8b3253d
README: change url to CI badges for the 'next' branch
dawagner Apr 14, 2015
5ab361d
Merge remote-tracking branch 'master' into next
dawagner Apr 14, 2015
3270f6a
Remove -Wno-unused-but-set-variable flag for python binding compilation
clero Mar 23, 2015
66b5c5e
Fix hidden overloaded virtual function in BitParameter.h
clero Mar 23, 2015
055a166
Update Android.mk files to use Clang
clero Mar 30, 2015
97ed495
Add clang compilation to travis configuration
clero Mar 31, 2015
2cfe044
Enable C++11
clero Feb 23, 2015
c83030c
Delegate ParameterMgr Command Parsing behavior
clero Feb 19, 2015
b5ce6ec
Remove deprecated getDomainsXml command support
clero Feb 20, 2015
efc558c
Remove RemoteCommandParser callback definition of CommandParser
clero Feb 23, 2015
6bf1433
Refactor remote commands handling
clero Feb 23, 2015
f4723cd
Use a reference instead of a pointer for command parsers.
clero Mar 9, 2015
2933993
Fix coding style of RemoteCommandHandlerTemplate class.
clero Mar 9, 2015
9fac0a4
Remove unused header from TestPlatorm
clero Mar 30, 2015
45dc84c
Delegate Test-platform command Parser behavior
clero Mar 27, 2015
89059c0
Avoid code duplication when parsing criterion creation command
clero Mar 30, 2015
31b49c0
Refactor command callback definition in RemoteCommandHandler
clero Mar 27, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
language: cpp
compiler:
- gcc
# - clang # not supported yet
- clang

# Install a recent gcc, gcov and cmake,
# it will not be necessary once travis worker is based on ubuntu > 12.04.
# Install SWIG for bindings generation
# Download recent SWIG for bindings generation
before_install:
- wget http://mirrors.kernel.org/ubuntu/pool/main/s/swig2.0/swig2.0_2.0.12-1ubuntu1_amd64.deb
- sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository --yes ppa:kalakris/cmake # Non official cmake backport
- sudo apt-get update -qq
- sudo pip install cpp-coveralls

install:
- sudo apt-get install --yes swig cmake valgrind g++-4.8
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.8 100
- sudo apt-get install --yes cmake valgrind
- if [ "$CXX" = "g++" ] ; then
sudo apt-get install --yes g++-4.8 &&
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100 &&
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.8 100 ;
fi
- sudo wget --directory-prefix /usr/include/
https://raw.github.com/philsquared/Catch/master/single_include/catch.hpp
- sudo dpkg -i swig2.0_2.0.12-1ubuntu1_amd64.deb

# how to build
script:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ endif(COMMAND cmake_policy)

project(parameter-framework)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -std=c++11")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# parameter-framework

[![Build Status](https://travis-ci.org/01org/parameter-framework.svg?branch=master)](https://travis-ci.org/01org/parameter-framework)
[![Coverage Status](https://coveralls.io/repos/01org/parameter-framework/badge.svg?branch=master)](https://coveralls.io/r/01org/parameter-framework)
[![Build Status](https://travis-ci.org/01org/parameter-framework.svg?branch=next)](https://travis-ci.org/01org/parameter-framework)
[![Coverage Status](https://coveralls.io/repos/01org/parameter-framework/badge.svg?branch=next)](https://coveralls.io/r/01org/parameter-framework)

## Introduction

Expand Down
22 changes: 16 additions & 6 deletions bindings/c/ParameterFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,24 @@ class LogWrapper : public CParameterMgrPlatformConnector::ILogger
LogWrapper() : mLogger() {}
virtual ~LogWrapper() {}
private:
virtual void log(bool bIsWarning, const string &strLog)
virtual void info(const string &msg)
{
log(pfwLogInfo, msg);
}

virtual void warning(const string &msg)
{
log(pfwLogWarning, msg);
}

void log(PfwLogLevel level, const string &strLog)
{
// A LogWrapper should NOT be register to the pfw (thus log called)
// if logCb is NULL.
assert(mLogger.logCb != NULL);
mLogger.logCb(mLogger.userCtx,
bIsWarning ? pfwLogWarning : pfwLogInfo,
strLog.c_str());
mLogger.logCb(mLogger.userCtx, level, strLog.c_str());
}

PfwLogger mLogger;
};

Expand Down Expand Up @@ -196,9 +205,10 @@ bool PfwHandler::createCriteria(const PfwCriterion criteriaArray[], size_t crite
value = valueIndex;
}
const char * valueName = criterion.values[valueIndex];
if(not type->addValuePair(value, valueName)) {
string error;
if(not type->addValuePair(value, valueName, error)) {
return status.failure("Could not add value " + string(valueName) +
" to criterion " + criterion.name);
" to criterion " + criterion.name + ": " + error);
}
}
// Create criterion and add it to the pfw
Expand Down
11 changes: 11 additions & 0 deletions bindings/c/Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,17 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") {
REQUIRE(value == 3);
}
}
WHEN("Set a new value to a criterion without committing first") {
const char *criterionName = criteria[0].name;
REQUIRE_SUCCESS(pfwSetCriterion(pfw, criterionName, 0));
THEN("A warning message should have been displayed") {
INFO("Previous pfw log: \n" + logLines);
size_t logPos = logLines.find("Warning: Selection criterion "
"'inclusiveCrit' has been modified 1 time(s)"
" without any configuration application");
CHECK(logPos != std::string::npos);
}
}
}
WHEN("Commit criteria without a pfw") {
REQUIRE(not pfwApplyConfigurations(NULL));
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ LOCAL_C_INCLUDES := \
prebuilts/python/linux-x86/2.7.5/include/python2.7 \
$(HOST_OUT_HEADERS)/parameter

# The 'unused-but-set-variable' warning must be disabled because SWIG generates
# files that do not respect that constraint.
# '-DSWIG_PYTHON_SILENT_MEMLEAK' is needed because the "memleak" warning
# pollutes the standard output. At the time of writing, the only warning is
# spurious anyway, as it relates to "ILogger *" which is an abstract
# class/interface class and as such cannot be destroyed.
LOCAL_CFLAGS := -Wno-unused-but-set-variable -fexceptions -DSWIG_PYTHON_SILENT_MEMLEAK
LOCAL_CFLAGS := -fexceptions -DSWIG_PYTHON_SILENT_MEMLEAK

# Undefined symbols will be resolved at runtime
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
Expand Down Expand Up @@ -82,5 +80,7 @@ $(generated-sources-dir)/pfw_wrap.cxx: $(LOCAL_PATH)/pfw.i
-Iprebuilts/misc/common/swig/include/2.0.11/ \
-Wall -Werror -v -python -c++ -outdir $(HOST_LIBRARY_PATH)/ -o $@ $^

LOCAL_CLANG := true
include external/libcxx/libcxx.mk
include $(BUILD_HOST_SHARED_LIBRARY)

4 changes: 1 addition & 3 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ swig_link_libraries(PyPfw parameter ${PYTHON_LIBRARIES})
# ${CMAKE_CURRENT_BINARY_DIR}.
set_property(TARGET _PyPfw PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

# The 'unused-but-set-variable' warning must be disabled because SWIG generates
# files that do not respect that contraint.
# '-DSWIG_PYTHON_SILENT_MEMLEAK' is needed because the "memleak" warning
# pollutes the standard output. At the time of writing, the only warning is
# spurious anyway, as it relates to "ILogger *" which is an abstract
# class/interface class and as such cannot be destroyed.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable -DSWIG_PYTHON_SILENT_MEMLEAK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSWIG_PYTHON_SILENT_MEMLEAK")


# Find the python modules install path.
Expand Down
5 changes: 3 additions & 2 deletions bindings/python/pfw.i
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ public:
class ILogger
{
public:
virtual void log(bool bIsWarning, const std::string& strLog) = 0;
virtual void info(const std::string& log) = 0;
virtual void warning(const std::string& log) = 0;
protected:
virtual ~ILogger() {}
};
Expand All @@ -197,7 +198,7 @@ class ISelectionCriterionTypeInterface
%}

public:
virtual bool addValuePair(int iValue, const std::string& strValue) = 0;
virtual bool addValuePair(int iValue, const std::string& strValue, std::string& strError) = 0;
virtual bool getNumericalValue(const std::string& strValue, int& iValue) const = 0;
virtual bool getLiteralValue(int iValue, std::string& strValue) const = 0;
virtual bool isTypeInclusive() const = 0;
Expand Down
16 changes: 10 additions & 6 deletions parameter/Android.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2011-2014, Intel Corporation
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -44,7 +44,6 @@ common_copy_headers := \
common_src_files := \
AreaConfiguration.cpp \
ArrayParameter.cpp \
AutoLog.cpp \
BaseParameter.cpp \
BinarySerializableElement.cpp \
BinaryStream.cpp \
Expand Down Expand Up @@ -129,6 +128,7 @@ common_cflags := \

common_c_includes := \
$(LOCAL_PATH)/include/ \
$(LOCAL_PATH)/log/include/ \
$(LOCAL_PATH)/../utility/ \
$(LOCAL_PATH)/../xmlserializer/ \
$(LOCAL_PATH)/../remote-processor/
Expand Down Expand Up @@ -158,8 +158,8 @@ LOCAL_STATIC_LIBRARIES := libxmlserializer libpfw_utility libxml2

LOCAL_REQUIRED_MODULES := libremote-processor

LOCAL_CLANG := false
include external/stlport/libstlport.mk
LOCAL_CLANG := true
include external/libcxx/libcxx.mk
include $(BUILD_SHARED_LIBRARY)

##############################
Expand All @@ -186,7 +186,8 @@ LOCAL_STATIC_LIBRARIES := libxmlserializer_host libpfw_utility_host libxml2

LOCAL_LDLIBS += -ldl

LOCAL_CLANG := false
LOCAL_CLANG := true
include external/libcxx/libcxx.mk
include $(BUILD_HOST_SHARED_LIBRARY)

################################
Expand All @@ -197,7 +198,10 @@ include $(CLEAR_VARS)
LOCAL_MODULE := $(common_module)_includes
LOCAL_MODULE_OWNER := intel

LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/log/include


LOCAL_STATIC_LIBRARIES := \
libxmlserializer \
Expand Down
8 changes: 5 additions & 3 deletions parameter/AreaConfiguration.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2014, Intel Corporation
* Copyright (c) 2011-2015, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -54,14 +54,16 @@ void CAreaConfiguration::save(const CParameterBlackboard* pMainBlackboard)
}

// Apply data to current
bool CAreaConfiguration::restore(CParameterBlackboard* pMainBlackboard, bool bSync, std::list<std::string>* plstrError) const
bool CAreaConfiguration::restore(CParameterBlackboard* pMainBlackboard,
bool bSync,
core::Results* errors) const
{
assert(_bValid);

copyTo(pMainBlackboard, _pConfigurableElement->getOffset());

// Synchronize if required
return !bSync || _pSyncerSet->sync(*pMainBlackboard, false, plstrError);
return !bSync || _pSyncerSet->sync(*pMainBlackboard, false, errors);
}

// Ensure validity
Expand Down
13 changes: 10 additions & 3 deletions parameter/AreaConfiguration.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2014, Intel Corporation
* Copyright (c) 2011-2015, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -32,6 +32,7 @@
#include "ParameterBlackboard.h"
#include "BinaryStream.h"
#include "SyncerSet.h"
#include "Results.h"

class CConfigurableElement;
class CXmlElement;
Expand All @@ -48,8 +49,14 @@ class CAreaConfiguration
// Save data from current
void save(const CParameterBlackboard* pMainBlackboard);

// Apply data to current
bool restore(CParameterBlackboard* pMainBlackboard, bool bSync, std::list<std::string>* plstrError) const;
/** Restore the configuration area
*
* @param[in] pMainBlackboard the application main blackboard
* @param[in] bSync indicates if a synchronisation has to be done
* @param[out] errors, errors encountered during restoration
* @return true if success false otherwise
*/
bool restore(CParameterBlackboard* pMainBlackboard, bool bSync, core::Results* errors) const;

// Ensure validity
void validate(const CParameterBlackboard* pMainBlackboard);
Expand Down
4 changes: 2 additions & 2 deletions parameter/BitParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool CBitParameter::accessAsBoolean(bool& bValue, bool bSet, CParameterAccessCon
}

// Rely on integer access
uint64_t uiValue;
uint32_t uiValue;

if (bSet) {

Expand All @@ -108,7 +108,7 @@ bool CBitParameter::accessAsBoolean(bool& bValue, bool bSet, CParameterAccessCon
}

// Integer Access
bool CBitParameter::accessAsInteger(uint64_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const
bool CBitParameter::accessAsInteger(uint32_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const
{
uint32_t uiOffset = getOffset();

Expand Down
2 changes: 1 addition & 1 deletion parameter/BitParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CBitParameter : public CBaseParameter
virtual bool accessAsBoolean(bool& bValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;

// Integer Access
virtual bool accessAsInteger(uint64_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;
virtual bool accessAsInteger(uint32_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;

// AreaConfiguration creation
virtual CAreaConfiguration* createAreaConfiguration(const CSyncerSet* pSyncerSet) const;
Expand Down
2 changes: 1 addition & 1 deletion parameter/BitParameterType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool CBitParameterType::toBlackboard(uint64_t uiUserValue, uint64_t& uiValue, CP
return true;
}

void CBitParameterType::fromBlackboard(uint64_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const
void CBitParameterType::fromBlackboard(uint32_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const
{
(void)parameterAccessContext;

Expand Down
2 changes: 1 addition & 1 deletion parameter/BitParameterType.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CBitParameterType : public CTypeElement
void fromBlackboard(std::string& strValue, const uint64_t& uiValue, CParameterAccessContext& parameterAccessContext) const;
// Integer
bool toBlackboard(uint64_t uiUserValue, uint64_t& uiValue, CParameterAccessContext& parameterAccessContext) const;
void fromBlackboard(uint64_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const;
void fromBlackboard(uint32_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const;
// Access from area configuration
uint64_t merge(uint64_t uiOriginData, uint64_t uiNewData) const;

Expand Down
16 changes: 10 additions & 6 deletions parameter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2014, Intel Corporation
# Copyright (c) 2014-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -29,7 +29,6 @@
add_library(parameter SHARED
AreaConfiguration.cpp
ArrayParameter.cpp
AutoLog.cpp
BaseParameter.cpp
BinarySerializableElement.cpp
BinaryStream.cpp
Expand Down Expand Up @@ -101,13 +100,17 @@ add_library(parameter SHARED
VirtualSyncer.cpp
XmlElementSerializingContext.cpp
XmlFileIncluderElement.cpp
XmlParameterSerializingContext.cpp)
XmlParameterSerializingContext.cpp
command/src/Parser.cpp)

include_directories(
include
command/include
"${PROJECT_SOURCE_DIR}/parameter"
"${PROJECT_SOURCE_DIR}/xmlserializer"
"${PROJECT_SOURCE_DIR}/utility"
"${PROJECT_SOURCE_DIR}/remote-processor")
"${PROJECT_SOURCE_DIR}/remote-processor"
"${PROJECT_SOURCE_DIR}/parameter/log/include")

# No need to link with libremote-processor: it is accessed via dlopen()
find_library(dl dl)
Expand All @@ -125,7 +128,6 @@ install(FILES
DESTINATION "include/parameter/client")
# Core (plugin) headers
install(FILES
AutoLog.h
BitParameterBlockType.h
ConfigurableElement.h
ConfigurableElementWithMapping.h
Expand All @@ -138,7 +140,7 @@ install(FILES
InstanceConfigurableElement.h
Mapper.h
MappingContext.h
NamedElementBuilderTemplate.h
LoggingElementBuilderTemplate.h
ParameterBlockType.h
ParameterType.h
PathNavigator.h
Expand All @@ -151,3 +153,5 @@ install(FILES
TypeElement.h
VirtualSubsystem.h
DESTINATION "include/parameter/plugin")
install(DIRECTORY log/include/log/
DESTINATION "include/parameter/plugin/log")
Loading