diff options
author | David Wagner <david.wagner@intel.com> | 2014-03-05 10:55:15 +0100 |
---|---|---|
committer | Mattijs Korpershoek <mattijsx.korpershoek@intel.com> | 2014-06-24 11:51:18 +0200 |
commit | 01c7495e66caea59165316bc025a69cce1383311 (patch) | |
tree | f7a7b1732f69dfd118f4dc0dc0021eb2b0d13bff /parameter/Subsystem.h | |
parent | c4dd2ae2f070333da2917a93e30b3557caa38760 (diff) | |
download | external_parameter-framework-01c7495e66caea59165316bc025a69cce1383311.zip external_parameter-framework-01c7495e66caea59165316bc025a69cce1383311.tar.gz external_parameter-framework-01c7495e66caea59165316bc025a69cce1383311.tar.bz2 |
Support context mapping at Subsystem level
BZ: 176942
Add a class (ConfigurableMappingElement) handling the mapping; to be derived by
all classes that can contain mapping. ConfigurableMappingElement derives from
ConfigurableElement. Until now, the only child of ConfigurableElement that
could have mapping was InstanceConfigurableElement (through TypeElement, that
contains all information related to its type).
Now, both InstanceConfigurableElement and Subsystem derive from
ConfigurableMappingElement. That way, Subsystem XML elements can now have a
"Mapping" attribute, propagated to all Elements in the tree. The Subsystem.xsd
schema is updated in that regard.
Only context mapping is relevant at the Subsystem-level (as opposed to
instantiation mapping). If an instantiation mapping is set in the Subsystem,
it is silently ignored.
Change-Id: I3c09959bc5e3d18c5a4d354e498d69cc5489a247
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Mattijs Korpershoek <mattijsx.korpershoek@intel.com>
Diffstat (limited to 'parameter/Subsystem.h')
-rw-r--r-- | parameter/Subsystem.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/parameter/Subsystem.h b/parameter/Subsystem.h index 6b15181..a03a2ef 100644 --- a/parameter/Subsystem.h +++ b/parameter/Subsystem.h @@ -30,6 +30,7 @@ #pragma once #include "ConfigurableElement.h" +#include "ConfigurableElementWithMapping.h" #include "Mapper.h" #include "MappingContext.h" #include <stack> @@ -40,8 +41,9 @@ class CComponentLibrary; class CSubsystemObject; class CSubsystemObjectCreator; class CInstanceConfigurableElement; +class CMappingData; -class CSubsystem : public CConfigurableElement, private IMapper +class CSubsystem : public CConfigurableElementWithMapping, private IMapper { // Subsystem objects iterator typedef list<CSubsystemObject*>::const_iterator SubsystemObjectListIterator; @@ -67,6 +69,8 @@ public: // from CElement virtual string getKind() const; + virtual bool getMappingData(const std::string& strKey, const std::string*& pStrValue) const; + /** * Fetch mapping data of an element. * @@ -130,13 +134,14 @@ private: * * @param[in] strKey The key on which the error refers * @param[in] strMessage The error message - * @param[in] pInstanceConfigurableElement The element on wich the error refers + * @param[in] pConfigurableElementWithMapping The element on which the error refers * * returns The formated error string */ - string getMappingError(const string& strKey, - const string& strMessage, - const CInstanceConfigurableElement* pInstanceConfigurableElement) const; + string getMappingError( + const string& strKey, + const string& strMessage, + const CConfigurableElementWithMapping* pConfigurableElementWithMapping) const; /** * Format the mapping data of the ConfigurableElements that have been gathered through recursive @@ -193,15 +198,16 @@ private: * * Feed context with mapping data of the current element * - * @param[in] pInstanceConfigurableElement The element containing mapping data + * @param[in] pConfigurableElementWithMapping The element containing mapping data * @param[out] context The context mapping to update with the current element mapping values * @param[out] strError The formated error string * * @return true on success */ - bool handleMappingContext(const CInstanceConfigurableElement* pInstanceConfigurableElement, - CMappingContext& context, - string& strError) const; + bool handleMappingContext( + const CConfigurableElementWithMapping* pConfigurableElementWithMapping, + CMappingContext& context, + string& strError) const; /** * Looks if a subsystem object needs to be instantiated for the given configurable @@ -239,4 +245,7 @@ private: // Endianness bool _bBigEndian; + + //! Contains the mapping info at Subsystem level + CMappingData* _pMappingData; }; |