From a7b6960cb51b289f6e24a8c494f1a0683d91dcbe Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 7 Aug 2013 16:15:33 +0200 Subject: 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 Reviewed-on: http://android.intel.com:8080/124214 Reviewed-by: Centelles, Sylvain Tested-by: Barthes, FabienX Reviewed-by: cactus Tested-by: cactus --- parameter/ElementLibrary.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'parameter/ElementLibrary.h') 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::iterator ElementBuilderMapIterator; - typedef map::const_iterator ElementBuilderMapConstIterator; + typedef map 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 _elementBuilderMap; + ElementBuilderMap _elementBuilderMap; }; -- cgit v1.1