diff options
Diffstat (limited to 'parameter')
-rw-r--r-- | parameter/ConfigurableDomain.cpp | 29 | ||||
-rw-r--r-- | parameter/ConfigurableDomain.h | 15 | ||||
-rw-r--r-- | parameter/ConfigurableDomains.cpp | 2 | ||||
-rw-r--r-- | parameter/ParameterMgr.cpp | 4 |
4 files changed, 44 insertions, 6 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) { diff --git a/parameter/ConfigurableDomain.h b/parameter/ConfigurableDomain.h index ff194c2..29e92cb 100644 --- a/parameter/ConfigurableDomain.h +++ b/parameter/ConfigurableDomain.h @@ -59,9 +59,12 @@ public: bool clearApplicationRule(const string& strConfiguration, string& strError); bool getApplicationRule(const string& strConfiguration, string& strResult) const; - // Last applied configuration + // Last applied configuration name string getLastAppliedConfigurationName() const; + // Pending configuration name + string getPendingConfigurationName() const; + // Associated Configurable elements void gatherConfigurableElements(set<const CConfigurableElement*>& configurableElementSet) const; void listAssociatedToElements(string& strResult) const; @@ -90,10 +93,18 @@ public: // Class kind virtual string getKind() const; + protected: // Content dumping virtual void logValue(string& strValue, CErrorContext& errorContext) const; + private: + // Get pending configuration + const CDomainConfiguration* getPendingConfiguration() const; + + // Search for an applicable configuration + const CDomainConfiguration* findApplicableDomainConfiguration() const; + // Returns true if children dynamic creation is to be dealt with (here, will allow child deletion upon clean) virtual bool childrenAreDynamic() const; @@ -112,8 +123,6 @@ private: // Search for a valid configuration for given configurable element const CDomainConfiguration* findValidDomainConfiguration(const CConfigurableElement* pConfigurableElement) const; - // Search for an applicable configuration - const CDomainConfiguration* findApplicableDomainConfiguration() const; // In case configurable element was removed void computeSyncSet(); diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp index 79bfdac..56693ef 100644 --- a/parameter/ConfigurableDomains.cpp +++ b/parameter/ConfigurableDomains.cpp @@ -481,7 +481,7 @@ void CConfigurableDomains::listLastAppliedConfigurations(string& strResult) cons const CConfigurableDomain* pChildConfigurableDomain = static_cast<const CConfigurableDomain*>(getChild(uiChild)); - strResult += pChildConfigurableDomain->getName() + ": " + pChildConfigurableDomain->getLastAppliedConfigurationName() + "\n"; + strResult += pChildConfigurableDomain->getName() + ": " + pChildConfigurableDomain->getLastAppliedConfigurationName() + " [" + pChildConfigurableDomain->getPendingConfigurationName() + "]\n"; } } diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 14a5b4b..cff2b47 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -678,13 +678,13 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::statusCommandProces strResult += strSubsystemList; /// Last applied configurations - appendTitle(strResult, "Last applied configurations:"); + appendTitle(strResult, "Last Applied [Pending] Configurations:"); string strLastAppliedConfigurations; getConfigurableDomains()->listLastAppliedConfigurations(strLastAppliedConfigurations); strResult += strLastAppliedConfigurations; /// Criteria states - appendTitle(strResult, "Selection criteria:"); + appendTitle(strResult, "Selection Criteria:"); string strSelectionCriteria; getSelectionCriteria()->listSelectionCriteria(strSelectionCriteria, false); strResult += strSelectionCriteria; |