aboutsummaryrefslogtreecommitdiffstats
path: root/parameter/ConfigurableElement.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/ConfigurableElement.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/ConfigurableElement.cpp')
-rw-r--r--parameter/ConfigurableElement.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/parameter/ConfigurableElement.cpp b/parameter/ConfigurableElement.cpp
index 2fcde7a..f439ebf 100644
--- a/parameter/ConfigurableElement.cpp
+++ b/parameter/ConfigurableElement.cpp
@@ -34,7 +34,6 @@
#include "ConfigurableDomain.h"
#include "ConfigurationAccessContext.h"
#include "ConfigurableElementAggregator.h"
-#include <sstream>
#include <assert.h>
#define base CElement
@@ -128,13 +127,13 @@ bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurationSet
}
// Parameter access
-bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string& strValue, CErrorContext& errorContext) const
+bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string& strValue, CParameterAccessContext& parameterContext) const
{
string* pStrChildName = pathNavigator.next();
if (!pStrChildName) {
- errorContext.setError("Non settable element");
+ parameterContext.setError("Non settable element");
return false;
}
@@ -143,21 +142,21 @@ bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string&
if (!pChild) {
- errorContext.setError("Path not found: " + pathNavigator.getCurrentPath());
+ parameterContext.setError("Path not found: " + pathNavigator.getCurrentPath());
return false;
}
- return pChild->setValue(pathNavigator, strValue, errorContext);
+ return pChild->setValue(pathNavigator, strValue, parameterContext);
}
-bool CConfigurableElement::getValue(CPathNavigator& pathNavigator, string& strValue, CErrorContext& errorContext) const
+bool CConfigurableElement::getValue(CPathNavigator& pathNavigator, string& strValue, CParameterAccessContext& parameterContext) const
{
string* pStrChildName = pathNavigator.next();
if (!pStrChildName) {
- errorContext.setError("Non gettable element");
+ parameterContext.setError("Non gettable element");
return false;
}
@@ -166,12 +165,12 @@ bool CConfigurableElement::getValue(CPathNavigator& pathNavigator, string& strVa
if (!pChild) {
- errorContext.setError("Path not found: " + pathNavigator.getCurrentPath());
+ parameterContext.setError("Path not found: " + pathNavigator.getCurrentPath());
return false;
}
- return pChild->getValue(pathNavigator, strValue, errorContext);
+ return pChild->getValue(pathNavigator, strValue, parameterContext);
}
// Used for simulation only
@@ -189,6 +188,14 @@ void CConfigurableElement::setDefaultValues(CParameterAccessContext& parameterAc
}
}
+// Element properties
+void CConfigurableElement::showProperties(string& strResult) const
+{
+ base::showProperties(strResult);
+
+ strResult += "Total size: " + getFootprintAsString() + "\n";
+}
+
// Offset
void CConfigurableElement::setOffset(uint32_t uiOffset)
{
@@ -350,11 +357,7 @@ void CConfigurableElement::listRogueElements(string& strResult) const
string CConfigurableElement::getFootprintAsString() const
{
// Get size as string
- ostringstream str;
-
- str << getFootPrint() << " bytes";
-
- return str.str();
+ return toString(getFootPrint()) + " byte(s)";
}
// Matching check for no domain association