PFW: Parameter bloc can handle any mapping depth
BZ: 85878
Needed for subsystem object definition enhancement.
In a PFW structure file, if a parameter bloc is defined in another
parameter bloc with context mapping only (no instanciable mapping),
the PFW will no longer stop diving on the first parameter bloc.
Change-Id: If4f704f01e20eb348d931c0baab1b85936fc75a4
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/88959
Reviewed-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: Boisnard, FredericX <fredericx.boisnard@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/parameter/InstanceConfigurableElement.cpp b/parameter/InstanceConfigurableElement.cpp
index 6795f8b..4a6cacc 100644
--- a/parameter/InstanceConfigurableElement.cpp
+++ b/parameter/InstanceConfigurableElement.cpp
@@ -58,34 +58,29 @@
bool CInstanceConfigurableElement::map(IMapper& mapper, string& strError)
{
bool bHasMappingData = getTypeElement()->hasMappingData();
+ bool bKeepDiving = true;
// Begin
- if (bHasMappingData) {
+ if (bHasMappingData && !mapper.mapBegin(this, bKeepDiving, strError)) {
- bool bKeepDiving;
-
- if (!mapper.mapBegin(this, bKeepDiving, strError)) {
-
- return false;
- }
- // Go on through children?
- if (!bKeepDiving) {
-
- return true;
- }
+ return false;
}
- // Map children
- uint32_t uiNbChildren = getNbChildren();
- uint32_t uiChild;
+ // Go on through children?
+ if (bKeepDiving) {
- for (uiChild = 0; uiChild < uiNbChildren; uiChild++) {
+ // Map children
+ uint32_t uiNbChildren = getNbChildren();
+ uint32_t uiChild;
- CInstanceConfigurableElement* pInstanceConfigurableChildElement = static_cast<CInstanceConfigurableElement*>(getChild(uiChild));
+ for (uiChild = 0; uiChild < uiNbChildren; uiChild++) {
- if (!pInstanceConfigurableChildElement->map(mapper, strError)) {
+ CInstanceConfigurableElement* pInstanceConfigurableChildElement = static_cast<CInstanceConfigurableElement*>(getChild(uiChild));
- return false;
+ if (!pInstanceConfigurableChildElement->map(mapper, strError)) {
+
+ return false;
+ }
}
}