summaryrefslogtreecommitdiffstats
path: root/parameter/MappingContext.h
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/MappingContext.h
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/MappingContext.h')
-rw-r--r--parameter/MappingContext.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/parameter/MappingContext.h b/parameter/MappingContext.h
index 47a4ead..385ed9b 100644
--- a/parameter/MappingContext.h
+++ b/parameter/MappingContext.h
@@ -33,6 +33,7 @@ class CMappingContext
{
// Item structure
struct SItem {
+ const string* strKey;
const string* strItem;
bool bSet;
};
@@ -49,10 +50,28 @@ public:
CMappingContext& operator=(const CMappingContext& right);
// Item access
- bool setItem(uint32_t uiItemType, const string* pStrItem);
+ /**
+ * Set context mapping item key and value.
+ *
+ * @param[in] uiItemType Mapping item index.
+ * @param[in] pStrKey Mapping item key name.
+ * @param[in] pStrItem Mapping item value.
+ *
+ * @return False if already set, true else.
+ */
+ bool setItem(uint32_t uiItemType, const string* pStrKey, const string* pStrItem);
const string& getItem(uint32_t uiItemType) const;
uint32_t getItemAsInteger(uint32_t uiItemType) const;
+ /**
+ * Get mapping item value from its key name.
+ *
+ * @param[in] strKey Mapping item key name.
+ *
+ * @return Mapping item value pointer if found, NULL else.
+ */
+ const string* getItem(const string& strKey) const;
bool iSet(uint32_t uiItemType) const;
+
private:
// Item array
SItem* _pstItemArray;