diff options
Diffstat (limited to 'parameter/SelectionCriterion.cpp')
-rw-r--r-- | parameter/SelectionCriterion.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/parameter/SelectionCriterion.cpp b/parameter/SelectionCriterion.cpp index 7f2809a..453f244 100644 --- a/parameter/SelectionCriterion.cpp +++ b/parameter/SelectionCriterion.cpp @@ -27,7 +27,7 @@ #define base CElement -CSelectionCriterion::CSelectionCriterion(const string& strName, const CSelectionCriterionType* pType) : base(strName), _iState(0), _pType(pType) +CSelectionCriterion::CSelectionCriterion(const string& strName, const CSelectionCriterionType* pType) : base(strName), _iState(0), _pType(pType), _uiNbModifications(0) { } @@ -36,6 +36,16 @@ string CSelectionCriterion::getKind() const return "SelectionCriterion"; } +bool CSelectionCriterion::hasBeenModified() const +{ + return _uiNbModifications != 0; +} + +void CSelectionCriterion::resetModifiedStatus() +{ + _uiNbModifications = 0; +} + /// From ISelectionCriterionInterface // State void CSelectionCriterion::setCriterionState(int iState) @@ -46,6 +56,16 @@ void CSelectionCriterion::setCriterionState(int iState) _iState = iState; log("Selection criterion changed event: %s", getFormattedDescription(false).c_str()); + + // Check if the previous criterion value has been taken into account (i.e. at least one Configuration was applied + // since the last criterion change) + if (_uiNbModifications > 0) { + + log("Warning: Selection criterion \"%s\" has been modified %d time(s) without any configuration application", getName().c_str(), _uiNbModifications); + } + + // Track the number of modifications for this criterion + _uiNbModifications++; } } |