summaryrefslogtreecommitdiffstats
path: root/parameter/Subsystem.cpp
diff options
context:
space:
mode:
authorPatrick Benavoli <patrickx.benavoli@intel.com>2011-11-07 19:33:30 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-10 17:14:58 +0100
commitd3a86bf6c46db222b0afadc7899c25e1a6e015fb (patch)
treeb4d633248380c7f199339f32e3fd3523d3faef54 /parameter/Subsystem.cpp
parent5901c1d3f448af5d0506d889b0543d9e0de0c2ce (diff)
downloadexternal_parameter-framework-d3a86bf6c46db222b0afadc7899c25e1a6e015fb.zip
external_parameter-framework-d3a86bf6c46db222b0afadc7899c25e1a6e015fb.tar.gz
external_parameter-framework-d3a86bf6c46db222b0afadc7899c25e1a6e015fb.tar.bz2
PFW: Mapping optimization
BZ: 13906 As soon as a subsystem object is created, the mapping process ceases to go deeper and explores other branches of the parameter tree. Adaptation to ICS environment in mk files Change-Id: I5cdf3ea3829f59379804aa88be282b1128c598b0 Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com> Reviewed-on: http://android.intel.com:8080/25401 Reviewed-by: De Chivre, RenaudX <renaudx.de.chivre@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/Subsystem.cpp')
-rw-r--r--parameter/Subsystem.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp
index 7fb4bed..e17a80d 100644
--- a/parameter/Subsystem.cpp
+++ b/parameter/Subsystem.cpp
@@ -249,7 +249,7 @@ bool CSubsystem::handleSubsystemObjectCreation(CInstanceConfigurableElement* pIn
if (pInstanceConfigurableElement->getMappingData(strKey, pStrValue)) {
- // First check context consistensy (required ancestors must have been set prior to object creation)
+ // First check context consistency (required ancestors must have been set prior to object creation)
uint32_t uiAncestorKey;
uint32_t uiAncestorMask = pSubsystemObjectCreator->getAncestorMask();
@@ -271,7 +271,7 @@ bool CSubsystem::handleSubsystemObjectCreation(CInstanceConfigurableElement* pIn
// Then check configurable element size is correct
if (pInstanceConfigurableElement->getFootPrint() > pSubsystemObjectCreator->getMaxConfigurableElementSize()) {
- string strSizeError = "Size should not exceed " + pInstanceConfigurableElement->getFootprintAsString();
+ string strSizeError = "Size should not exceed " + pSubsystemObjectCreator->getMaxConfigurableElementSize();
getMappingError(strError, strKey, strSizeError, pInstanceConfigurableElement);
@@ -293,11 +293,11 @@ bool CSubsystem::handleSubsystemObjectCreation(CInstanceConfigurableElement* pIn
// Generic error handling from derived subsystem classes
void CSubsystem::getMappingError(string& strError, const string& strKey, const string& strMessage, const CInstanceConfigurableElement* pInstanceConfigurableElement)
{
- strError = getName() + " " + getKind() + " mapping:\n" + strKey + " error : \"" + strMessage + "\" for element " + pInstanceConfigurableElement->getPath();
+ strError = getName() + " " + getKind() + " mapping:\n" + strKey + " error: \"" + strMessage + "\" for element " + pInstanceConfigurableElement->getPath();
}
// From IMapper
-bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, string& strError)
+bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, bool& bKeepDiving, string& strError)
{
// Get current context
CMappingContext context = _contextStack.top();
@@ -310,27 +310,34 @@ bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableEle
return false;
}
- break;
+
+ // Push context
+ _contextStack.push(context);
+
+ // Keep diving
+ bKeepDiving = true;
+
+ return true;
+
case CInstanceConfigurableElement::EParameterBlock:
case CInstanceConfigurableElement::EBitParameterBlock:
case CInstanceConfigurableElement::EParameter:
case CInstanceConfigurableElement::EStringParameter:
- {
+
if (!handleSubsystemObjectCreation(pInstanceConfigurableElement, context, strError)) {
return false;
}
- break;
- }
+
+ // Done
+ bKeepDiving = false;
+
+ return true;
+
default:
assert(0);
return false;
}
-
- // Push context
- _contextStack.push(context);
-
- return true;
}
void CSubsystem::mapEnd()