summaryrefslogtreecommitdiffstats
path: root/parameter/Subsystem.cpp
diff options
context:
space:
mode:
authorRenaud de Chivre <renaud.de.chivre@intel.com>2013-09-02 10:48:36 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:10 +0100
commit46966e050fdd1ae48c7692ae9818762ba262e781 (patch)
treeecee4e54006b6141af35033a1db2371f405a2335 /parameter/Subsystem.cpp
parentd55f586c54d9a0c22b27f775ec906e5595bf56d4 (diff)
downloadexternal_parameter-framework-46966e050fdd1ae48c7692ae9818762ba262e781.zip
external_parameter-framework-46966e050fdd1ae48c7692ae9818762ba262e781.tar.gz
external_parameter-framework-46966e050fdd1ae48c7692ae9818762ba262e781.tar.bz2
Handle key names in mapping context
BZ: 126002 Mapping context only allows to retrieve a mapping value from its corresponding key ID. We also want to do the same using its key as a string. This patch adds key name handling in context mapping. It also adds an API to retieve a mapping value from its corresponding key name. Note: it also removes an unused argument from handleMappingContext function. Change-Id: I5a18ad624a69272ea2796090692f2bfa8b373a52 Signed-off-by: Renaud de Chivre <renaud.de.chivre@intel.com> Reviewed-on: http://android.intel.com:8080/131571 Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'parameter/Subsystem.cpp')
-rw-r--r--parameter/Subsystem.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp
index c776065..221b27a 100644
--- a/parameter/Subsystem.cpp
+++ b/parameter/Subsystem.cpp
@@ -335,21 +335,20 @@ const
// Mapping generic context handling
bool CSubsystem::handleMappingContext(
const CInstanceConfigurableElement* pInstanceConfigurableElement,
- const vector<string>& contextMappingKeyArray,
CMappingContext& context,
string& strError) const
{
// Feed context with found mapping data
uint32_t uiItem;
- for (uiItem = 0; uiItem < contextMappingKeyArray.size(); uiItem++) {
+ for (uiItem = 0; uiItem < _contextMappingKeyArray.size(); uiItem++) {
- string strKey = contextMappingKeyArray[uiItem];
+ const string& strKey = _contextMappingKeyArray[uiItem];
const string* pStrValue;
if (pInstanceConfigurableElement->getMappingData(strKey, pStrValue)) {
// Assign item to context
- if (!context.setItem(uiItem, pStrValue)) {
+ if (!context.setItem(uiItem, &strKey, pStrValue)) {
strError = getMappingError(strKey, "Already set", pInstanceConfigurableElement);
@@ -438,7 +437,7 @@ bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableEle
CMappingContext context = _contextStack.top();
// Add mapping in context
- if (!handleMappingContext(pInstanceConfigurableElement, _contextMappingKeyArray, context,
+ if (!handleMappingContext(pInstanceConfigurableElement, context,
strError)) {
return false;