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>
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 @@
}
// 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 @@
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 @@
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 @@
}
}
+// 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 @@
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