diff options
Diffstat (limited to 'parameter/ConfigurableDomain.cpp')
-rw-r--r-- | parameter/ConfigurableDomain.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index 01e4a69..8c83f48 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -420,6 +420,23 @@ bool CConfigurableDomain::split(CConfigurableElement* pConfigurableElement, stri return true; } +// Check if there is a pending configuration for this domain: i.e. an applicable configuration different from the last applied configuration +const CDomainConfiguration* CConfigurableDomain::getPendingConfiguration() const +{ + const CDomainConfiguration* pApplicableDomainConfiguration = findApplicableDomainConfiguration(); + + if (pApplicableDomainConfiguration) { + + // Check not the last one before applying + if (!_pLastAppliedConfiguration || (_pLastAppliedConfiguration != pApplicableDomainConfiguration)) { + + return pApplicableDomainConfiguration; + } + } + + return NULL; +} + // Configuration application if required bool CConfigurableDomain::apply(CParameterBlackboard* pParameterBlackboard, CSyncerSet& syncerSet, bool bForce, string& strError) const { @@ -707,6 +724,18 @@ string CConfigurableDomain::getLastAppliedConfigurationName() const return "<none>"; } +// Pending configuration +string CConfigurableDomain::getPendingConfigurationName() const +{ + const CDomainConfiguration* pPendingConfiguration = getPendingConfiguration(); + + if (pPendingConfiguration) { + + return pPendingConfiguration->getName(); + } + return "<none>"; +} + // Ensure validity on whole domain from main blackboard void CConfigurableDomain::validate(const CParameterBlackboard* pMainBlackboard) { |