summaryrefslogtreecommitdiffstats
path: root/parameter/SubsystemObject.h
diff options
context:
space:
mode:
authorGuillaume Denneulin <guillaume.denneulin@intel.com>2014-01-10 14:58:42 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:19 +0100
commita6b01d2049a137932f303cdee554d8d2703d7af7 (patch)
tree1babc313169e1299f8e98d741df88046a12567dd /parameter/SubsystemObject.h
parent28119d8ec7d49b5fab310f08e6fc40c910e3bc8a (diff)
downloadexternal_parameter-framework-a6b01d2049a137932f303cdee554d8d2703d7af7.zip
external_parameter-framework-a6b01d2049a137932f303cdee554d8d2703d7af7.tar.gz
external_parameter-framework-a6b01d2049a137932f303cdee554d8d2703d7af7.tar.bz2
Add integer conversion that can take care of sign extension
BZ: 163707 When using signed integers of size 8 or 16, the bit of sign needs to be propagated if the API called by the plugin wait for "int" type Add the virtual toInteger function in CTypeElement for each parameter type to take care of conversion to "int". Specialize this function in the class CIntegerParameterType to take care of sign extension. Change-Id: I41183dccbcc21212299d1dde86b3ad4ba8432ce4 Signed-off-by: Guillaume Denneulin <guillaume.denneulin@intel.com>
Diffstat (limited to 'parameter/SubsystemObject.h')
-rwxr-xr-x[-rw-r--r--]parameter/SubsystemObject.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/parameter/SubsystemObject.h b/parameter/SubsystemObject.h
index ca52df8..1c6690d 100644..100755
--- a/parameter/SubsystemObject.h
+++ b/parameter/SubsystemObject.h
@@ -56,6 +56,17 @@ protected:
static uint32_t asInteger(const string& strValue);
static string asString(uint32_t uiValue);
+ /**
+ * Conversion of int8, int16, int32 to int (taking care of sign extension)
+ *
+ * @param[in] instanceConfigurableElement pointer to configurable element instance
+ * @param[in] sizeOptimizedData data to convert
+ *
+ * @return the data converted to int
+ */
+ int toPlainInteger(const CInstanceConfigurableElement *instanceConfigurableElement,
+ int sizeOptimizedData);
+
// Sync to/from HW
virtual bool sendToHW(string& strError);
virtual bool receiveFromHW(string& strError);