summaryrefslogtreecommitdiffstats
path: root/parameter/Parameter.cpp
diff options
context:
space:
mode:
authorPatrick Benavoli <patrickx.benavoli@intel.com>2011-08-31 11:23:24 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-10 17:14:53 +0100
commit2ecf900ad8c30ce9f8e81f57977a1a80a6f6d8af (patch)
tree30a4b54da922580eefa34963585116657c2816fc /parameter/Parameter.cpp
parent6ba361d96bc2581667b3400f87ff89fae6449e1f (diff)
downloadexternal_parameter-framework-2ecf900ad8c30ce9f8e81f57977a1a80a6f6d8af.zip
external_parameter-framework-2ecf900ad8c30ce9f8e81f57977a1a80a6f6d8af.tar.gz
external_parameter-framework-2ecf900ad8c30ce9f8e81f57977a1a80a6f6d8af.tar.bz2
Parameter Framework: Parameter property display
BZ: 7137 Added showProperties remote command Changed EQU to MONO_EQ for CAPTURE paths in LPE Subsystem structure definition Had to create a generic class for Parameter and BitParameter classes Change-Id: If6ab97ff002d8ba81df5a4a60bc3eb07dbe14e5e Orig-Change-Id: I425f81cd414b1c721f5c11169e9a489f5c638ab9 Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com> Reviewed-on: http://android.intel.com:8080/16879 Reviewed-by: Mahe, Erwan <erwan.mahe@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/Parameter.cpp')
-rw-r--r--parameter/Parameter.cpp103
1 files changed, 5 insertions, 98 deletions
diff --git a/parameter/Parameter.cpp b/parameter/Parameter.cpp
index 57a78b1..70865ad 100644
--- a/parameter/Parameter.cpp
+++ b/parameter/Parameter.cpp
@@ -34,16 +34,12 @@
#include "ConfigurationAccessContext.h"
#include "ParameterBlackboard.h"
-#define base CInstanceConfigurableElement
+#define base CBaseParameter
CParameter::CParameter(const string& strName, const CTypeElement* pTypeElement) : base(strName, pTypeElement)
{
}
-CParameter::~CParameter()
-{
-}
-
CInstanceConfigurableElement::Type CParameter::getType() const
{
return EParameter;
@@ -55,32 +51,11 @@ bool CParameter::serializeXmlSettings(CXmlElement& xmlConfigurationSettingsEleme
// Check for value space
handleValueSpaceAttribute(xmlConfigurationSettingsElementContent, configurationAccessContext);
- // Handle access
- if (!configurationAccessContext.serializeOut()) {
-
- // Write to blackboard
- if (!doSetValue(xmlConfigurationSettingsElementContent.getTextContent(), getOffset() - configurationAccessContext.getBaseOffset(), configurationAccessContext)) {
-
- // Append parameter path to error
- configurationAccessContext.appendToError(" " + getPath());
-
- return false;
- }
- } else {
-
- // Get string value
- string strValue;
-
- doGetValue(strValue, getOffset() - configurationAccessContext.getBaseOffset(), configurationAccessContext);
-
- // Populate value into xml text node
- xmlConfigurationSettingsElementContent.setTextContent(strValue);
- }
-
- // Done
- return true;
+ // Base
+ return base::serializeXmlSettings(xmlConfigurationSettingsElementContent, configurationAccessContext);
}
+
// Value space handling for configuration import
void CParameter::handleValueSpaceAttribute(CXmlElement& xmlConfigurableElementSettingsElement, CConfigurationAccessContext& configurationAccessContext) const
{
@@ -98,18 +73,6 @@ uint32_t CParameter::getSize() const
return static_cast<const CParameterType*>(getTypeElement())->getSize();
}
-// Dump
-void CParameter::logValue(string& strValue, CErrorContext& errorContext) const
-{
- CParameterAccessContext& parameterContext = static_cast<CParameterAccessContext&>(errorContext);
-
- // Dump value
- doGetValue(strValue, getOffset(), parameterContext);
-
- // Prepend unit if any
- prependUnit(strValue);
-}
-
// Used for simulation only
void CParameter::setDefaultValues(CParameterAccessContext& parameterAccessContext) const
{
@@ -123,63 +86,7 @@ void CParameter::setDefaultValues(CParameterAccessContext& parameterAccessContex
pBlackboard->write(&uiDefaultValue, getSize(), getOffset(), parameterAccessContext.isBigEndianSubsystem());
}
-// Unit
-void CParameter::prependUnit(string& strValue) const
-{
- string strUnit = static_cast<const CParameterType*>(getTypeElement())->getUnit();
-
- if (!strUnit.empty()) {
-
- strValue = "(" + strUnit + ") " + strValue;
- }
-}
-
-// Parameter Access
-bool CParameter::setValue(CPathNavigator& pathNavigator, const string& strValue, CErrorContext& errorContext) const
-{
- // Check path validity
- if (!checkPathExhausted(pathNavigator, errorContext)) {
-
- return false;
- }
- // Parameter context
- CParameterAccessContext& parameterContext = static_cast<CParameterAccessContext&>(errorContext);
-
- // Set Value
- if (!doSetValue(strValue, getOffset(), parameterContext)) {
-
- // Append parameter path to error
- parameterContext.appendToError(" " + getPath());
-
- return false;
- }
- // Synchronize
- if (parameterContext.getAutoSync() && !sync(parameterContext)) {
-
- // Append parameter path to error
- parameterContext.appendToError(" " + getPath());
-
- return false;
- }
- return true;
-}
-
-bool CParameter::getValue(CPathNavigator& pathNavigator, string& strValue, CErrorContext& errorContext) const
-{
- // Check path validity
- if (!checkPathExhausted(pathNavigator, errorContext)) {
-
- return false;
- }
- // Parameter context
- CParameterAccessContext& parameterContext = static_cast<CParameterAccessContext&>(errorContext);
-
- // Get Value
- doGetValue(strValue, getOffset(), parameterContext);
-
- return true;
-}
-
+// Actual parameter access
bool CParameter::doSetValue(const string& strValue, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const
{
uint32_t uiData;