From 75461a26a74a4d9cb60020ccfcb2a5a4ec0961bd Mon Sep 17 00:00:00 2001 From: Jules Clero Date: Fri, 4 Jul 2014 15:51:07 +0200 Subject: Fix test-platform set criterion by Lexical State Bug BZ: 213233 The setCriterionState command of the Test Platform was setting undesired value when asking for multiple states to an InclusiveCriterion. The method used in setCriterionStateByLexicalSpace was to parse arguments before to get numerical value for each of them with the getNumericalValue method from ISelectionCriterionTypeInterface. Then, different masks were aggregated to set the criterion's state. Regarding the getNumericalValue method behaviour which parses automatically value arguments, this method leads to undesired bytes in the mask which leads to undesired criterion's state. The solution is to aggregate the setCriterionState arguments when more than one arg are used. As getNumericalValue use | to split his first parameter, the code has been modified to use this behaviour. getNumericalValue is now called only one time and the returned mask is directly used to set criterion's state. Change-Id: Ie3a1d79a6f66928a2418f11233ff0d1ef5c3e900 Signed-off-by: Jules Clero --- test/test-platform/TestPlatform.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index b2b895c..e4b7ee1 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -462,30 +462,35 @@ bool CTestPlatform::setCriterionStateByLexicalSpace(const IRemoteCommand& remote } /// Translate lexical state to numerical state - uint32_t uiNumericalState = 0; + int iNumericalState = 0; uint32_t uiLexicalSubStateIndex; // Parse lexical substates + std::string strLexicalState = ""; for (uiLexicalSubStateIndex = 1; uiLexicalSubStateIndex <= uiNbSubStates; uiLexicalSubStateIndex++) { + /* + * getNumericalValue method from ISelectionCriterionTypeInterface strip his parameter + * first parameter based on | sign. In case that the user uses multiple parameters + * to set InclusiveCriterion value, we aggregate all desired values to be sure + * they will be handled correctly. + */ + if (uiLexicalSubStateIndex != 1) { + strLexicalState += "|"; + } + strLexicalState += remoteCommand.getArgument(uiLexicalSubStateIndex); + } - int iNumericalSubState; - - const std::string& strLexicalSubState = remoteCommand.getArgument(uiLexicalSubStateIndex); - - // Translate lexical to numerical substate - if (!pCriterionType->getNumericalValue(strLexicalSubState, iNumericalSubState)) { - - strResult = "Unable to find lexical state \"" + strLexicalSubState + "\" in criteria " + strCriterionName; + // Translate lexical to numerical substate + if (!pCriterionType->getNumericalValue(strLexicalState, iNumericalState)) { - return false; - } + strResult = "Unable to find lexical state \"" + + strLexicalState + "\" in criteria " + strCriterionName; - // Aggregate numerical substates - uiNumericalState |= iNumericalSubState; + return false; } // Set criterion new state - pCriterion->setCriterionState(uiNumericalState); + pCriterion->setCriterionState(iNumericalState); return true; } -- cgit v1.1 From 2416d7a8b51e9d713d7741eaaaeb357b532ae9a8 Mon Sep 17 00:00:00 2001 From: Jules Clero Date: Tue, 8 Jul 2014 09:03:49 +0200 Subject: Fixing TestPlatform.cpp file coding style BZ: 213233 TestPlatform.cpp has been edited regarding uncrustify suggestions. Change-Id: Iac75c5923d5bf9836730ca6f21789967a98895e9 Signed-off-by: Jules Clero --- test/test-platform/TestPlatform.cpp | 205 ++++++++++++++++++++---------------- 1 file changed, 114 insertions(+), 91 deletions(-) diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index e4b7ee1..a6613e9 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -47,7 +47,8 @@ class CParameterMgrPlatformConnectorLogger : public CParameterMgrPlatformConnect public: CParameterMgrPlatformConnectorLogger() {} - virtual void log(bool bIsWarning, const string& strLog) { + virtual void log(bool bIsWarning, const string& strLog) + { if (bIsWarning) { @@ -71,24 +72,24 @@ CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber, sem_t& exi _pCommandHandler->addCommandParser("exit", &CTestPlatform::exit, 0, "", "Exit TestPlatform"); _pCommandHandler->addCommandParser( - "createExclusiveSelectionCriterionFromStateList", - &CTestPlatform::createExclusiveSelectionCriterionFromStateList, - 2, " ", - "Create inclusive selection criterion from state name list"); + "createExclusiveSelectionCriterionFromStateList", + &CTestPlatform::createExclusiveSelectionCriterionFromStateList, + 2, " ", + "Create inclusive selection criterion from state name list"); _pCommandHandler->addCommandParser( - "createInclusiveSelectionCriterionFromStateList", - &CTestPlatform::createInclusiveSelectionCriterionFromStateList, - 2, " ", - "Create exclusive selection criterion from state name list"); + "createInclusiveSelectionCriterionFromStateList", + &CTestPlatform::createInclusiveSelectionCriterionFromStateList, + 2, " ", + "Create exclusive selection criterion from state name list"); _pCommandHandler->addCommandParser( - "createExclusiveSelectionCriterion", - &CTestPlatform::createExclusiveSelectionCriterion, - 2, " ", "Create inclusive selection criterion"); + "createExclusiveSelectionCriterion", + &CTestPlatform::createExclusiveSelectionCriterion, + 2, " ", "Create inclusive selection criterion"); _pCommandHandler->addCommandParser( - "createInclusiveSelectionCriterion", - &CTestPlatform::createInclusiveSelectionCriterion, - 2, " ", "Create exclusive selection criterion"); + "createInclusiveSelectionCriterion", + &CTestPlatform::createInclusiveSelectionCriterion, + 2, " ", "Create exclusive selection criterion"); _pCommandHandler->addCommandParser("start", &CTestPlatform::startParameterMgr, 0, "", "Start ParameterMgr"); @@ -97,42 +98,42 @@ CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber, sem_t& exi 2, " ", "Set the current state of a selection criterion"); _pCommandHandler->addCommandParser( - "applyConfigurations", - &CTestPlatform::applyConfigurations, - 0, "", "Apply configurations selected by current selection criteria states"); + "applyConfigurations", + &CTestPlatform::applyConfigurations, + 0, "", "Apply configurations selected by current selection criteria states"); _pCommandHandler->addCommandParser( - "setFailureOnMissingSubsystem", - &CTestPlatform::setter<&CParameterMgrPlatformConnector::setFailureOnMissingSubsystem>, - 1, "true|false", "Set policy for missing subsystems, " - "either abort start or fallback on virtual subsystem."); + "setFailureOnMissingSubsystem", + &CTestPlatform::setter<& CParameterMgrPlatformConnector::setFailureOnMissingSubsystem>, + 1, "true|false", "Set policy for missing subsystems, " + "either abort start or fallback on virtual subsystem."); _pCommandHandler->addCommandParser( - "getMissingSubsystemPolicy", - &CTestPlatform::getter<&CParameterMgrPlatformConnector::getFailureOnMissingSubsystem>, - 0, "", "Get policy for missing subsystems, " - "either abort start or fallback on virtual subsystem."); + "getMissingSubsystemPolicy", + &CTestPlatform::getter<& CParameterMgrPlatformConnector::getFailureOnMissingSubsystem>, + 0, "", "Get policy for missing subsystems, " + "either abort start or fallback on virtual subsystem."); _pCommandHandler->addCommandParser( - "setFailureOnFailedSettingsLoad", - &CTestPlatform::setter<&CParameterMgrPlatformConnector::setFailureOnFailedSettingsLoad>, - 1, "true|false", - "Set policy for failed settings load, either abort start or continue without domains."); + "setFailureOnFailedSettingsLoad", + &CTestPlatform::setter<& CParameterMgrPlatformConnector::setFailureOnFailedSettingsLoad>, + 1, "true|false", + "Set policy for failed settings load, either abort start or continue without domains."); _pCommandHandler->addCommandParser( - "getFailedSettingsLoadPolicy", - &CTestPlatform::getter<&CParameterMgrPlatformConnector::getFailureOnFailedSettingsLoad>, - 0, "", - "Get policy for failed settings load, either abort start or continue without domains."); + "getFailedSettingsLoadPolicy", + &CTestPlatform::getter<& CParameterMgrPlatformConnector::getFailureOnFailedSettingsLoad>, + 0, "", + "Get policy for failed settings load, either abort start or continue without domains."); _pCommandHandler->addCommandParser( - "setValidateSchemasOnStart", - &CTestPlatform::setter<&CParameterMgrPlatformConnector::setValidateSchemasOnStart>, - 1, "true|false", - "Set policy for schema validation based on .xsd files (false by default)."); + "setValidateSchemasOnStart", + &CTestPlatform::setter<& CParameterMgrPlatformConnector::setValidateSchemasOnStart>, + 1, "true|false", + "Set policy for schema validation based on .xsd files (false by default)."); _pCommandHandler->addCommandParser( - "getValidateSchemasOnStart", - &CTestPlatform::getter<&CParameterMgrPlatformConnector::getValidateSchemasOnStart>, - 0, "", - "Get policy for schema validation based on .xsd files."); + "getValidateSchemasOnStart", + &CTestPlatform::getter<& CParameterMgrPlatformConnector::getValidateSchemasOnStart>, + 0, "", + "Get policy for schema validation based on .xsd files."); // Create server _pRemoteProcessorServer = new CRemoteProcessorServer(iPortNumber, _pCommandHandler); @@ -149,7 +150,7 @@ CTestPlatform::~CTestPlatform() } CTestPlatform::CommandReturn CTestPlatform::exit( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { (void)remoteCommand; @@ -180,53 +181,53 @@ bool CTestPlatform::load(std::string& strError) //////////////// Remote command parsers /// Selection Criterion CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterionFromStateList( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { return createExclusiveSelectionCriterionFromStateList( - remoteCommand.getArgument(0), remoteCommand, strResult) ? - CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + remoteCommand.getArgument(0), remoteCommand, strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterionFromStateList( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { return createInclusiveSelectionCriterionFromStateList( - remoteCommand.getArgument(0), remoteCommand, strResult) ? - CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + remoteCommand.getArgument(0), remoteCommand, strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterion( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { return createExclusiveSelectionCriterion( - remoteCommand.getArgument(0), - strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), - strResult) ? - CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + remoteCommand.getArgument(0), + strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), + strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterion( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { return createInclusiveSelectionCriterion( - remoteCommand.getArgument(0), - strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), - strResult) ? - CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + remoteCommand.getArgument(0), + strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), + strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CommandReturn CTestPlatform::startParameterMgr( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { (void)remoteCommand; return _pParameterMgrPlatformConnector->start(strResult) ? - CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } -template +template CTestPlatform::CommandReturn CTestPlatform::setter( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { const string& strAbort = remoteCommand.getArgument(0); @@ -237,49 +238,51 @@ CTestPlatform::CommandReturn CTestPlatform::setter( } return (_pParameterMgrPlatformConnector->*setFunction)(bFail, strResult) ? - CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } -template +template CTestPlatform::CommandReturn CTestPlatform::getter( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { (void)remoteCommand; strResult = (_pParameterMgrPlatformConnector->*getFunction)() ? "true" : "false"; - return CTestPlatform::CCommandHandler::ESucceeded; + return CTestPlatform::CCommandHandler::ESucceeded; } CTestPlatform::CommandReturn CTestPlatform::setCriterionState( - const IRemoteCommand& remoteCommand, string& strResult) + const IRemoteCommand& remoteCommand, string& strResult) { bool bSuccess; - const char * pcState = remoteCommand.getArgument(1).c_str(); + const char* pcState = remoteCommand.getArgument(1).c_str(); - char *pcStrEnd; + char* pcStrEnd; // Reset errno to check if it is updated during the conversion (strtol/strtoul) errno = 0; - uint32_t state = strtoul(pcState , &pcStrEnd, 0); + uint32_t state = strtoul(pcState, &pcStrEnd, 0); if (!errno && (*pcStrEnd == '\0')) { // Sucessfull conversion, set criterion state by numerical state - bSuccess = setCriterionState(remoteCommand.getArgument(0), state , strResult ) ; + bSuccess = setCriterionState(remoteCommand.getArgument(0), state, strResult); } else { // Conversion failed, set criterion state by lexical state - bSuccess = setCriterionStateByLexicalSpace(remoteCommand , strResult ); + bSuccess = setCriterionStateByLexicalSpace(remoteCommand, strResult); } - return bSuccess ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + return bSuccess ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler:: + EFailed; } -CTestPlatform::CommandReturn CTestPlatform::applyConfigurations(const IRemoteCommand& remoteCommand, string& strResult) +CTestPlatform::CommandReturn CTestPlatform::applyConfigurations(const IRemoteCommand& remoteCommand, + string& strResult) { (void)remoteCommand; (void)strResult; @@ -291,16 +294,20 @@ CTestPlatform::CommandReturn CTestPlatform::applyConfigurations(const IRemoteCom //////////////// Remote command handlers -bool CTestPlatform::createExclusiveSelectionCriterionFromStateList(const string& strName, const IRemoteCommand& remoteCommand, string& strResult) +bool CTestPlatform::createExclusiveSelectionCriterionFromStateList( + const string& strName, + const IRemoteCommand& remoteCommand, + string& strResult) { - assert (_pParameterMgrPlatformConnector != NULL); + assert(_pParameterMgrPlatformConnector != NULL); - ISelectionCriterionTypeInterface* pCriterionType = _pParameterMgrPlatformConnector->createSelectionCriterionType(false); + ISelectionCriterionTypeInterface* pCriterionType = + _pParameterMgrPlatformConnector->createSelectionCriterionType(false); assert(pCriterionType != NULL); - uint32_t uiNbStates = remoteCommand.getArgumentCount() - 1 ; + uint32_t uiNbStates = remoteCommand.getArgumentCount() - 1; uint32_t uiState; for (uiState = 0; uiState < uiNbStates; uiState++) { @@ -320,15 +327,19 @@ bool CTestPlatform::createExclusiveSelectionCriterionFromStateList(const string& return true; } -bool CTestPlatform::createInclusiveSelectionCriterionFromStateList(const string& strName, const IRemoteCommand& remoteCommand, string& strResult) +bool CTestPlatform::createInclusiveSelectionCriterionFromStateList( + const string& strName, + const IRemoteCommand& remoteCommand, + string& strResult) { - assert (_pParameterMgrPlatformConnector != NULL); + assert(_pParameterMgrPlatformConnector != NULL); - ISelectionCriterionTypeInterface* pCriterionType = _pParameterMgrPlatformConnector->createSelectionCriterionType(true); + ISelectionCriterionTypeInterface* pCriterionType = + _pParameterMgrPlatformConnector->createSelectionCriterionType(true); assert(pCriterionType != NULL); - uint32_t uiNbStates = remoteCommand.getArgumentCount() - 1 ; + uint32_t uiNbStates = remoteCommand.getArgumentCount() - 1; if (uiNbStates > 32) { @@ -357,9 +368,12 @@ bool CTestPlatform::createInclusiveSelectionCriterionFromStateList(const string& } -bool CTestPlatform::createExclusiveSelectionCriterion(const string& strName, uint32_t uiNbStates, string& strResult) +bool CTestPlatform::createExclusiveSelectionCriterion(const string& strName, + uint32_t uiNbStates, + string& strResult) { - ISelectionCriterionTypeInterface* pCriterionType = _pParameterMgrPlatformConnector->createSelectionCriterionType(false); + ISelectionCriterionTypeInterface* pCriterionType = + _pParameterMgrPlatformConnector->createSelectionCriterionType(false); uint32_t uistate; @@ -383,9 +397,12 @@ bool CTestPlatform::createExclusiveSelectionCriterion(const string& strName, uin return true; } -bool CTestPlatform::createInclusiveSelectionCriterion(const string& strName, uint32_t uiNbStates, string& strResult) +bool CTestPlatform::createInclusiveSelectionCriterion(const string& strName, + uint32_t uiNbStates, + string& strResult) { - ISelectionCriterionTypeInterface* pCriterionType = _pParameterMgrPlatformConnector->createSelectionCriterionType(true); + ISelectionCriterionTypeInterface* pCriterionType = + _pParameterMgrPlatformConnector->createSelectionCriterionType(true); if (uiNbStates > 32) { @@ -418,7 +435,8 @@ bool CTestPlatform::createInclusiveSelectionCriterion(const string& strName, uin bool CTestPlatform::setCriterionState(const string& strName, uint32_t uiState, string& strResult) { - ISelectionCriterionInterface* pCriterion = _pParameterMgrPlatformConnector->getSelectionCriterion(strName); + ISelectionCriterionInterface* pCriterion = + _pParameterMgrPlatformConnector->getSelectionCriterion(strName); if (!pCriterion) { @@ -432,13 +450,15 @@ bool CTestPlatform::setCriterionState(const string& strName, uint32_t uiState, s return true; } -bool CTestPlatform::setCriterionStateByLexicalSpace(const IRemoteCommand& remoteCommand, string& strResult) +bool CTestPlatform::setCriterionStateByLexicalSpace(const IRemoteCommand& remoteCommand, + string& strResult) { // Get criterion name std::string strCriterionName = remoteCommand.getArgument(0); - ISelectionCriterionInterface* pCriterion = _pParameterMgrPlatformConnector->getSelectionCriterion(strCriterionName); + ISelectionCriterionInterface* pCriterion = + _pParameterMgrPlatformConnector->getSelectionCriterion(strCriterionName); if (!pCriterion) { @@ -467,7 +487,10 @@ bool CTestPlatform::setCriterionStateByLexicalSpace(const IRemoteCommand& remote // Parse lexical substates std::string strLexicalState = ""; - for (uiLexicalSubStateIndex = 1; uiLexicalSubStateIndex <= uiNbSubStates; uiLexicalSubStateIndex++) { + + for (uiLexicalSubStateIndex = 1; + uiLexicalSubStateIndex <= uiNbSubStates; + uiLexicalSubStateIndex++) { /* * getNumericalValue method from ISelectionCriterionTypeInterface strip his parameter * first parameter based on | sign. In case that the user uses multiple parameters -- cgit v1.1 From 3adb785eb097028750fc1b4c5ecab3bebf1a9ae3 Mon Sep 17 00:00:00 2001 From: Guillaume Denneulin Date: Tue, 8 Jul 2014 09:11:22 +0200 Subject: Move element tree initialisation to load function BZ: 207091 The parameter platform manager used to initialize the element tree. However, this is too early for plugins, since they need information from the core which have not been initialized yet. This patch delays the initialization of the element tree by adding it to the load() function of the ParameterMgr. Change-Id: I98e0e3a20ac0af2736eddc4c8349911eb1d1a691 Signed-off-by: Guillaume Denneulin Signed-off-by: Mattijs Korpershoek Reviewed-on: https://android.intel.com/215426 Reviewed-by: De Chivre, Renaud Reviewed-by: Benavoli, Patrick Reviewed-by: Rocard, KevinX Tested-by: Rocard, KevinX --- parameter/ParameterMgr.cpp | 6 ++++++ parameter/ParameterMgrPlatformConnector.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 4b8bdf6..d112461 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -454,6 +454,12 @@ bool CParameterMgr::load(string& strError) return false; } + // Init flow of element tree + if (!init(strError)) { + + return false; + } + // Back synchronization for areas in parameter blackboard not covered by any domain CBackSynchronizer* pBackSynchronizer = createBackSynchronizer(); diff --git a/parameter/ParameterMgrPlatformConnector.cpp b/parameter/ParameterMgrPlatformConnector.cpp index f29c8a8..d49003d 100644 --- a/parameter/ParameterMgrPlatformConnector.cpp +++ b/parameter/ParameterMgrPlatformConnector.cpp @@ -175,12 +175,6 @@ bool CParameterMgrPlatformConnector::start(string& strError) return false; } - // Init flow - if (!_pParameterMgr->init(strError)) { - - return false; - } - _bStarted = true; return true; -- cgit v1.1 From d2d73c11c90ddde1730506566c20bd3d315305ef Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 3 Jul 2014 21:40:17 +0200 Subject: Adding a missing const in a get type method BZ: 208504 CParameterAccessContext::outRawFormatIsHex() was missing the const modifier. Change-Id: I3120a231d2dff8f4274b95cd2d3c8ff0817bf8ac Signed-off-by: Patrick Benavoli --- parameter/ParameterAccessContext.cpp | 2 +- parameter/ParameterAccessContext.h | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/parameter/ParameterAccessContext.cpp b/parameter/ParameterAccessContext.cpp index bbbbd22..e228d9b 100644 --- a/parameter/ParameterAccessContext.cpp +++ b/parameter/ParameterAccessContext.cpp @@ -98,7 +98,7 @@ void CParameterAccessContext::setOutputRawFormat(bool bIsHex) _bOutputRawFormatIsHex = bIsHex; } -bool CParameterAccessContext::outputRawFormatIsHex() +bool CParameterAccessContext::outputRawFormatIsHex() const { return _bOutputRawFormatIsHex; } diff --git a/parameter/ParameterAccessContext.h b/parameter/ParameterAccessContext.h index b59debb..302f920 100644 --- a/parameter/ParameterAccessContext.h +++ b/parameter/ParameterAccessContext.h @@ -57,9 +57,20 @@ public: void setValueSpaceRaw(bool bIsRaw); bool valueSpaceIsRaw() const; - // Output Raw Format for user get value interpretation + /** + * Assigns Output Raw Format for user get value interpretation. + * + * @param[in] bIsHex "true" for hexadecimal, "false" for decimal + * + */ void setOutputRawFormat(bool bIsHex); - bool outputRawFormatIsHex(); + /** + * Returns Output Raw Format for user get value interpretation. + * + * @return "true" for hexadecimal, "false" for decimal + * + */ + bool outputRawFormatIsHex() const; // Endianness void setBigEndianSubsystem(bool bBigEndian); -- cgit v1.1 From 86e19e3063dd2558802ba2fe51d140d25f931e82 Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 3 Jul 2014 21:56:18 +0200 Subject: Removed spurious execution mode on source files BZ: 208504 Some source files were mistakenly assigned the executable flag. Change-Id: Iad85123c331d2599126ed46f070fe10614f7c360 Signed-off-by: Patrick Benavoli --- parameter/IntegerParameterType.cpp | 0 parameter/IntegerParameterType.h | 0 parameter/ParameterType.cpp | 0 parameter/ParameterType.h | 0 parameter/SubsystemObject.cpp | 0 parameter/SubsystemObject.h | 0 parameter/TypeElement.cpp | 0 parameter/TypeElement.h | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 parameter/IntegerParameterType.cpp mode change 100755 => 100644 parameter/IntegerParameterType.h mode change 100755 => 100644 parameter/ParameterType.cpp mode change 100755 => 100644 parameter/ParameterType.h mode change 100755 => 100644 parameter/SubsystemObject.cpp mode change 100755 => 100644 parameter/SubsystemObject.h mode change 100755 => 100644 parameter/TypeElement.cpp mode change 100755 => 100644 parameter/TypeElement.h diff --git a/parameter/IntegerParameterType.cpp b/parameter/IntegerParameterType.cpp old mode 100755 new mode 100644 diff --git a/parameter/IntegerParameterType.h b/parameter/IntegerParameterType.h old mode 100755 new mode 100644 diff --git a/parameter/ParameterType.cpp b/parameter/ParameterType.cpp old mode 100755 new mode 100644 diff --git a/parameter/ParameterType.h b/parameter/ParameterType.h old mode 100755 new mode 100644 diff --git a/parameter/SubsystemObject.cpp b/parameter/SubsystemObject.cpp old mode 100755 new mode 100644 diff --git a/parameter/SubsystemObject.h b/parameter/SubsystemObject.h old mode 100755 new mode 100644 diff --git a/parameter/TypeElement.cpp b/parameter/TypeElement.cpp old mode 100755 new mode 100644 diff --git a/parameter/TypeElement.h b/parameter/TypeElement.h old mode 100755 new mode 100644 -- cgit v1.1 From 822d0a70b3a2a4f862d01fa6c0194a406708bf63 Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 3 Jul 2014 22:03:23 +0200 Subject: Coding style correction BZ: 208504 Concerns the handle to remote processor library. In PFW coding style, the variables are named like in english language: The actual nature of the object needs to lie at the end of the name. Change-Id: If41218c3456d07c81a953182488c6ae71e31b6d8 Signed-off-by: Patrick Benavoli --- parameter/ParameterMgr.cpp | 13 +++++++------ parameter/ParameterMgr.h | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index d112461..47abd0d 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -300,7 +300,7 @@ CParameterMgr::CParameterMgr(const string& strConfigurationFilePath) : _pElementLibrarySet(new CElementLibrarySet), _strXmlConfigurationFilePath(strConfigurationFilePath), _pSubsystemPlugins(NULL), - _handleLibRemoteProcessor(NULL), + _pvLibRemoteProcessorHandle(NULL), _uiStructureChecksum(0), _pRemoteProcessorServer(NULL), _uiMaxCommandUsageLength(0), @@ -358,8 +358,9 @@ CParameterMgr::~CParameterMgr() delete _pElementLibrarySet; // Close remote processor library - if (_handleLibRemoteProcessor != NULL) { - dlclose(_handleLibRemoteProcessor); + if (_pvLibRemoteProcessorHandle) { + + dlclose(_pvLibRemoteProcessorHandle); } // Tuning Mode Mutex @@ -2459,9 +2460,9 @@ bool CParameterMgr::handleRemoteProcessingInterface(string& strError) log_info("Loading remote processor library"); // Load library - _handleLibRemoteProcessor = dlopen("libremote-processor.so", RTLD_NOW); + _pvLibRemoteProcessorHandle = dlopen("libremote-processor.so", RTLD_NOW); - if (!_handleLibRemoteProcessor) { + if (!_pvLibRemoteProcessorHandle) { // Return error const char* pcError = dlerror(); @@ -2477,7 +2478,7 @@ bool CParameterMgr::handleRemoteProcessingInterface(string& strError) return false; } - CreateRemoteProcessorServer pfnCreateRemoteProcessorServer = (CreateRemoteProcessorServer)dlsym(_handleLibRemoteProcessor, "createRemoteProcessorServer"); + CreateRemoteProcessorServer pfnCreateRemoteProcessorServer = (CreateRemoteProcessorServer)dlsym(_pvLibRemoteProcessorHandle, "createRemoteProcessorServer"); if (!pfnCreateRemoteProcessorServer) { diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index c6a2fd5..7edace1 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -597,8 +597,10 @@ private: // Subsystem plugin location const CSubsystemPlugins* _pSubsystemPlugins; - // Remote processor library handle - void *_handleLibRemoteProcessor; + /** + * Remote processor library handle + */ + void* _pvLibRemoteProcessorHandle; // Whole system structure checksum uint8_t _uiStructureChecksum; -- cgit v1.1 From 79694d5d0a632ed4ca04ea42f19fb09c3fba0cdb Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 3 Jul 2014 22:30:44 +0200 Subject: Delete subsystem instances *before* plugin unload BZ: 208504 Before this patch there was a crash in CElement destructor in Ubuntu upon destuction of parameter framework instance. The crash was caused by the attempt to call unmapped code: The subsystem plugin libraries were getting unloaded before the execution of the subsystem destructors. Note: In Android the issue is not seen since library unload is not implemented. This patch ensures SystemClass destructor destroys the subsystems explicitely unloading the plugins. Change-Id: I19dad262b384bdbd63c7c319a41a5d547d0e75e9 Signed-off-by: Patrick Benavoli --- parameter/SystemClass.cpp | 17 +++++++++++------ parameter/SystemClass.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/parameter/SystemClass.cpp b/parameter/SystemClass.cpp index effc573..6169223 100644 --- a/parameter/SystemClass.cpp +++ b/parameter/SystemClass.cpp @@ -71,11 +71,16 @@ CSystemClass::~CSystemClass() { delete _pSubsystemLibrary; - // Close all previously opened libraries - while (!_subsystemLibraries.empty()) - { - dlclose(_subsystemLibraries.back()); - _subsystemLibraries.pop_back(); + // Destroy child subsystems *before* unloading the libraries (otherwise crashes will occur + // as unmapped code will be referenced) + clean(); + + // Close all previously opened subsystem libraries + list::const_iterator it; + + for (it = _subsystemLibraryHandleList.begin(); it != _subsystemLibraryHandleList.end(); ++it) { + + dlclose(*it); } } @@ -238,7 +243,7 @@ bool CSystemClass::loadPlugins(list& lstrPluginFiles, list& lstr } // Store libraries handles - _subsystemLibraries.push_back(lib_handle); + _subsystemLibraryHandleList.push_back(lib_handle); // Get plugin symbol string strPluginSymbol = getPluginSymbol(strPluginFileName); diff --git a/parameter/SystemClass.h b/parameter/SystemClass.h index 3ffbf25..b5bce45 100644 --- a/parameter/SystemClass.h +++ b/parameter/SystemClass.h @@ -111,6 +111,6 @@ private: // Subsystem factory CSubsystemLibrary* _pSubsystemLibrary; - std::list _subsystemLibraries; /**< Contains the list of all open plugin libs. */ + std::list _subsystemLibraryHandleList; /**< Contains the list of all open plugin libs. */ }; -- cgit v1.1 From 0548523ab6bbca766dcce4be97a0c50efd529d90 Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Tue, 8 Jul 2014 14:09:09 +0200 Subject: Adding XML format to Criteria export tuning I/F BZ: 209937 The "listCriteria" command returns the list of criteria in a human readable way. However, external tools that require to know this list of criteria have trouble parsing this output. An XML output would solve the issue. Changed "listCriteria" command to accept "XML" as first and only argument. In the end, listCriteria command accepts the 3 following forms: - listCriteria => will list the criteria states and type content in a human readable format - listCriteria csv|CSV => will list the criteria states and type content in a CSV format - listCriteria xml|XML => will list the criteria states and type content in an XML format Removed python binding accordingly. Change-Id: Ib060ec0a5d1ff87ba6c25caf4e0d5839a7927715 Signed-off-by: Patrick Benavoli Signed-off-by: Sebastien Gonzalve --- bindings/python/pfw.i | 4 -- parameter/ParameterMgr.cpp | 70 +++++++++++++++++++-------- parameter/ParameterMgr.h | 14 +++--- parameter/ParameterMgrFullConnector.cpp | 5 -- parameter/SelectionCriterion.cpp | 13 +++++ parameter/SelectionCriterion.h | 9 ++++ parameter/SelectionCriterionType.cpp | 23 +++++++++ parameter/SelectionCriterionType.h | 9 ++++ parameter/include/ParameterMgrFullConnector.h | 10 ---- xmlserializer/XmlElement.cpp | 7 +++ xmlserializer/XmlElement.h | 8 +++ 11 files changed, 126 insertions(+), 46 deletions(-) diff --git a/bindings/python/pfw.i b/bindings/python/pfw.i index ce27173..9dbccbd 100644 --- a/bindings/python/pfw.i +++ b/bindings/python/pfw.i @@ -169,10 +169,6 @@ public: bool exportSingleDomainXml(std::string& strXmlDest, const std::string& strDomainName, bool bWithSettings, bool bToFile, std::string& strError) const; %clear std::string& strXmlDest; - -%apply std::string &OUTPUT { std::string& strResult } - bool getSystemClassXMLString(std::string& strResult); -%clear std::string& strResult; }; // SWIG nested class support is not complete - cf. diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 47abd0d..a1f2087 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -87,8 +87,11 @@ #include "XmlStringDocSource.h" #include "XmlMemoryDocSink.h" #include "XmlMemoryDocSource.h" +#include "SelectionCriteriaDefinition.h" #include "Utility.h" #include +#include +#include #include #define base CElement @@ -160,7 +163,7 @@ const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gastRemoteCommandPa /// Criteria { "listCriteria", &CParameterMgr::listCriteriaCommmandProcess, 0, - "[csv]", "List selection criteria" }, + "[CSV|XML]", "List selection criteria" }, /// Domains { "listDomains", &CParameterMgr::listDomainsCommmandProcess, 0, @@ -1083,28 +1086,52 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::syncCommmandProcess /// Criteria CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listCriteriaCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult) { - (void)remoteCommand; + if (remoteCommand.getArgumentCount() > 1) { - bool humanReadable = true; + return CCommandHandler::EShowUsage; + } + + string strOutputFormat; // Look for optional arguments - if (remoteCommand.getArgumentCount() >= 1) { + if (remoteCommand.getArgumentCount() == 1) { + + // Get requested format + strOutputFormat = remoteCommand.getArgument(0); + + // Capitalize + std::transform(strOutputFormat.begin(), strOutputFormat.end(), strOutputFormat.begin(), ::toupper); + + if (strOutputFormat != "XML" && strOutputFormat != "CSV") { - // If csv is provided, format the criterion list in Commas Separated Value pairs - if (remoteCommand.getArgument(0) == "csv") { - humanReadable = false; - } else { return CCommandHandler::EShowUsage; } } - list lstrResult; - getSelectionCriteria()->listSelectionCriteria(lstrResult, true, humanReadable); + if (strOutputFormat == "XML") { + // Get Root element where to export from + const CSelectionCriteriaDefinition* pSelectionCriteriaDefinition = getConstSelectionCriteria()->getSelectionCriteriaDefinition(); - // Concatenate the criterion list as the command result - CUtility::asString(lstrResult, strResult); + if (!exportElementToXMLString(pSelectionCriteriaDefinition, "SelectionCriteria", false, strResult)) { - return CCommandHandler::ESucceeded; + return CCommandHandler::EFailed; + } + + // Succeeded + return CCommandHandler::ESucceeded; + } else { + + // Requested format will be either CSV or human readable based on strOutputFormat content + bool bHumanReadable = strOutputFormat.empty(); + + list lstrResult; + getSelectionCriteria()->listSelectionCriteria(lstrResult, true, bHumanReadable); + + // Concatenate the criterion list as the command result + CUtility::asString(lstrResult, strResult); + + return CCommandHandler::ESucceeded; + } } /// Domains @@ -1646,7 +1673,10 @@ CParameterMgr::CCommandHandler::CommandStatus { (void)remoteCommand; - if (!getSystemClassXMLString(strResult)) { + // Get Root element where to export from + const CSystemClass* pSystemClass = getSystemClass(); + + if (!exportElementToXMLString(pSystemClass, pSystemClass->getKind(), false, strResult)) { return CCommandHandler::EFailed; } @@ -2581,28 +2611,26 @@ void CParameterMgr::doApplyConfigurations(bool bForce) getSelectionCriteria()->resetModifiedStatus(); } -bool CParameterMgr::getSystemClassXMLString(string& strResult) +// Export to XML string +bool CParameterMgr::exportElementToXMLString(const IXmlSource *pXmlSource, const string& strRootElementType, bool bValidateWithSchema, string& strResult) const { - // Root element - const CSystemClass* pSystemClass = getSystemClass(); - string strError; CXmlSerializingContext xmlSerializingContext(strError); // Use a doc source by loading data from instantiated Configurable Domains - CXmlMemoryDocSource memorySource(pSystemClass, pSystemClass->getKind(), - _bValidateSchemasOnStart); + CXmlMemoryDocSource memorySource(pXmlSource, strRootElementType, + bValidateWithSchema); // Use a doc sink that write the doc data in a string CXmlStringDocSink stringSink(strResult); + // Do the export bool bProcessSuccess = stringSink.process(memorySource, xmlSerializingContext); if (!bProcessSuccess) { strResult = strError; - } return bProcessSuccess; diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 7edace1..03a1e92 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -88,7 +88,7 @@ class CParameterMgr : private CElement }; // Version static const uint32_t guiEditionMajor = 0x2; - static const uint32_t guiEditionMinor = 0x3; + static const uint32_t guiEditionMinor = 0x4; static const uint32_t guiRevision = 0x0; // Parameter handle friendship @@ -340,14 +340,16 @@ public: bool exportDomainsBinary(const std::string& strFileName, std::string& strError); /** - * Method that creates an Xml description of the instanciated parameter structure contained - * in SystemClass. + * Method that exports an Xml description of the passed element into a string * - * @param[out] strResult contains the xml description of SystemClass or the errors if any + * @param[in] pXmlSource The source element to export + * @param[in] strRootElementType The XML root element name of the exported instance document + * @param[in] bValidateWithSchema true if source XML document requires validation against schema + * @param[out] strResult contains the xml description or the error description in case false is returned * - * @return false if any error occures during the creation of the xml description + * @return true for success, false if any error occurs during the creation of the xml description (validation or encoding) */ - bool getSystemClassXMLString(std::string& strResult); + bool exportElementToXMLString(const IXmlSource* pXmlSource, const std::string& strRootElementType, bool bValidateWithSchema, std::string& strResult) const; // CElement virtual std::string getKind() const; diff --git a/parameter/ParameterMgrFullConnector.cpp b/parameter/ParameterMgrFullConnector.cpp index b03facc..30f31e9 100644 --- a/parameter/ParameterMgrFullConnector.cpp +++ b/parameter/ParameterMgrFullConnector.cpp @@ -363,8 +363,3 @@ bool CParameterMgrFullConnector::exportSingleDomainXml(string& strXmlDest, return _pParameterMgr->exportSingleDomainXml(strXmlDest, strDomainName, bWithSettings, bToFile, strError); } - -bool CParameterMgrFullConnector::getSystemClassXMLString(string& strResult) -{ - return _pParameterMgr->getSystemClassXMLString(strResult); -} diff --git a/parameter/SelectionCriterion.cpp b/parameter/SelectionCriterion.cpp index f49137b..7818924 100644 --- a/parameter/SelectionCriterion.cpp +++ b/parameter/SelectionCriterion.cpp @@ -27,6 +27,7 @@ * (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 "SelectionCriterion.h" #include "AutoLog.h" @@ -168,3 +169,15 @@ std::string CSelectionCriterion::getFormattedDescription(bool bWithTypeInfo, boo } return strFormattedDescription; } + +// XML export +void CSelectionCriterion::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const +{ + // Current Value + xmlElement.setAttributeString("Value", _pType->getFormattedState(_iState)); + + // Serialize Type node + _pType->toXml(xmlElement, serializingContext); + + base::toXml(xmlElement, serializingContext); +} diff --git a/parameter/SelectionCriterion.h b/parameter/SelectionCriterion.h index c61d7d0..cf99035 100644 --- a/parameter/SelectionCriterion.h +++ b/parameter/SelectionCriterion.h @@ -63,6 +63,15 @@ public: /// From CElement virtual std::string getKind() const; + + /** + * Export to XML + * + * @param[in] xmlElement The XML element to export to + * @param[in] serializingContext The serializing context + * + */ + virtual void toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const; private: // Current state int _iState; diff --git a/parameter/SelectionCriterionType.cpp b/parameter/SelectionCriterionType.cpp index 3e9cc80..95e8e46 100644 --- a/parameter/SelectionCriterionType.cpp +++ b/parameter/SelectionCriterionType.cpp @@ -203,3 +203,26 @@ std::string CSelectionCriterionType::getFormattedState(int iValue) const return strFormattedState; } + +// From IXmlSource +void CSelectionCriterionType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const +{ + // Type Kind + xmlElement.setAttributeString("Kind", isTypeInclusive() ? "Inclusive" : "Exclusive"); + + // Value pairs as children + NumToLitMapConstIt it; + + for (it = _numToLitMap.begin(); it != _numToLitMap.end(); ++it) { + + CXmlElement childValuePairElement; + + xmlElement.createChild(childValuePairElement, "ValuePair"); + // Literal + childValuePairElement.setAttributeString("Literal", it->first); + // Numerical + childValuePairElement.setAttributeSignedInteger("Numerical", it->second); + } + + base::toXml(xmlElement, serializingContext); +} diff --git a/parameter/SelectionCriterionType.h b/parameter/SelectionCriterionType.h index bfef21e..ef4176a 100644 --- a/parameter/SelectionCriterionType.h +++ b/parameter/SelectionCriterionType.h @@ -63,6 +63,15 @@ public: // Formatted state virtual std::string getFormattedState(int iValue) const; + /** + * Export to XML + * + * @param[in] xmlElement The XML element to export to + * @param[in] serializingContext The serializing context + * + */ + virtual void toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const; + // From CElement virtual std::string getKind() const; private: diff --git a/parameter/include/ParameterMgrFullConnector.h b/parameter/include/ParameterMgrFullConnector.h index 8ef7bb7..31022a6 100644 --- a/parameter/include/ParameterMgrFullConnector.h +++ b/parameter/include/ParameterMgrFullConnector.h @@ -259,16 +259,6 @@ public: bool exportSingleDomainXml(std::string& strXmlDest, const std::string& strDomainName, bool bWithSettings, bool bToFile, std::string& strError) const; - /** - * Method that creates an Xml description of the instanciated parameter structure contained - * in SystemClass. - * - * @param[out] strResult contains the xml description of SystemClass or the errors if any - * - * @return false if any error occures during the creation of the xml description - */ - bool getSystemClassXMLString(std::string& strResult); - private: // disallow copying because this class manages raw pointers' lifecycle CParameterMgrFullConnector(const CParameterMgrFullConnector&); diff --git a/xmlserializer/XmlElement.cpp b/xmlserializer/XmlElement.cpp index 106bfdc..d45f360 100644 --- a/xmlserializer/XmlElement.cpp +++ b/xmlserializer/XmlElement.cpp @@ -221,6 +221,13 @@ void CXmlElement::setAttributeInteger(const string& strAttributeName, uint32_t u setAttributeString(strAttributeName, strStream.str()); } +void CXmlElement::setAttributeSignedInteger(const string& strAttributeName, int32_t iValue) +{ + ostringstream strStream; + strStream << iValue; + setAttributeString(strAttributeName, strStream.str()); +} + void CXmlElement::setNameAttribute(const string& strValue) { setAttributeString("Name", strValue); diff --git a/xmlserializer/XmlElement.h b/xmlserializer/XmlElement.h index 9c5ca0e..7c1d518 100644 --- a/xmlserializer/XmlElement.h +++ b/xmlserializer/XmlElement.h @@ -71,6 +71,14 @@ public: void setTextContent(const std::string& strContent); void setComment(const std::string& strComment); void setAttributeInteger(const std::string& strAttributeName, uint32_t uiValue); + /** + * Set attribute with signed integer + * + * @param[in] strAttributeName The attribute name + * @param[in] iValue The attribute value + * + */ + void setAttributeSignedInteger(const std::string& strAttributeName, int32_t iValue); // Child creation void createChild(CXmlElement& childElement, const std::string& strType); -- cgit v1.1 From 7f9e3fe4eb15c9ba2ee4205c182ba68c8cc7be0f Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 24 Jul 2014 18:45:09 +0200 Subject: Missing error reporting statement in XML Export feature BZ: 209937 In case an error is encountered during the XML encoding operation, no error message is created to log the issue. This patch updates XmlStringDocSink.cpp::doProcess() so that the error string is filled in case of errors. Change-Id: Ie93e50f857506b8637b1bb0dd8d411a01f16ec49 Signed-off-by: Patrick Benavoli --- xmlserializer/XmlStringDocSink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmlserializer/XmlStringDocSink.cpp b/xmlserializer/XmlStringDocSink.cpp index 4b05d85..caec545 100644 --- a/xmlserializer/XmlStringDocSink.cpp +++ b/xmlserializer/XmlStringDocSink.cpp @@ -27,7 +27,6 @@ * (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 "XmlStringDocSink.h" #include @@ -50,6 +49,8 @@ bool CXmlStringDocSink::doProcess(CXmlDocSource& xmlDocSource, if (!pcDumpedDoc) { + serializingContext.setError("Unable to encode XML document in memory"); + return false; } -- cgit v1.1 From 8ff3e0fed53fb64b27b01ab69acee60fbf4e4013 Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 24 Jul 2014 18:46:25 +0200 Subject: Cleaned up XML export feature BZ: 209937 This patch solves 1 issue regarding XML export feature: - ParameterMgr.cpp::exportElementToXMLString(): This method was receiving a useless bValidateWithSchema argument. Indeed, elements in memory are necessarily valid (unlike documents coming from external sources). Change-Id: I55bf84c8ff53c37c9fc55e60f7f64e8776a43dc7 Signed-off-by: Patrick Benavoli --- parameter/ParameterMgr.cpp | 12 +++++++----- parameter/ParameterMgr.h | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index a1f2087..e11b1ad 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -1112,7 +1112,8 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listCriteriaCommman // Get Root element where to export from const CSelectionCriteriaDefinition* pSelectionCriteriaDefinition = getConstSelectionCriteria()->getSelectionCriteriaDefinition(); - if (!exportElementToXMLString(pSelectionCriteriaDefinition, "SelectionCriteria", false, strResult)) { + if (!exportElementToXMLString(pSelectionCriteriaDefinition, "SelectionCriteria", + strResult)) { return CCommandHandler::EFailed; } @@ -1676,7 +1677,7 @@ CParameterMgr::CCommandHandler::CommandStatus // Get Root element where to export from const CSystemClass* pSystemClass = getSystemClass(); - if (!exportElementToXMLString(pSystemClass, pSystemClass->getKind(), false, strResult)) { + if (!exportElementToXMLString(pSystemClass, pSystemClass->getKind(), strResult)) { return CCommandHandler::EFailed; } @@ -2612,15 +2613,16 @@ void CParameterMgr::doApplyConfigurations(bool bForce) } // Export to XML string -bool CParameterMgr::exportElementToXMLString(const IXmlSource *pXmlSource, const string& strRootElementType, bool bValidateWithSchema, string& strResult) const +bool CParameterMgr::exportElementToXMLString(const IXmlSource* pXmlSource, + const string& strRootElementType, + string& strResult) const { string strError; CXmlSerializingContext xmlSerializingContext(strError); // Use a doc source by loading data from instantiated Configurable Domains - CXmlMemoryDocSource memorySource(pXmlSource, strRootElementType, - bValidateWithSchema); + CXmlMemoryDocSource memorySource(pXmlSource, strRootElementType, false); // Use a doc sink that write the doc data in a string CXmlStringDocSink stringSink(strResult); diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 03a1e92..6a3ecb8 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -344,12 +344,13 @@ public: * * @param[in] pXmlSource The source element to export * @param[in] strRootElementType The XML root element name of the exported instance document - * @param[in] bValidateWithSchema true if source XML document requires validation against schema * @param[out] strResult contains the xml description or the error description in case false is returned * * @return true for success, false if any error occurs during the creation of the xml description (validation or encoding) */ - bool exportElementToXMLString(const IXmlSource* pXmlSource, const std::string& strRootElementType, bool bValidateWithSchema, std::string& strResult) const; + bool exportElementToXMLString(const IXmlSource* pXmlSource, + const std::string& strRootElementType, + std::string& strResult) const; // CElement virtual std::string getKind() const; -- cgit v1.1 From 2f23dba7b1ffbe72979f6c78c3d103b1244f0ead Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Thu, 5 Jun 2014 11:42:32 +0200 Subject: Remove remote process socket connection timeout From time to time, on Buildbot, the PFW generation build step fails due to remote processor socket connection timeout. In order to avoid deconnection when the peer is slow, this patch removes the remote processor socket connection timeout. Change-Id: I56b5b4b846a7489accd56ba3a3224dc1ffc1085e Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-5511 Signed-off-by: Kevin Rocard Reviewed-on: https://android.intel.com:443/289012 --- remote-process/main.cpp | 3 --- remote-processor/RemoteProcessorServer.cpp | 3 --- 2 files changed, 6 deletions(-) diff --git a/remote-process/main.cpp b/remote-process/main.cpp index bcf825b..97881dc 100644 --- a/remote-process/main.cpp +++ b/remote-process/main.cpp @@ -157,9 +157,6 @@ int main(int argc, char *argv[]) // Connect to target CConnectionSocket connectionSocket; - // Set timeout - connectionSocket.setTimeout(5000); - string strError; // Connect if (!connectionSocket.connect(argv[1], uiPort, strError)) { diff --git a/remote-processor/RemoteProcessorServer.cpp b/remote-processor/RemoteProcessorServer.cpp index dff935b..c1d87e5 100644 --- a/remote-processor/RemoteProcessorServer.cpp +++ b/remote-processor/RemoteProcessorServer.cpp @@ -157,9 +157,6 @@ void CRemoteProcessorServer::handleNewConnection() return; } - // Set timeout - clientSocket->setTimeout(5000); - // Process all incoming requests from the client while (true) { -- cgit v1.1 From 96e3a00ec93d76d90aede5538c882caafe23849f Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Tue, 13 Jan 2015 17:18:44 +0100 Subject: [Workaround][xmlGenerator] Increase retry on EADDRINUSE During host domain generation, a port must be chosen before spawning a servers, producing an error if someone else uses it before the server. This race was workaround by retiring 10 times before failing. This divided the failure probability by 10, but is no longer sufficient. A correct implementation without this race is currently been developed (without socket) but until then change the retry number from 10 to 1000. Signed-off-by: Kevin Rocard Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-17358 Change-Id: Ie80e4508952ef150eb999d9a6fa7e60b61825f35 Reviewed-on: https://android.intel.com:443/319856 --- tools/xmlGenerator/hostDomainGenerator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xmlGenerator/hostDomainGenerator.sh b/tools/xmlGenerator/hostDomainGenerator.sh index 4222382..1a7d315 100755 --- a/tools/xmlGenerator/hostDomainGenerator.sh +++ b/tools/xmlGenerator/hostDomainGenerator.sh @@ -245,7 +245,7 @@ changeSocketsPorts() { # Start the pfw using different socket if it fails safeStartPFW () { local retry=0 - local nbRetry=10 + local nbRetry=1000 # Workaround to avoid build failure, it very very rarely fail this many time # Choose a new pair of socket ports changeSocketsPorts -- cgit v1.1 From a1fdb2965956d3cbc62e6f8b29405bdeef79dca3 Mon Sep 17 00:00:00 2001 From: Piotr Diop Date: Fri, 16 Jan 2015 17:52:45 +0100 Subject: Create a Logarithm Adaptation parameter type Some parameters need to be converted to logarithm. This can be the case for volumes that come from HAL as mere decimal values. This patch adds the LogarithmAdaptationParameter type. Change-Id: Ic64232816a82c56a6ddffa5fdccda356eb4ec9c7 Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-16954 Signed-off-by: Piotr Diop Reviewed-on: https://android.intel.com:443/320371 --- Schemas/Parameter.xsd | 18 ++++-- parameter/Android.mk | 1 + parameter/CMakeLists.txt | 1 + parameter/LinearParameterAdaptation.cpp | 7 ++- parameter/LinearParameterAdaptation.h | 3 +- parameter/LogarithmicParameterAdaptation.cpp | 89 ++++++++++++++++++++++++++++ parameter/LogarithmicParameterAdaptation.h | 71 ++++++++++++++++++++++ parameter/ParameterMgr.cpp | 4 +- 8 files changed, 187 insertions(+), 7 deletions(-) create mode 100644 parameter/LogarithmicParameterAdaptation.cpp create mode 100644 parameter/LogarithmicParameterAdaptation.h diff --git a/Schemas/Parameter.xsd b/Schemas/Parameter.xsd index 3b635fc..f174b6e 100644 --- a/Schemas/Parameter.xsd +++ b/Schemas/Parameter.xsd @@ -34,12 +34,21 @@ - + + + + + + + + + + - - - + + + @@ -63,6 +72,7 @@ + diff --git a/parameter/Android.mk b/parameter/Android.mk index 8592c52..6f1f61d 100644 --- a/parameter/Android.mk +++ b/parameter/Android.mk @@ -79,6 +79,7 @@ common_src_files := \ InstanceDefinition.cpp \ IntegerParameterType.cpp \ LinearParameterAdaptation.cpp \ + LogarithmicParameterAdaptation.cpp \ MappingContext.cpp \ MappingData.cpp \ ParameterAccessContext.cpp \ diff --git a/parameter/CMakeLists.txt b/parameter/CMakeLists.txt index 9f93da7..94369fb 100644 --- a/parameter/CMakeLists.txt +++ b/parameter/CMakeLists.txt @@ -64,6 +64,7 @@ add_library(parameter SHARED InstanceDefinition.cpp IntegerParameterType.cpp LinearParameterAdaptation.cpp + LogarithmicParameterAdaptation.cpp MappingContext.cpp MappingData.cpp ParameterAccessContext.cpp diff --git a/parameter/LinearParameterAdaptation.cpp b/parameter/LinearParameterAdaptation.cpp index 4be92a9..ea833b3 100644 --- a/parameter/LinearParameterAdaptation.cpp +++ b/parameter/LinearParameterAdaptation.cpp @@ -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, @@ -37,6 +37,11 @@ CLinearParameterAdaptation::CLinearParameterAdaptation() : base("Linear"), _dSlo { } +CLinearParameterAdaptation::CLinearParameterAdaptation(const string& strType) : + base(strType), _dSlopeNumerator(1), _dSlopeDenominator(1) +{ +} + // Element properties void CLinearParameterAdaptation::showProperties(string& strResult) const { diff --git a/parameter/LinearParameterAdaptation.h b/parameter/LinearParameterAdaptation.h index f72f27b..8037c31 100644 --- a/parameter/LinearParameterAdaptation.h +++ b/parameter/LinearParameterAdaptation.h @@ -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, @@ -37,6 +37,7 @@ class CLinearParameterAdaptation : public CParameterAdaptation { public: CLinearParameterAdaptation(); + CLinearParameterAdaptation(const std::string& strType); // Conversions virtual int64_t fromUserValue(double dValue) const; diff --git a/parameter/LogarithmicParameterAdaptation.cpp b/parameter/LogarithmicParameterAdaptation.cpp new file mode 100644 index 0000000..688527d --- /dev/null +++ b/parameter/LogarithmicParameterAdaptation.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2011-2015, 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 "LogarithmicParameterAdaptation.h" +#include + +#define base CLinearParameterAdaptation + +// M_E is the base of the natural logarithm for 'e' from math.h +CLogarithmicParameterAdaptation::CLogarithmicParameterAdaptation() : base("Logarithmic"), + _dLogarithmBase(M_E), _dFloorValue(-INFINITY) +{ +} + +// Element properties +void CLogarithmicParameterAdaptation::showProperties(std::string& strResult) const +{ + base::showProperties(strResult); + + strResult += " - LogarithmBase: "; + strResult += toString(_dLogarithmBase); + strResult += "\n"; + strResult += " - FloorValue: "; + strResult += toString(_dFloorValue); + strResult += "\n"; +} + +bool CLogarithmicParameterAdaptation::fromXml(const CXmlElement& xmlElement, + CXmlSerializingContext& serializingContext) +{ + + if (xmlElement.hasAttribute("LogarithmBase")) { + + _dLogarithmBase = xmlElement.getAttributeDouble("LogarithmBase"); + + // Avoid negative and 1 values + if (_dLogarithmBase <= 0 || _dLogarithmBase == 1) { + serializingContext.setError("LogarithmBase attribute cannot be negative or 1 on element" + + xmlElement.getPath()); + + return false; + } + } + + if (xmlElement.hasAttribute("FloorValue")) { + _dFloorValue = xmlElement.getAttributeDouble("FloorValue"); + } + // Base + return base::fromXml(xmlElement, serializingContext); +} + + +int64_t CLogarithmicParameterAdaptation::fromUserValue(double dValue) const +{ + return fmax(round(base::fromUserValue(log(dValue) / log(_dLogarithmBase))), + _dFloorValue); +} + +double CLogarithmicParameterAdaptation::toUserValue(int64_t iValue) const +{ + return exp(base::toUserValue(iValue) * log(_dLogarithmBase)); +} diff --git a/parameter/LogarithmicParameterAdaptation.h b/parameter/LogarithmicParameterAdaptation.h new file mode 100644 index 0000000..3b7fd4d --- /dev/null +++ b/parameter/LogarithmicParameterAdaptation.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011-2015, 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. + */ + +#pragma once + +#include "LinearParameterAdaptation.h" + +/** + * This class is used to perform a logarithmic adapation of type: + * (slopeNumerator / slopeDenominator) * log(parameter) + offset + * Since log(x) == -INFINITY , we can define FloorValue as a + * x -> 0 + * a lower bound limit for the adaptation + */ +class CLogarithmicParameterAdaptation : public CLinearParameterAdaptation +{ +public: + CLogarithmicParameterAdaptation(); + + /** + * Conversions must satisfy the following: f(f'(a)) = a + * Let f=fromUserValue and f'=toUserValue + * if y = f(log(x)/log(base)), then + * 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; + + virtual void showProperties(std::string& strResult) const; + + virtual bool fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& serializingContext); +private: + /** + * _dLogarithmBase characterizes the new logarithm logB(x) with + * the following property: logB(x) = log(x) / log(_dLogarithmBase). + * log being the base-e logarithm. + */ + double _dLogarithmBase; + /** + * _dFloorValue reflects the lower bound for volume attenuation + */ + double _dFloorValue; +}; diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index e11b1ad..fb09a7f 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -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, @@ -79,6 +79,7 @@ #include #include "ParameterHandle.h" #include "LinearParameterAdaptation.h" +#include "LogarithmicParameterAdaptation.h" #include "EnumValuePair.h" #include "Subsystem.h" #include "XmlFileDocSink.h" @@ -2447,6 +2448,7 @@ void CParameterMgr::feedElementLibraries() pParameterCreationLibrary->addElementBuilder("BooleanParameter", new TNamedElementBuilderTemplate()); pParameterCreationLibrary->addElementBuilder("IntegerParameter", new TNamedElementBuilderTemplate()); pParameterCreationLibrary->addElementBuilder("LinearAdaptation", new TElementBuilderTemplate()); + pParameterCreationLibrary->addElementBuilder("LogarithmicAdaptation", new TElementBuilderTemplate()); pParameterCreationLibrary->addElementBuilder("EnumParameter", new TNamedElementBuilderTemplate()); pParameterCreationLibrary->addElementBuilder("ValuePair", new TElementBuilderTemplate()); pParameterCreationLibrary->addElementBuilder("FixedPointParameter", new TNamedElementBuilderTemplate()); -- cgit v1.1 From 9622b059c7e819d9b69c5266252c6adae1b634bc Mon Sep 17 00:00:00 2001 From: Philippe Afonso Date: Thu, 29 Jan 2015 16:22:36 +0100 Subject: Create output host library directory if needed The directory where to generate output may not exists leading generation to failure. This patch adds the directory creation and thus makes sure generation won't fail for this reason. Change-Id: I1cee75d6d7921315dc3a928245499bde447c3639 Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-19676 Signed-off-by: Sebastien Gonzalve --- bindings/python/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/python/Android.mk b/bindings/python/Android.mk index 296d4bc..0558344 100644 --- a/bindings/python/Android.mk +++ b/bindings/python/Android.mk @@ -76,6 +76,7 @@ $(generated-sources-dir)/pfw_wrap.h: $(generated-sources-dir)/pfw_wrap.cxx $(generated-sources-dir)/pfw_wrap.cxx: $(LOCAL_PATH)/pfw.i @echo "Generating Python binding files" mkdir -p $(dir $@) # surprisingly, path is not generated by build system + mkdir -p $(HOST_LIBRARY_PATH) prebuilts/misc/linux-x86_64/swig/swig \ -Iprebuilts/misc/common/swig/include/2.0.11/python/ \ -Iprebuilts/misc/common/swig/include/2.0.11/ \ -- cgit v1.1 From 3eeafab805b5d82b168361f05b9ec372d41a0614 Mon Sep 17 00:00:00 2001 From: Philippe Afonso Date: Mon, 9 Feb 2015 17:53:47 +0100 Subject: Add libremote-processor as dependency libremote-processor headers are needed by the parameter core. This patch adds explicitily the dependency to this module. Change-Id: I7a223a0abd35f9524a047ca92e1029c5cef38e38 Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-19676 Signed-off-by: Philippe Afonso --- parameter/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parameter/Android.mk b/parameter/Android.mk index 6f1f61d..90e33f0 100644 --- a/parameter/Android.mk +++ b/parameter/Android.mk @@ -156,6 +156,8 @@ LOCAL_C_INCLUDES := $(common_c_includes) LOCAL_SHARED_LIBRARIES := $(common_shared_libraries) libdl LOCAL_STATIC_LIBRARIES := libxmlserializer libpfw_utility libxml2 +LOCAL_REQUIRED_MODULES := libremote-processor + LOCAL_CLANG := false include external/stlport/libstlport.mk include $(BUILD_SHARED_LIBRARY) -- cgit v1.1 From 36423a49fdde5755faea5914e554b64363034b0c Mon Sep 17 00:00:00 2001 From: David Wagner Date: Wed, 4 Feb 2015 14:47:14 +0100 Subject: Fix SystemClass duplicate 'Name' attribute in xml export When refactoring Element::toXml, we forgot to make the necessary adaptation in SystemClass::toXml. The latter does not need to set the Name attribute anymore because this is taken care of by the base toXml method. SystemClass::toXml now only calls the base and can therefore be completely removed. Change-Id: Ibd12feaac2c101dcc22e8716e332cb02f03ba99a Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-19676 Signed-off-by: David Wagner --- parameter/SystemClass.cpp | 9 --------- parameter/SystemClass.h | 3 --- 2 files changed, 12 deletions(-) diff --git a/parameter/SystemClass.cpp b/parameter/SystemClass.cpp index 6169223..334772a 100644 --- a/parameter/SystemClass.cpp +++ b/parameter/SystemClass.cpp @@ -314,12 +314,3 @@ bool CSystemClass::init(string& strError) { return base::init(strError); } - -// From IXmlSource -void CSystemClass::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const -{ - // Set the name of system class - xmlElement.setNameAttribute(getName()); - - base::toXml(xmlElement, serializingContext); -} diff --git a/parameter/SystemClass.h b/parameter/SystemClass.h index b5bce45..a224609 100644 --- a/parameter/SystemClass.h +++ b/parameter/SystemClass.h @@ -75,9 +75,6 @@ public: virtual bool init(std::string& strError); virtual std::string getKind() const; - // From IXmlSource - virtual void toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const; - private: CSystemClass(const CSystemClass&); CSystemClass& operator=(const CSystemClass&); -- cgit v1.1