aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--.gitignore3
-rw-r--r--parameter/InstanceConfigurableElement.cpp9
-rw-r--r--parameter/Mapper.h2
-rw-r--r--parameter/Subsystem.cpp33
-rw-r--r--parameter/Subsystem.h2
-rw-r--r--xmlparser-test/Android.mk2
-rw-r--r--xmlserializer/Android.mk3
7 files changed, 34 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index a3f55cc..b8a77d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*.win
-*.layout \ No newline at end of file
+*.layout
+*.user
diff --git a/parameter/InstanceConfigurableElement.cpp b/parameter/InstanceConfigurableElement.cpp
index f35be87..6d6526e 100644
--- a/parameter/InstanceConfigurableElement.cpp
+++ b/parameter/InstanceConfigurableElement.cpp
@@ -68,10 +68,17 @@ bool CInstanceConfigurableElement::map(IMapper& mapper, string& strError)
// Begin
if (bHasMappingData) {
- if (!mapper.mapBegin(this, strError)) {
+ bool bKeepDiving;
+
+ if (!mapper.mapBegin(this, bKeepDiving, strError)) {
return false;
}
+ // Go on through children?
+ if (!bKeepDiving) {
+
+ return true;
+ }
}
// Map children
diff --git a/parameter/Mapper.h b/parameter/Mapper.h
index 4f32ca8..ab5f488 100644
--- a/parameter/Mapper.h
+++ b/parameter/Mapper.h
@@ -39,6 +39,6 @@ class CInstanceConfigurableElement;
class IMapper
{
public:
- virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, string& strError) = 0;
+ virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, bool& bKeepDiving, string& strError) = 0;
virtual void mapEnd() = 0;
};
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()
diff --git a/parameter/Subsystem.h b/parameter/Subsystem.h
index f0ddc57..12f6ed0 100644
--- a/parameter/Subsystem.h
+++ b/parameter/Subsystem.h
@@ -84,7 +84,7 @@ private:
void getMappingError(string& strError, const string& strKey, const string& strMessage, const CInstanceConfigurableElement* pInstanceConfigurableElement);
// From IMapper
- virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, string& strError);
+ virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, bool& bKeepDiving, string& strError);
virtual void mapEnd();
// Mapping generic context handling
diff --git a/xmlparser-test/Android.mk b/xmlparser-test/Android.mk
index ea1172d..ccb867d 100644
--- a/xmlparser-test/Android.mk
+++ b/xmlparser-test/Android.mk
@@ -18,7 +18,7 @@ TARGET_ERROR_FLAGS += -Wno-non-virtual-dtor
LOCAL_C_INCLUDES += \
external/stlport/stlport/ \
external/libxml2/include/ \
- external/webkit/WebCore/icu/ \
+ external/webkit/Source/WebCore/icu/ \
bionic/libstdc++ \
bionic/
diff --git a/xmlserializer/Android.mk b/xmlserializer/Android.mk
index e45f1b1..7aa4e74 100644
--- a/xmlserializer/Android.mk
+++ b/xmlserializer/Android.mk
@@ -22,9 +22,8 @@ LOCAL_C_INCLUDES +=
LOCAL_C_INCLUDES += \
external/stlport/stlport/ \
external/libxml2/include/ \
- external/webkit/WebCore/icu/ \
+ external/webkit/Source/WebCore/icu/ \
bionic/libstdc++ \
- external/icu4c/common \
bionic/
LOCAL_C_INCLUDES +=