diff options
author | David Wagner <david.wagner@intel.com> | 2014-12-10 14:49:23 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2015-01-22 11:53:52 +0100 |
commit | d8a53107d5f965c8ca406ee95f5999efd6694730 (patch) | |
tree | 26656386d16a6f260fb1ecc79ce20e6e96f595f3 /parameter/ConfigurableDomain.cpp | |
parent | 29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b (diff) | |
download | external_parameter-framework-d8a53107d5f965c8ca406ee95f5999efd6694730.zip external_parameter-framework-d8a53107d5f965c8ca406ee95f5999efd6694730.tar.gz external_parameter-framework-d8a53107d5f965c8ca406ee95f5999efd6694730.tar.bz2 |
Pass the SystemClass as deserialization context for Domains
This allows diminishing the dependency on the parent element when creating a
Domain element from an XML document: the parent was used to get a handle to the
system class in order to check the existence of ConfigurableElements included
in the Domain.
Change-Id: Icba7c3c4db2b9728c0fb7c6840a254de9775f6a4
Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'parameter/ConfigurableDomain.cpp')
-rw-r--r-- | parameter/ConfigurableDomain.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index c3fa1f9..bdcddd4 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -253,12 +253,7 @@ bool CConfigurableDomain::parseDomainConfigurations(const CXmlElement& xmlElemen bool CConfigurableDomain::parseConfigurableElements(const CXmlElement& xmlElement, CXmlDomainImportContext& serializingContext) { - // Get System Class Element - CElement* pRootElement = getRoot(); - - CElement* pSystemClassElement = pRootElement->findChildOfKind("SystemClass"); - - assert(pSystemClassElement); + CSystemClass& systemClass = serializingContext.getSystemClass(); // Get ConfigurableElements element CXmlElement xmlConfigurableElementsElement; @@ -278,14 +273,15 @@ bool CConfigurableDomain::parseConfigurableElements(const CXmlElement& xmlElemen string strError; // Is there an element and does it match system class name? - if (!pathNavigator.navigateThrough(pSystemClassElement->getName(), strError)) { + if (!pathNavigator.navigateThrough(systemClass.getName(), strError)) { serializingContext.setError("Could not find configurable element of path " + strConfigurableElementPath + " from ConfigurableDomain description " + getName() + " (" + strError + ")"); return false; } // Browse system class for configurable element - CConfigurableElement* pConfigurableElement = static_cast<CConfigurableElement*>(pSystemClassElement->findDescendant(pathNavigator)); + CConfigurableElement* pConfigurableElement = + static_cast<CConfigurableElement*>(systemClass.findDescendant(pathNavigator)); if (!pConfigurableElement) { |