summaryrefslogtreecommitdiffstats
path: root/parameter/ElementLibrary.cpp
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2013-07-10 18:45:10 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:06 +0100
commit7f1729aa56b52afad1ac2c390582bdc41145de9e (patch)
treecc17ad64a0a1c3fbb9e081614ea235e0dd599656 /parameter/ElementLibrary.cpp
parenta7b6960cb51b289f6e24a8c494f1a0683d91dcbe (diff)
downloadexternal_parameter-framework-7f1729aa56b52afad1ac2c390582bdc41145de9e.zip
external_parameter-framework-7f1729aa56b52afad1ac2c390582bdc41145de9e.tar.gz
external_parameter-framework-7f1729aa56b52afad1ac2c390582bdc41145de9e.tar.bz2
Add default element fallback
BZ: 122982 The element library class is a factory that receives an xml node and instanciates the corresponding element. In some case, it would be usefull not to fail if no matching builder is found but use a default one. Add a setDefaultElementBuilder method to set the default builder to fallback to, in case no matching builder is found. Change-Id: I58f0ada3450195a3ca7d878e4b666b0a9359b499 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/118042 Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'parameter/ElementLibrary.cpp')
-rw-r--r--parameter/ElementLibrary.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/parameter/ElementLibrary.cpp b/parameter/ElementLibrary.cpp
index 695942a..2945064 100644
--- a/parameter/ElementLibrary.cpp
+++ b/parameter/ElementLibrary.cpp
@@ -57,12 +57,12 @@ CElement* CElementLibrary::createElement(const CXmlElement& xmlElement) const
return NULL;
}
-void CElementLibrary::addElementBuilder(string type, const CElementBuilder *pElementBuilder)
+void CElementLibrary::addElementBuilder(const std::string& type, const CElementBuilder *pElementBuilder)
{
_elementBuilderMap[type] = pElementBuilder;
}
-string CElementLibrary::getBuilderType(const CXmlElement& xmlElement) const
+std::string CElementLibrary::getBuilderType(const CXmlElement& xmlElement) const
{
// Defaulting to xml element name
return xmlElement.getType();