diff options
-rw-r--r-- | parameter/ParameterMgr.cpp | 39 | ||||
-rw-r--r-- | parameter/ParameterMgr.h | 12 | ||||
-rw-r--r-- | parameter/SelectionCriterionRule.cpp | 2 | ||||
-rw-r--r-- | parameter/SelectionCriterionRule.h | 2 | ||||
-rw-r--r-- | xmlserializer/XmlSerializer.cpp | 2 |
5 files changed, 41 insertions, 16 deletions
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 87f6662..a8335c8 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -101,9 +101,11 @@ const char* gacSystemSchemasSubFolder = "Schemas"; // Remote command parser array -const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gaRemoteCommandParserItems[] = { +const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gastRemoteCommandParserItems[] = { /// Help { "help", &CParameterMgr::helpCommandProcess, 0, "", "Show commands description and usage" }, + /// Version + { "version", &CParameterMgr::versionCommandProcess, 0, "", "Show version" }, /// Status { "status", &CParameterMgr::statusCommandProcess, 0, "", "Show current status" }, /// Tuning Mode @@ -139,7 +141,7 @@ const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gaRemoteCommandPars { "restoreConfiguration", &CParameterMgr::restoreConfigurationCommmandProcess, 2, "<domain> <configuration>", "Restore current settings from configuration" }, /// Elements/Parameters { "listElements", &CParameterMgr::listElementsCommmandProcess, 1, "<elem path>|/", "List elements under element at given path or root" }, - { "listParameters", &CParameterMgr::listParametersCommmandProcess, 1, "<elem path>|/", "Recursively list elements under element at given path or root" }, + { "listParameters", &CParameterMgr::listParametersCommmandProcess, 1, "<elem path>|/", "List parameters under element at given path or root" }, { "dumpElement", &CParameterMgr::dumpElementCommmandProcess, 1, "<elem path>", "Dump structure and content of element at given path" }, { "getElementSize", &CParameterMgr::getElementSizeCommmandProcess, 1, "<elem path>", "Show size of element at given path" }, { "showProperties", &CParameterMgr::showPropertiesCommmandProcess, 1, "<elem path>", "Show properties of element at given path" }, @@ -160,7 +162,7 @@ const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gaRemoteCommandPars { "importSettings", &CParameterMgr::importSettingsCommmandProcess, 1, "<file path>", "Import settings from binary file" } }; // Remote command parsers array Size -const uint32_t CParameterMgr::guiNbRemoteCommandParserItems = sizeof(gaRemoteCommandParserItems) / sizeof(gaRemoteCommandParserItems[0]); +const uint32_t CParameterMgr::guiNbRemoteCommandParserItems = sizeof(gastRemoteCommandParserItems) / sizeof(gastRemoteCommandParserItems[0]); CParameterMgr::CParameterMgr(const string& strParameterFrameworkConfigurationFolderPath, const string& strSystemClassName) : _bTuningModeIsOn(false), @@ -237,12 +239,12 @@ void CParameterMgr::doLog(const string& strLog) const void CParameterMgr::nestLog() const { - ((uint32_t&)_uiLogDepth)++; + _uiLogDepth++; } void CParameterMgr::unnestLog() const { - ((uint32_t&)_uiLogDepth)--; + _uiLogDepth--; } bool CParameterMgr::load(string& strError) @@ -582,7 +584,7 @@ bool CParameterMgr::remoteCommandProcess(const IRemoteCommand& remoteCommand, st for (uiRemoteCommandParserItem = 0; uiRemoteCommandParserItem < guiNbRemoteCommandParserItems; uiRemoteCommandParserItem++) { - const SRemoteCommandParserItem* pRemoteCommandParserItem = &gaRemoteCommandParserItems[uiRemoteCommandParserItem]; + const SRemoteCommandParserItem* pRemoteCommandParserItem = &gastRemoteCommandParserItems[uiRemoteCommandParserItem]; if (string(pRemoteCommandParserItem->_pcCommandName) == remoteCommand.getCommand()) { @@ -623,7 +625,7 @@ void CParameterMgr::setMaxCommandUsageLength() for (uiRemoteCommandParserItem = 0; uiRemoteCommandParserItem < guiNbRemoteCommandParserItems; uiRemoteCommandParserItem++) { - const SRemoteCommandParserItem* pRemoteCommandParserItem = &gaRemoteCommandParserItems[uiRemoteCommandParserItem]; + const SRemoteCommandParserItem* pRemoteCommandParserItem = &gastRemoteCommandParserItems[uiRemoteCommandParserItem]; uint32_t uiRemoteCommandUsageLength = pRemoteCommandParserItem->usage().length(); @@ -647,7 +649,7 @@ CParameterMgr::CommandStatus CParameterMgr::helpCommandProcess(const IRemoteComm for (uiRemoteCommandParserItem = 0; uiRemoteCommandParserItem < guiNbRemoteCommandParserItems; uiRemoteCommandParserItem++) { - const SRemoteCommandParserItem* pRemoteCommandParserItem = &gaRemoteCommandParserItems[uiRemoteCommandParserItem]; + const SRemoteCommandParserItem* pRemoteCommandParserItem = &gastRemoteCommandParserItems[uiRemoteCommandParserItem]; string strUsage = pRemoteCommandParserItem->usage(); @@ -667,6 +669,22 @@ CParameterMgr::CommandStatus CParameterMgr::helpCommandProcess(const IRemoteComm return ESucceeded; } +/// Version +CParameterMgr::CommandStatus CParameterMgr::versionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) +{ + (void)remoteCommand; + + // Show versions + // Major + strResult = toString(guiEditionMajor) + "."; + // Minor + strResult += toString(guiEditionMinor) + "."; + // Revision + strResult += toString(guiRevision); + + return ESucceeded; +} + /// Status CParameterMgr::CommandStatus CParameterMgr::statusCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { @@ -1327,9 +1345,8 @@ bool CParameterMgr::setAutoSync(bool bAutoSyncOn, string& strError) // Warn domains about turning auto sync back on if (bAutoSyncOn && !_bAutoSyncOn) { - // Ensure application of currently selected configurations - // Force-apply configurations - if (!getConfigurableDomains()->apply(_pMainParameterBlackboard, true, strError)) { + // Do the synchronization at system class level (could be optimized by keeping track of all modified parameters) + if (!sync(strError)) { return false; } diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 003a643..74440f8 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -40,6 +40,7 @@ #include <map> #include <vector> + class CElementLibrarySet; class CSubsystemLibrary; class CSystemClass; @@ -90,6 +91,11 @@ class CParameterMgr : private CElement, private IRemoteCommandHandler, private I return string(_pcCommandName) + " " + _pcHelp; } }; + + // Version + static const uint32_t guiEditionMajor = 0x0; + static const uint32_t guiEditionMinor = 0x1; + static const uint32_t guiRevision = 0x1; public: // Logger interface class ILogger @@ -179,6 +185,8 @@ private: ////////////////:: Remote command parsers /// Help CommandStatus helpCommandProcess(const IRemoteCommand& remoteCommand, string& strResult); + /// Version + CommandStatus versionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult); /// Status CommandStatus statusCommandProcess(const IRemoteCommand& remoteCommand, string& strResult); /// Tuning Mode @@ -313,7 +321,7 @@ private: IRemoteProcessorServerInterface* _pRemoteProcessorServer; // Parser description array - static const SRemoteCommandParserItem gaRemoteCommandParserItems[]; + static const SRemoteCommandParserItem gastRemoteCommandParserItems[]; // Parser description array size static const uint32_t guiNbRemoteCommandParserItems; @@ -326,6 +334,6 @@ private: // Logging ILogger* _pLogger; - uint32_t _uiLogDepth; + mutable uint32_t _uiLogDepth; }; diff --git a/parameter/SelectionCriterionRule.cpp b/parameter/SelectionCriterionRule.cpp index e43c9e8..eec88be 100644 --- a/parameter/SelectionCriterionRule.cpp +++ b/parameter/SelectionCriterionRule.cpp @@ -37,7 +37,7 @@ #define base CRule -CSelectionCriterionRule::SMatchingRuleDescription CSelectionCriterionRule::_astMatchesWhen[CSelectionCriterionRule::ENbMatchesWhen] = { +const CSelectionCriterionRule::SMatchingRuleDescription CSelectionCriterionRule::_astMatchesWhen[CSelectionCriterionRule::ENbMatchesWhen] = { { "Is", false }, { "IsNot", false }, { "Includes", true }, diff --git a/parameter/SelectionCriterionRule.h b/parameter/SelectionCriterionRule.h index 528e584..51f22e7 100644 --- a/parameter/SelectionCriterionRule.h +++ b/parameter/SelectionCriterionRule.h @@ -80,6 +80,6 @@ private: int32_t _iMatchValue; // Used for XML MatchesWhen attribute parsing - static SMatchingRuleDescription _astMatchesWhen[ENbMatchesWhen]; + static const SMatchingRuleDescription _astMatchesWhen[ENbMatchesWhen]; }; diff --git a/xmlserializer/XmlSerializer.cpp b/xmlserializer/XmlSerializer.cpp index 73ae90c..0c4f5ff 100644 --- a/xmlserializer/XmlSerializer.cpp +++ b/xmlserializer/XmlSerializer.cpp @@ -38,7 +38,7 @@ bool CXmlSerializer::_bLibXml2CleanupScheduled; CXmlSerializer::CXmlSerializer(const string& strXmlInstanceFile, const string& strXmlSchemaFile, const string& strRootElementType, CXmlSerializingContext& serializingContext) : _strXmlInstanceFile(strXmlInstanceFile), _strXmlSchemaFile(strXmlSchemaFile), _strRootElementType(strRootElementType), _serializingContext(serializingContext), _pDoc(NULL), _pRootNode(NULL) { - if (_bLibXml2CleanupScheduled) { + if (!_bLibXml2CleanupScheduled) { // Schedule cleanup atexit(xmlCleanupParser); |