diff options
author | Kevin Rocard <kevinx.rocard@intel.com> | 2013-08-07 16:15:33 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:04:05 +0100 |
commit | a7b6960cb51b289f6e24a8c494f1a0683d91dcbe (patch) | |
tree | c51a4b26a35ad906827534af93fa03f31d9c758e /parameter/ElementLibrary.h | |
parent | d5679acf4b38db415bd25b0c3664d69cec5f43d4 (diff) | |
download | external_parameter-framework-a7b6960cb51b289f6e24a8c494f1a0683d91dcbe.zip external_parameter-framework-a7b6960cb51b289f6e24a8c494f1a0683d91dcbe.tar.gz external_parameter-framework-a7b6960cb51b289f6e24a8c494f1a0683d91dcbe.tar.bz2 |
Change the element builder semantic
BZ: 122982
To parse XML, the PFW uses factories containing a map of XML tags and
their associated builder builder. The builders used to contain the XML
tag of the XML element that it will use in the context of the factory.
A builder and an XML tag are already linked by the factory, thus the tag
member in the builder is redundant.
Remove the XML tag builder attribute and provide it on factory filling.
Change-Id: I827c3b34dffb23bc850316d0b092b31c21987ac2
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/124214
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.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/parameter/ElementLibrary.h b/parameter/ElementLibrary.h index 134ef0f..0de6056 100644 --- a/parameter/ElementLibrary.h +++ b/parameter/ElementLibrary.h @@ -35,15 +35,21 @@ class CElementBuilder; class CElementLibrary { - typedef map<string, CElementBuilder*>::iterator ElementBuilderMapIterator; - typedef map<string, CElementBuilder*>::const_iterator ElementBuilderMapConstIterator; + typedef map<string, const CElementBuilder*> ElementBuilderMap; + typedef ElementBuilderMap::iterator ElementBuilderMapIterator; + typedef ElementBuilderMap::const_iterator ElementBuilderMapConstIterator; public: CElementLibrary(); virtual ~CElementLibrary(); - // Filling - void addElementBuilder(CElementBuilder* pElementBuilder); + /** Add a xml tag and it's corresponding builder in the library. + * + * @param[in] xmlTag is the tag of an xml element that can be given to the builder to + * create a new element. + * @param[in] pElementBuilder is the tag associated element builder. + */ + void addElementBuilder(string type, const CElementBuilder *pElementBuilder); void clean(); // Instantiation @@ -54,5 +60,5 @@ private: virtual string getBuilderType(const CXmlElement& xmlElement) const; // Builders - map<string, CElementBuilder*> _elementBuilderMap; + ElementBuilderMap _elementBuilderMap; }; |