From 63499d4763e42d76bfd39b79871f611381d2d164 Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Mon, 24 Oct 2011 18:50:03 +0200 Subject: parameter-framework: Sequence BZ: 13152 - Introduced sequence notion in configurations: Sequences are configuration specific and are controlled from the Settings related XML files (order of settings appearance) as well as from the tuning interface (new commands available to set and get the sequence (setElementSequence / getElementSequence). Notes: - sequences will only matter for domains which new "SequenceAware" attribute is set to true (false by default). This attribute is also controlable through the tuning interface (setSequenceAware / getSequenceAware commands). - sequence unaware domain configurations will be applied before sequence aware ones. To allow for such functionality, the XML for settings format had to be reworked, leading to an unfortunate compatibility break. However, one benefit is that now a clear Settings section appears at the bottom of the domain description, which is easier to maintain than the previous structure where the settings appeared as sub-nodes of associated elements. Change-Id: Ic93552fd510ed8847f9c8e7d9d6164f7ea3c8c45 Signed-off-by: Patrick Benavoli Reviewed-on: http://android.intel.com:8080/22558 Reviewed-by: Centelles, Sylvain Tested-by: Barthes, FabienX Reviewed-by: buildbot Tested-by: buildbot Reviewed-on: http://android.intel.com:8080/26780 Reviewed-by: Barthes, FabienX --- parameter/AreaConfiguration.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'parameter/AreaConfiguration.cpp') diff --git a/parameter/AreaConfiguration.cpp b/parameter/AreaConfiguration.cpp index d9d3fcf..2e8c63d 100644 --- a/parameter/AreaConfiguration.cpp +++ b/parameter/AreaConfiguration.cpp @@ -34,8 +34,10 @@ #include "BinaryStream.h" #include -CAreaConfiguration::CAreaConfiguration(const CConfigurableElement* pConfigurableElement) : _pConfigurableElement(pConfigurableElement), _bValid(false) +CAreaConfiguration::CAreaConfiguration(const CConfigurableElement* pConfigurableElement, const CSyncerSet* pSyncerSet) + : _pConfigurableElement(pConfigurableElement), _pSyncerSet(pSyncerSet), _bValid(false) { + // Size blackboard _blackboard.setSize(_pConfigurableElement->getFootPrint()); } @@ -46,11 +48,22 @@ void CAreaConfiguration::save(const CParameterBlackboard* pMainBlackboard) } // Apply data to current -void CAreaConfiguration::restore(CParameterBlackboard* pMainBlackboard) const +bool CAreaConfiguration::restore(CParameterBlackboard* pMainBlackboard, bool bSync, string& strError) const { assert(_bValid); pMainBlackboard->restoreFrom(&_blackboard, _pConfigurableElement->getOffset()); + + // Synchronize if required + if (bSync) { + + if (!_pSyncerSet->sync(*pMainBlackboard, false, strError)) { + + return false; + } + } + + return true; } // Ensure validity @@ -91,7 +104,7 @@ void CAreaConfiguration::validateAgainst(const CAreaConfiguration* pValidAreaCon } // XML configuration settings parsing -bool CAreaConfiguration::serializeXmlSettings(CXmlElement& xmlConfigurationSettingsElementContent, CConfigurationAccessContext& configurationAccessContext) +bool CAreaConfiguration::serializeXmlSettings(CXmlElement& xmlConfigurableElementSettingsElementContent, CConfigurationAccessContext& configurationAccessContext) { // Assign blackboard to configuration context configurationAccessContext.setParameterBlackboard(&_blackboard); @@ -100,7 +113,7 @@ bool CAreaConfiguration::serializeXmlSettings(CXmlElement& xmlConfigurationSetti configurationAccessContext.setBaseOffset(_pConfigurableElement->getOffset()); // Parse configuration settings (element contents) - if (_pConfigurableElement->serializeXmlSettings(xmlConfigurationSettingsElementContent, configurationAccessContext)) { + if (_pConfigurableElement->serializeXmlSettings(xmlConfigurableElementSettingsElementContent, configurationAccessContext)) { if (!configurationAccessContext.serializeOut()) { -- cgit v1.1