summaryrefslogtreecommitdiffstats
path: root/parameter/SelectionCriterionType.h
diff options
context:
space:
mode:
authorFrancois Gaffie <francois.gaffie@intel.com>2013-10-15 11:01:23 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:14 +0100
commita0c3b8a42e473fa96ec469c2e691a919f31df26d (patch)
treea962dce8a7fad4e753b81cb5d5a378a541ae86fa /parameter/SelectionCriterionType.h
parentff574884b80ca5e96960565ada430d8207951b31 (diff)
downloadexternal_parameter-framework-a0c3b8a42e473fa96ec469c2e691a919f31df26d.zip
external_parameter-framework-a0c3b8a42e473fa96ec469c2e691a919f31df26d.tar.gz
external_parameter-framework-a0c3b8a42e473fa96ec469c2e691a919f31df26d.tar.bz2
Adds default value pair for inclusive criterion
BZ: 99956 Inclusive criterion type does not allow to check if the bitfield is empty, i.e., if zero is not available. This patch adds the default value pair "none, 0" to allow check either if the criterion "Is" 0, and establishes consistency with inclusion rule. It also allows to convert a concatenated chain of string value, where "|" is considered as AND rule into the corresponding numerical value. Change-Id: I4ee7c0f69228a727964ab80050ac12c6babd4f58 Signed-off-by: Francois Gaffie <francois.gaffie@intel.com> Signed-off-by: Jorge Quintero <jorge.quintero@intel.com> Reviewed-on: http://android.intel.com:8080/138518 Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Diffstat (limited to 'parameter/SelectionCriterionType.h')
-rw-r--r--parameter/SelectionCriterionType.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/parameter/SelectionCriterionType.h b/parameter/SelectionCriterionType.h
index bff11c5..bc96750 100644
--- a/parameter/SelectionCriterionType.h
+++ b/parameter/SelectionCriterionType.h
@@ -38,6 +38,16 @@ public:
// From ISelectionCriterionTypeInterface
virtual bool addValuePair(int iValue, const string& strValue);
+ /**
+ * Retrieve the numerical value from the string representation of the criterion type.
+ *
+ * @param[in] strValue: criterion type value represented as a stream. If the criterion is
+ * inclusive, it supports more than one criterion type value delimited
+ * by the "|" symbol.
+ * @param[out] iValue: criterion type value represented as an integer.
+ *
+ * @return true if integer value retrieved from the string one, false otherwise.
+ */
virtual bool getNumericalValue(const string& strValue, int& iValue) const;
virtual bool getLiteralValue(int iValue, string& strValue) const;
virtual bool isTypeInclusive() const;
@@ -51,8 +61,19 @@ public:
// From CElement
virtual string getKind() const;
private:
-
+ /**
+ * Retrieve the numerical value from the string representation of the criterion type.
+ *
+ * @param[in] strValue: criterion type value represented as a stream. If the criterion is
+ * inclusive, it expects only one criterion type value.
+ * @param[out] iValue: criterion type value represented as an integer.
+ *
+ * @return true if integer value retrieved from the string one, false otherwise.
+ */
+ bool getAtomicNumericalValue(const string& strValue, int& iValue) const;
bool _bInclusive;
map<string, int> _numToLitMap;
+
+ static const std::string _strDelimiter; /**< Inclusive criterion type delimiter. */
};