From d39b189e045353199ad852aaf2816c93864c7e88 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 6 Jan 2015 14:52:49 +0100 Subject: ParameterMgr: Add more tuning methods to the C++ public API These methods are: - renameDomain - setSequenceAwareness - getSequenceAwareness - renameConfiguration - setElementSequence - setApplicationRule - getApplicationRule - clearApplicationRule The "remote tuning" methods are also modified to use them instead of directly accessing inner objects and the tuning mode checking is moved to the public C++ method when applicable. Change-Id: I9cdd0abbacb76232cd746878dca9ab619e8b6b58 Signed-off-by: David Wagner --- parameter/ParameterMgr.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'parameter/ParameterMgr.h') diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 7962294..fcba462 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -221,10 +221,17 @@ public: ////////// Configuration/Domains handling ////////////// // Creation/Deletion bool createDomain(const std::string& strName, std::string& strError); + bool renameDomain(const std::string& strName, const std::string& strNewName, + std::string& strError); bool deleteDomain(const std::string& strName, std::string& strError); bool deleteAllDomains(std::string& strError); + bool setSequenceAwareness(const std::string& strName, bool bSequenceAware, + std::string& strResult); + bool getSequenceAwareness(const std::string& strName, bool& bSequenceAware, + std::string& strResult); bool createConfiguration(const std::string& strDomain, const std::string& strConfiguration, std::string& strError); bool deleteConfiguration(const std::string& strDomain, const std::string& strConfiguration, std::string& strError); + bool renameConfiguration(const std::string& strDomain, const std::string& strConfiguration, const std::string& strNewConfiguration, std::string& strError); // Save/Restore bool restoreConfiguration(const std::string& strDomain, const std::string& strConfiguration, std::list& strError); @@ -234,6 +241,16 @@ public: bool addConfigurableElementToDomain(const std::string& strDomain, const std::string& strConfigurableElementPath, std::string& strError); bool removeConfigurableElementFromDomain(const std::string& strDomain, const std::string& strConfigurableElementPath, std::string& strError); bool split(const std::string& strDomain, const std::string& strConfigurableElementPath, std::string& strError); + bool setElementSequence(const std::string& strDomain, const std::string& strConfiguration, + const std::vector& astrNewElementSequence, + std::string& strError); + + bool getApplicationRule(const std::string& strDomain, const std::string& strConfiguration, + std::string& strResult); + bool setApplicationRule(const std::string& strDomain, const std::string& strConfiguration, + const std::string& strApplicationRule, std::string& strError); + bool clearApplicationRule(const std::string& strDomain, const std::string& strConfiguration, + std::string& strError); /** * Method that imports Configurable Domains from an Xml source. -- cgit v1.1 From 17d59220b9517963bbe27c450207e3c0a43443fb Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 6 Jan 2015 17:05:35 +0100 Subject: ParameterMgr: remove some dead code logStructureContent() wasn't called by anybody. Change-Id: I152b6f1790a545ab302ca90389c78c43a0bb6056 Signed-off-by: David Wagner --- parameter/ParameterMgr.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'parameter/ParameterMgr.h') diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index fcba462..7ce19a5 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -354,9 +354,6 @@ public: */ bool getSystemClassXMLString(std::string& strResult); - // Introspect - void logStructureContent(std::string& strContent) const; - // CElement virtual std::string getKind() const; -- cgit v1.1 From 873db82f0fe7b54386d5cc26dec6737e0446d93d Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 6 Jan 2015 17:23:48 +0100 Subject: ParameterMgr: enforce Tuning Mode on write access of parameters This applies only to setParameter: this commands should only be available in Tuning Mode. This is enforced by moving the tuning mode check from the remote interface to the internal CParameterMgr::accessParameterValue() method. Additionaly, CParameterMgr::accessValue is made private. Change-Id: I189362a768ce1cd9709b6e5d48cd833f7ca56479 Signed-off-by: David Wagner --- parameter/ParameterMgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parameter/ParameterMgr.h') diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 7ce19a5..5fd41b1 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -205,7 +205,6 @@ public: bool sync(std::string& strError); // User set/get parameters - bool accessValue(CParameterAccessContext& parameterAccessContext, const std::string& strPath, std::string& strValue, bool bSet, std::string& strError); bool accessParameterValue(const std::string& strPath, std::string& strValue, bool bSet, std::string& strError); /** * Returns the element mapping corresponding to the path given in parameter. @@ -502,6 +501,7 @@ private: CParameterBlackboard* getParameterBlackboard(); // Parameter access + bool accessValue(CParameterAccessContext& parameterAccessContext, const std::string& strPath, std::string& strValue, bool bSet, std::string& strError); bool doSetValue(const std::string& strPath, const std::string& strValue, bool bRawValueSpace, bool bDynamicAccess, std::string& strError) const; bool doGetValue(const std::string& strPath, std::string& strValue, bool bRawValueSpace, bool bHexOutputRawFormat, bool bDynamicAccess, std::string& strError) const; -- cgit v1.1 From 70e458c1bb62ad39ea9c59339e74e1f7702910ee Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 6 Jan 2015 17:26:59 +0100 Subject: ParameterMgr: make serializeElement and importDomainFromFile private methods There is no need for these method to be public as they are only used internaly. Change-Id: I172257211f35de26c11aaef499f7c847d55ced0b Signed-off-by: David Wagner --- parameter/ParameterMgr.h | 55 ++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'parameter/ParameterMgr.h') diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 5fd41b1..315cf63 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -282,33 +282,6 @@ public: std::string& strError); /** - * Method that imports a single Configurable Domain, with settings, from an Xml file. - * - * @param[in] strXmlFilePath absolute path to the xml file containing the domain - * @param[out] strError is used as the error output - * - * @return false if any error occurs - */ - bool importDomainFromFile(const std::string& strXmlFilePath, bool bOverwrite, std::string& strError); - - - /** - * Export an element object to an Xml destination. - * - * - * @param[in,out] strXmlDest a string containing an xml description or a path to an xml file. - * @param[in] xmlSerializingContext the serializing context - * @param[in] bToFile a boolean that determines if the destination is an xml description in - * strXmlDest or contained in a file. In that case strXmlDest is just the file path. - * @param[in] element object to be serialized. - * @param[out] strError is used as the error output. - * - * @return false if any error occurs, true otherwise. - */ - bool serializeElement(std::string& strXmlDest, CXmlSerializingContext& xmlSerializingContext, - bool bToFile, const CElement& element, std::string& strError) const; - - /** * Method that exports Configurable Domains to an Xml destination. * * @param[in,out] strXmlDest a string containing an xml description or a path to an xml file @@ -518,6 +491,34 @@ private: // Parse XML file into Root element bool xmlParse(CXmlElementSerializingContext& elementSerializingContext, CElement* pRootElement, const std::string& strXmlFilePath, const std::string& strXmlFolder, ElementLibrary eElementLibrary, const std::string& strNameAttrituteName = "Name"); + /** + * Export an element object to an Xml destination. + * + * + * @param[in,out] strXmlDest a string containing an xml description or a path to an xml file. + * @param[in] xmlSerializingContext the serializing context + * @param[in] bToFile a boolean that determines if the destination is an xml description in + * strXmlDest or contained in a file. In that case strXmlDest is just the file path. + * @param[in] element object to be serialized. + * @param[out] strError is used as the error output. + * + * @return false if any error occurs, true otherwise. + */ + bool serializeElement(std::string& strXmlDest, CXmlSerializingContext& xmlSerializingContext, + bool bToFile, const CElement& element, std::string& strError) const; + + /** + * Method that imports a single Configurable Domain, with settings, from an Xml file. + * + * @param[in] strXmlFilePath absolute path to the xml file containing the domain + * @param[out] strError is used as the error output + * + * @return false if any error occurs + */ + bool importDomainFromFile(const std::string& strXmlFilePath, bool bOverwrite, + std::string& strError); + + // Framework Configuration CParameterFrameworkConfiguration* getFrameworkConfiguration(); const CParameterFrameworkConfiguration* getConstFrameworkConfiguration(); -- cgit v1.1