summaryrefslogtreecommitdiffstats
path: root/parameter/ElementLibrary.h
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.h
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.h')
-rw-r--r--parameter/ElementLibrary.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/parameter/ElementLibrary.h b/parameter/ElementLibrary.h
index 0de6056..8f9337e 100644
--- a/parameter/ElementLibrary.h
+++ b/parameter/ElementLibrary.h
@@ -29,13 +29,11 @@
#include "Element.h"
-using namespace std;
-
class CElementBuilder;
class CElementLibrary
{
- typedef map<string, const CElementBuilder*> ElementBuilderMap;
+ typedef std::map<string, const CElementBuilder*> ElementBuilderMap;
typedef ElementBuilderMap::iterator ElementBuilderMapIterator;
typedef ElementBuilderMap::const_iterator ElementBuilderMapConstIterator;
@@ -49,7 +47,7 @@ public:
* create a new element.
* @param[in] pElementBuilder is the tag associated element builder.
*/
- void addElementBuilder(string type, const CElementBuilder *pElementBuilder);
+ void addElementBuilder(const std::string& type, const CElementBuilder *pElementBuilder);
void clean();
// Instantiation
@@ -57,7 +55,7 @@ public:
private:
// Builder type
- virtual string getBuilderType(const CXmlElement& xmlElement) const;
+ virtual std::string getBuilderType(const CXmlElement& xmlElement) const;
// Builders
ElementBuilderMap _elementBuilderMap;