blob: 0fcd4e2a0aa5a2642ca3d44daa8498ac15ccaa50 [file] [log] [blame]
Patrick Benavoli68a91282011-08-31 11:23:23 +02001/* <auto_header>
2 * <FILENAME>
3 *
4 * INTEL CONFIDENTIAL
5 * Copyright © 2011 Intel
6 * Corporation All Rights Reserved.
7 *
8 * The source code contained or described herein and all documents related to
9 * the source code ("Material") are owned by Intel Corporation or its suppliers
10 * or licensors. Title to the Material remains with Intel Corporation or its
11 * suppliers and licensors. The Material contains trade secrets and proprietary
12 * and confidential information of Intel or its suppliers and licensors. The
13 * Material is protected by worldwide copyright and trade secret laws and
14 * treaty provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed, or
16 * disclosed in any way without Intel’s prior express written permission.
17 *
18 * No license under any patent, copyright, trade secret or other intellectual
19 * property right is granted to or conferred upon you by disclosure or delivery
20 * of the Materials, either expressly, by implication, inducement, estoppel or
21 * otherwise. Any license under such intellectual property rights must be
22 * express and approved by Intel in writing.
23 *
24 * AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
25 * CREATED: 2011-06-01
26 * UPDATED: 2011-07-27
27 *
28 *
29 * </auto_header>
30 */
31#include "ParameterMgr.h"
32#include "XmlParser.h"
33#include "XmlParameterSerializingContext.h"
34#include "XmlElementSerializingContext.h"
35#include "SystemClass.h"
36#include "ElementLibrarySet.h"
37#include "SubsystemLibrary.h"
38#include "NamedElementBuilderTemplate.h"
39#include "KindElementBuilderTemplate.h"
40#include "ElementBuilderTemplate.h"
41#include "SelectionCriterionType.h"
Patrick Benavoli68a91282011-08-31 11:23:23 +020042#include "SubsystemElementBuilder.h"
43#include "SelectionCriteria.h"
44#include "ComponentType.h"
45#include "ComponentInstance.h"
46#include "ParameterBlockType.h"
47#include "BooleanParameterType.h"
48#include "IntegerParameterType.h"
49#include "FixedPointParameterType.h"
50#include "ParameterBlackboard.h"
51#include "Parameter.h"
Patrick Benavoli68a91282011-08-31 11:23:23 +020052#include "ParameterBlackboard.h"
53#include "ParameterAccessContext.h"
54#include "XmlFileIncluderElement.h"
55#include "ParameterFrameworkConfiguration.h"
56#include "FrameworkConfigurationGroup.h"
57#include "FrameworkConfigurationLocation.h"
58#include "SystemClassConfiguration.h"
59#include "ConfigurableDomains.h"
60#include "ConfigurableDomain.h"
61#include "DomainConfiguration.h"
62#include "XmlComposer.h"
63#include "XmlDomainSerializingContext.h"
64#include "BitParameterBlockType.h"
65#include "BitParameterType.h"
Patrick Benavoli1352ae52011-10-21 16:48:04 +020066#include "StringParameterType.h"
Patrick Benavoli68a91282011-08-31 11:23:23 +020067#include "RemoteProcessorServerInterface.h"
68#include "ElementLocator.h"
69#include "AutoLog.h"
70#include "CompoundRule.h"
71#include "SelectionCriterionRule.h"
72#include "SimulatedBackSynchronizer.h"
73#include "HardwareBackSynchronizer.h"
Patrick Benavoli1387bda2011-08-31 11:23:24 +020074#include "AutoLock.h"
Patrick Benavoli68a91282011-08-31 11:23:23 +020075#include <strings.h>
76#include <dlfcn.h>
77#include <assert.h>
Patrick Benavoli68a91282011-08-31 11:23:23 +020078
79#define base CElement
80
81// Used for remote processor server creation
82typedef IRemoteProcessorServerInterface* (*CreateRemoteProcessorServer)(uint16_t uiPort, IRemoteCommandHandler* pCommandHandler);
83
84// Global configuration file name (fixed)
85const char* gacParameterFrameworkConfigurationFileName = "ParameterFrameworkConfiguration.xml";
86const char* gacSystemSchemasSubFolder = "Schemas";
87
88// Config File System looks normally like this:
89// ---------------------------------------------
90//├── ParameterFrameworkConfiguration.xml
91//├── Schemas
92//│ └── *.xsd
93//├── Settings
94//│ └── <SystemClassName folder>*
95//│ ├── <ConfigurableDomains>.xml
96//│ └── <Settings>.bin?
97//└── Structure
98// └── <SystemClassName folder>*
99// ├── <SystemClassName>Class.xml
100// └── <Subsystem>.xml*
101// --------------------------------------------
102
103
104// Remote command parser array
Patrick Benavoli592ae562011-09-05 16:53:58 +0200105const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gastRemoteCommandParserItems[] = {
Patrick Benavoli592ae562011-09-05 16:53:58 +0200106 /// Version
107 { "version", &CParameterMgr::versionCommandProcess, 0, "", "Show version" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200108 /// Status
109 { "status", &CParameterMgr::statusCommandProcess, 0, "", "Show current status" },
110 /// Tuning Mode
111 { "setTuningMode", &CParameterMgr::setTuningModeCommmandProcess, 1, "on|off*", "Turn on or off Tuning Mode" },
112 { "getTuningMode", &CParameterMgr::getTuningModeCommmandProcess, 0, "", "Show Tuning Mode" },
113 /// Value Space
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200114 { "setValueSpace", &CParameterMgr::setValueSpaceCommmandProcess, 1, "raw|real*", "Assigns Value Space used for parameter value interpretation" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200115 { "getValueSpace", &CParameterMgr::getValueSpaceCommmandProcess, 0, "", "Show Value Space" },
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200116 /// Output Raw Format
117 { "setOutputRawFormat", &CParameterMgr::setOutputRawFormatCommmandProcess, 1, "dec*|hex", "Assigns format used to output parameter values when in raw Value Space" },
118 { "getOutputRawFormat", &CParameterMgr::getOutputRawFormatCommmandProcess, 0, "", "Show Output Raw Format" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200119 /// Sync
120 { "setAutoSync", &CParameterMgr::setAutoSyncCommmandProcess, 1, "on*|off", "Turn on or off automatic synchronization to hardware while in Tuning Mode" },
121 { "getAutoSync", &CParameterMgr::getAutoSyncCommmandProcess, 0, "", "Show Auto Sync state" },
122 { "sync", &CParameterMgr::syncCommmandProcess, 0, "", "Synchronize current settings to hardware while in Tuning Mode and Auto Sync off" },
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200123 /// Criteria
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200124 { "listCriteria", &CParameterMgr::listCriteriaCommmandProcess, 0, "", "List selection criteria" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200125 /// Domains
126 { "listDomains", &CParameterMgr::listDomainsCommmandProcess, 0, "", "List configurable domains" },
127 { "createDomain", &CParameterMgr::createDomainCommmandProcess, 1, "<domain>", "Create new configurable domain" },
128 { "deleteDomain", &CParameterMgr::deleteDomainCommmandProcess, 1, "<domain>", "Delete configurable domain" },
129 { "renameDomain", &CParameterMgr::renameDomainCommmandProcess, 2, "<domain> <new name>", "Rename configurable domain" },
Patrick Benavoli63499d42011-10-24 18:50:03 +0200130 { "setSequenceAwareness", &CParameterMgr::setSequenceAwarenessCommmandProcess, 1, "<domain> true|false*", "Set configurable domain sequence awareness" },
131 { "getSequenceAwareness", &CParameterMgr::getSequenceAwarenessCommmandProcess, 1, "<domain>", "Get configurable domain sequence awareness" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200132 { "listDomainElements", &CParameterMgr::listDomainElementsCommmandProcess, 1, "<domain>", "List elements associated to configurable domain" },
133 { "addElement", &CParameterMgr::addElementCommmandProcess, 2, "<domain> <elem path>", "Associate element at given path to configurable domain" },
134 { "removeElement", &CParameterMgr::removeElementCommmandProcess, 2, "<domain> <elem path>", "Dissociate element at given path from configurable domain" },
135 { "splitDomain", &CParameterMgr::splitDomainCommmandProcess, 2, "<domain> <elem path>", "Split configurable domain at given associated element path" },
136 /// Configurations
137 { "listConfigurations", &CParameterMgr::listConfigurationsCommmandProcess, 1, "<domain>", "List domain configurations" },
138 { "createConfiguration", &CParameterMgr::createConfigurationCommmandProcess, 2, "<domain> <configuration>", "Create new domain configuration" },
139 { "deleteConfiguration", &CParameterMgr::deleteConfigurationCommmandProcess, 2, "<domain> <configuration>", "Delete domain configuration" },
140 { "renameConfiguration", &CParameterMgr::renameConfigurationCommmandProcess, 3, "<domain> <configuration> <new name>", "Rename domain configuration" },
141 { "saveConfiguration", &CParameterMgr::saveConfigurationCommmandProcess, 2, "<domain> <configuration>", "Save current settings into configuration" },
142 { "restoreConfiguration", &CParameterMgr::restoreConfigurationCommmandProcess, 2, "<domain> <configuration>", "Restore current settings from configuration" },
Patrick Benavoli63499d42011-10-24 18:50:03 +0200143 { "setElementSequence", &CParameterMgr::setElementSequenceCommmandProcess, 2, "<domain> <configuration> <elem path list>", "Set element application order for configuration" },
144 { "getElementSequence", &CParameterMgr::getElementSequenceCommmandProcess, 2, "<domain> <configuration>", "Get element application order for configuration" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200145 /// Elements/Parameters
146 { "listElements", &CParameterMgr::listElementsCommmandProcess, 1, "<elem path>|/", "List elements under element at given path or root" },
Patrick Benavoli592ae562011-09-05 16:53:58 +0200147 { "listParameters", &CParameterMgr::listParametersCommmandProcess, 1, "<elem path>|/", "List parameters under element at given path or root" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200148 { "dumpElement", &CParameterMgr::dumpElementCommmandProcess, 1, "<elem path>", "Dump structure and content of element at given path" },
149 { "getElementSize", &CParameterMgr::getElementSizeCommmandProcess, 1, "<elem path>", "Show size of element at given path" },
Patrick Benavoli2ecf9002011-08-31 11:23:24 +0200150 { "showProperties", &CParameterMgr::showPropertiesCommmandProcess, 1, "<elem path>", "Show properties of element at given path" },
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200151 { "getParameter", &CParameterMgr::getParameterCommmandProcess, 1, "<param path>", "Get value for parameter at given path" },
Patrick Benavoli2ecf9002011-08-31 11:23:24 +0200152 { "setParameter", &CParameterMgr::setParameterCommmandProcess, 2, "<param path> <value>", "Set value for parameter at given path" },
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200153 { "listBelongingDomains", &CParameterMgr::listBelongingDomainsCommmandProcess, 1, "<elem path>", "List domain(s) element at given path belongs to" },
Patrick Benavoli68a91282011-08-31 11:23:23 +0200154 { "listAssociatedDomains", &CParameterMgr::listAssociatedDomainsCommmandProcess, 1, "<elem path>", "List domain(s) element at given path is associated to" },
155 /// Browse
156 { "listAssociatedElements", &CParameterMgr::listAssociatedElementsCommmandProcess, 0, "", "List element sub-trees associated to at least one configurable domain" },
157 { "listConflictingElements", &CParameterMgr::listConflictingElementsCommmandProcess, 0, "", "List element sub-trees contained in more than one configurable domain" },
158 { "listRogueElements", &CParameterMgr::listRogueElementsCommmandProcess, 0, "", "List element sub-trees owned by no configurable domain" },
159 /// Settings Import/Export
160 { "exportDomainsXML", &CParameterMgr::exportConfigurableDomainsToXMLCommmandProcess, 1, "<file path> ", "Export domains to XML file" },
161 { "importDomainsXML", &CParameterMgr::importConfigurableDomainsFromXMLCommmandProcess, 1, "<file path>", "Import domains from XML file" },
162 { "exportDomainsWithSettingsXML", &CParameterMgr::exportConfigurableDomainsWithSettingsToXMLCommmandProcess, 1, "<file path> ", "Export domains including settings to XML file" },
163 { "importDomainsWithSettingsXML", &CParameterMgr::importConfigurableDomainsWithSettingsFromXMLCommmandProcess, 1, "<file path>", "Import domains including settings from XML file" },
164 { "exportSettings", &CParameterMgr::exportSettingsCommmandProcess, 1, "<file path>", "Export settings to binary file" },
165 { "importSettings", &CParameterMgr::importSettingsCommmandProcess, 1, "<file path>", "Import settings from binary file" }
166};
167// Remote command parsers array Size
Patrick Benavoli592ae562011-09-05 16:53:58 +0200168const uint32_t CParameterMgr::guiNbRemoteCommandParserItems = sizeof(gastRemoteCommandParserItems) / sizeof(gastRemoteCommandParserItems[0]);
Patrick Benavoli68a91282011-08-31 11:23:23 +0200169
170CParameterMgr::CParameterMgr(const string& strParameterFrameworkConfigurationFolderPath, const string& strSystemClassName) :
171 _bTuningModeIsOn(false),
172 _bValueSpaceIsRaw(false),
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200173 _bOutputRawFormatIsHex(false),
Patrick Benavoli68a91282011-08-31 11:23:23 +0200174 _bAutoSyncOn(true),
175 _pMainParameterBlackboard(new CParameterBlackboard),
176 _pElementLibrarySet(new CElementLibrarySet),
177 _strParameterFrameworkConfigurationFolderPath(strParameterFrameworkConfigurationFolderPath),
178 _strSchemaFolderLocation(strParameterFrameworkConfigurationFolderPath + "/" + gacSystemSchemasSubFolder),
179 _pSystemClassConfiguration(NULL),
180 _uiStructureChecksum(0),
181 _pRemoteProcessorServer(NULL),
182 _uiMaxCommandUsageLength(0),
183 _pLogger(NULL),
184 _uiLogDepth(0)
185{
186 // Tuning Mode Mutex
187 bzero(&_tuningModeMutex, sizeof(_tuningModeMutex));
188 pthread_mutex_init(&_tuningModeMutex, NULL);
189
190 // Deal with children
191 addChild(new CParameterFrameworkConfiguration);
192 addChild(new CSelectionCriteria);
193 addChild(new CSystemClass(strSystemClassName));
194 addChild(new CConfigurableDomains(strSystemClassName));
195
196 // Feed element library
197 feedElementLibraries();
Patrick Benavoli63499d42011-10-24 18:50:03 +0200198
199 _pCommandHandler = new CCommandHandler(this);
200
201 // Add command parsers
202 uint32_t uiRemoteCommandParserItem;
203
204 for (uiRemoteCommandParserItem = 0; uiRemoteCommandParserItem < guiNbRemoteCommandParserItems; uiRemoteCommandParserItem++) {
205
206 const SRemoteCommandParserItem* pRemoteCommandParserItem = &gastRemoteCommandParserItems[uiRemoteCommandParserItem];
207
208 _pCommandHandler->addCommandParser(pRemoteCommandParserItem->_pcCommandName,
209 pRemoteCommandParserItem->_pfnParser,
210 pRemoteCommandParserItem->_uiMinArgumentCount,
211 pRemoteCommandParserItem->_pcHelp,
212 pRemoteCommandParserItem->_pcDescription);
213 }
Patrick Benavoli68a91282011-08-31 11:23:23 +0200214}
215
216CParameterMgr::~CParameterMgr()
217{
218 // Children
219 delete _pRemoteProcessorServer;
220 delete _pMainParameterBlackboard;
221 delete _pElementLibrarySet;
222
223 // Tuning Mode Mutex
224 pthread_mutex_destroy(&_tuningModeMutex);
225}
226
227string CParameterMgr::getKind() const
228{
229 return "ParameterMgr";
230}
231
232// Logging
233void CParameterMgr::setLogger(CParameterMgr::ILogger* pLogger)
234{
235 _pLogger = pLogger;
236}
237
238// Logging
239void CParameterMgr::doLog(const string& strLog) const
240{
241 if (_pLogger) {
242
243 // Nest
244 string strIndent;
245
246 // Level
247 uint32_t uiNbIndents = _uiLogDepth;
248
249 while (uiNbIndents--) {
250
251 strIndent += " ";
252 }
253
254 // Log
255 _pLogger->log(strIndent + strLog);
256 }
257}
258
259void CParameterMgr::nestLog() const
260{
Patrick Benavoli592ae562011-09-05 16:53:58 +0200261 _uiLogDepth++;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200262}
263
264void CParameterMgr::unnestLog() const
265{
Patrick Benavoli592ae562011-09-05 16:53:58 +0200266 _uiLogDepth--;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200267}
268
Patrick Benavoli63499d42011-10-24 18:50:03 +0200269// Version
270string CParameterMgr::getVersion() const
271{
272 string strVersion;
273
274 // Major
275 strVersion = toString(guiEditionMajor) + ".";
276 // Minor
277 strVersion += toString(guiEditionMinor) + ".";
278 // Revision
279 strVersion += toString(guiRevision);
280
281 return strVersion;
282}
283
Patrick Benavoli68a91282011-08-31 11:23:23 +0200284bool CParameterMgr::load(string& strError)
285{
286 CAutoLog autoLog(this, "Loading");
287
288 // Load Framework configuration
289 if (!loadFrameworkConfiguration(strError)) {
290
291 return false;
292 }
293
294 // Load subsystems
295 if (!getSystemClass()->loadSubsystems(strError, _astrPluginFolderPaths)) {
296
297 return false;
298 }
299
300 // Load structure
301 if (!loadStructure(strError)) {
302
303 return false;
304 }
305
306 // Load settings
307 if (!loadSettings(strError)) {
308
309 return false;
310 }
311
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200312 // Back synchronization for areas in parameter blackboard not covered by any domain
313 CBackSynchronizer* pBackSynchronizer = createBackSynchronizer(strError);
Patrick Benavoli68a91282011-08-31 11:23:23 +0200314
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200315 log("Main blackboard back synchronization");
316
317 // Back-synchronize
318 if (!pBackSynchronizer->sync()) {
319 // Get rid of back synchronizer
320 delete pBackSynchronizer;
321
322 strError = "Main blackboard back synchronization failed: " + strError;
323
324 return false;
325 }
326 // Get rif of back synchronizer
327 delete pBackSynchronizer;
328
329 // We're done loading the settings and back synchronizing
330 CConfigurableDomains* pConfigurableDomains = getConfigurableDomains();
331
332 // We need to ensure all domains are valid
333 pConfigurableDomains->validate(_pMainParameterBlackboard);
334
335 // Ensure application of currently selected configurations
336 // Force-apply configurations
337 if (!pConfigurableDomains->apply(_pMainParameterBlackboard, true, strError)) {
Patrick Benavoli68a91282011-08-31 11:23:23 +0200338
339 return false;
340 }
341
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200342 // Start remote processor server if appropriate
343 return handleRemoteProcessingInterface(strError);
Patrick Benavoli68a91282011-08-31 11:23:23 +0200344}
345
346bool CParameterMgr::loadFrameworkConfiguration(string& strError)
347{
348 CAutoLog autoLog(this, "Loading framework configuration");
349
350 // Get Xml config file name
351 string strXmlConfigurationFilePath = _strParameterFrameworkConfigurationFolderPath + "/" + gacParameterFrameworkConfigurationFileName;
352
353 // Parse Structure XML file
354 CXmlElementSerializingContext elementSerializingContext(strError);
355
356 if (!xmlParse(elementSerializingContext, getFrameworkConfiguration(), strXmlConfigurationFilePath, _strParameterFrameworkConfigurationFolderPath, EFrameworkConfigurationLibrary)) {
357
358 return false;
359 }
360 // Get subsystem plugins folders element
361 const CFrameworkConfigurationGroup* pSubsystemPluginFolders= static_cast<const CFrameworkConfigurationGroup*>(getConstFrameworkConfiguration()->findChild("SubsystemPluginFolders"));
362
363 if (!pSubsystemPluginFolders) {
364
365 strError = "Parameter Framework Configuration: couldn't find SubsystemPluginFolders element";
366
367 return false;
368 }
369 // Get plugin locations
370 uint32_t uiPluginFolderLocation;
371 uint32_t uiNbPluginFolderLocations = pSubsystemPluginFolders->getNbChildren();
372
373 if (!uiNbPluginFolderLocations) {
374
375 strError = "Parameter Framework Configuration: couldn't find any PluginFolderLocation element";
376
377 return false;
378 }
379
380 for (uiPluginFolderLocation = 0; uiPluginFolderLocation < uiNbPluginFolderLocations; uiPluginFolderLocation++) {
381
382 const CFrameworkConfigurationLocation* pSubsystemPluginLocation = static_cast<const CFrameworkConfigurationLocation*>(pSubsystemPluginFolders->getChild(uiPluginFolderLocation));
383
384 _astrPluginFolderPaths.push_back(pSubsystemPluginLocation->getFilePath(_strParameterFrameworkConfigurationFolderPath));
385 }
386
387 // Get configuration for current system class
388 const CFrameworkConfigurationGroup* pParameterConfigurationGroup = static_cast<const CFrameworkConfigurationGroup*>(getConstFrameworkConfiguration()->findChildOfKind("ParameterConfiguration"));
389
390 if (!pParameterConfigurationGroup) {
391
392 strError = "Parameter Framework Configuration: couldn't find ParameterConfiguration element";
393
394 return false;
395 }
396 _pSystemClassConfiguration = static_cast<const CSystemClassConfiguration*>(pParameterConfigurationGroup->findChild(getSystemClass()->getName()));
397
398 if (!_pSystemClassConfiguration) {
399
400 strError = "No framework configuration found for SystemClass " + getSystemClass()->getName();
401
402 return false;
403 }
404 // Log tuning availability
405 log("Tuning %s", _pSystemClassConfiguration->isTuningAllowed() ? "allowed" : "prohibited");
406
407 return true;
408}
409
410bool CParameterMgr::loadStructure(string& strError)
411{
412 // Retrieve system to load structure to
413 CSystemClass* pSystemClass = getSystemClass();
414
415 CAutoLog autoLog(this, "Loading " + pSystemClass->getName() + " system class structure");
416
417 // Get structure description element
418 const CFrameworkConfigurationLocation* pStructureDescriptionFileLocation = static_cast<const CFrameworkConfigurationLocation*>(_pSystemClassConfiguration->findChildOfKind("StructureDescriptionFileLocation"));
419
420 if (!pStructureDescriptionFileLocation) {
421
422 strError = "No StructureDescriptionFileLocation element found for SystemClass " + pSystemClass->getName();
423
424 return false;
425 }
426
427 // Get Xml structure folder
428 string strXmlStructureFolder = pStructureDescriptionFileLocation->getFolderPath(_strParameterFrameworkConfigurationFolderPath);
429
430 // Get Xml structure file name
431 string strXmlStructureFilePath = pStructureDescriptionFileLocation->getFilePath(_strParameterFrameworkConfigurationFolderPath);
432
433 // Parse Structure XML file
434 CXmlParameterSerializingContext parameterBuildContext(strError);
435
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200436 log("Importing system structure from file %s", strXmlStructureFilePath.c_str());
437
Patrick Benavoli68a91282011-08-31 11:23:23 +0200438 if (!xmlParse(parameterBuildContext, pSystemClass, strXmlStructureFilePath, strXmlStructureFolder, EParameterCreationLibrary)) {
439
440 return false;
441 }
442
443 // Initialize offsets
444 pSystemClass->setOffset(0);
445
446 // Initialize main blackboard's size
447 _pMainParameterBlackboard->setSize(pSystemClass->getFootPrint());
448
449 return true;
450}
451
452bool CParameterMgr::loadSettings(string& strError)
453{
454 CAutoLog autoLog(this, "Loading settings");
455
456 // Get settings configuration element
457 const CFrameworkConfigurationGroup* pParameterConfigurationGroup = static_cast<const CFrameworkConfigurationGroup*>(_pSystemClassConfiguration->findChildOfKind("SettingsConfiguration"));
458
459 if (!pParameterConfigurationGroup) {
460
461 // No settings to load
462
463 return true;
464 }
465 // Get binary settings file location
466 const CFrameworkConfigurationLocation* pBinarySettingsFileLocation = static_cast<const CFrameworkConfigurationLocation*>(pParameterConfigurationGroup->findChildOfKind("BinarySettingsFileLocation"));
467
468 string strXmlBinarySettingsFilePath;
469
470 if (pBinarySettingsFileLocation) {
471
472 // Get Xml binary settings file name
473 strXmlBinarySettingsFilePath = pBinarySettingsFileLocation->getFilePath(_strParameterFrameworkConfigurationFolderPath);
474 }
475
476 // Get configurable domains element
477 const CFrameworkConfigurationLocation* pConfigurableDomainsFileLocation = static_cast<const CFrameworkConfigurationLocation*>(pParameterConfigurationGroup->findChildOfKind("ConfigurableDomainsFileLocation"));
478
479 if (!pConfigurableDomainsFileLocation) {
480
481 strError = "No ConfigurableDomainsFileLocation element found for SystemClass " + getSystemClass()->getName();
482
483 return false;
484 }
485 // Get destination root element
486 CConfigurableDomains* pConfigurableDomains = getConfigurableDomains();
487
488 // Get Xml configuration domains file name
489 string strXmlConfigurationDomainsFilePath = pConfigurableDomainsFileLocation->getFilePath(_strParameterFrameworkConfigurationFolderPath);
490
491 // Get Xml configuration domains folder
492 string strXmlConfigurationDomainsFolder = pConfigurableDomainsFileLocation->getFolderPath(_strParameterFrameworkConfigurationFolderPath);
493
494 // Parse configuration domains XML file (ask to read settings from XML file if they are not provided as binary)
495 CXmlDomainSerializingContext xmlDomainSerializingContext(strError, !pBinarySettingsFileLocation);
496
497 // Selection criteria definition for rule creation
498 xmlDomainSerializingContext.setSelectionCriteriaDefinition(getConstSelectionCriteria()->getSelectionCriteriaDefinition());
499
Patrick Benavoli63499d42011-10-24 18:50:03 +0200500 // Auto validation of configurations if no binary settings provided
501 xmlDomainSerializingContext.setAutoValidationRequired(!pBinarySettingsFileLocation);
502
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200503 log("Importing configurable domains from file %s %s settings", strXmlConfigurationDomainsFilePath.c_str(), pBinarySettingsFileLocation ? "without" : "with");
504
Patrick Benavoli68a91282011-08-31 11:23:23 +0200505 // Do parse
506 if (!xmlParse(xmlDomainSerializingContext, pConfigurableDomains, strXmlConfigurationDomainsFilePath, strXmlConfigurationDomainsFolder, EParameterConfigurationLibrary, "SystemClassName")) {
507
508 return false;
509 }
510 // We have loaded the whole system structure, compute checksum
511 const CSystemClass* pSystemClass = getConstSystemClass();
512 _uiStructureChecksum = pSystemClass->computeStructureChecksum() + getConfigurableDomains()->computeStructureChecksum() + getSelectionCriteria()->computeStructureChecksum();
513
514 // Load binary settings if any provided
515 if (pBinarySettingsFileLocation && !pConfigurableDomains->serializeSettings(strXmlBinarySettingsFilePath, false, _uiStructureChecksum, strError)) {
516
517 return false;
518 }
519
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200520 return true;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200521}
522
523// XML parsing
524bool CParameterMgr::xmlParse(CXmlElementSerializingContext& elementSerializingContext, CElement* pRootElement, const string& strXmlFilePath, const string& strXmlFolder, CParameterMgr::ElementLibrary eElementLibrary, const string& strNameAttrituteName)
525{
526 // Init serializing context
527 elementSerializingContext.set(_pElementLibrarySet->getElementLibrary(eElementLibrary), strXmlFolder, _strSchemaFolderLocation);
528
529 // Get Schema file associated to root element
530 string strXmlSchemaFilePath = _strSchemaFolderLocation + "/" + pRootElement->getKind() + ".xsd";
531
532 // Parse Structure XML file
533 CXmlParser parser(strXmlFilePath, strXmlSchemaFilePath, pRootElement->getKind(), elementSerializingContext);
534
535 if (!parser.open()) {
536
537 return false;
538 }
539
540 // Check Root element name attribute (if any)
541 string strRootElementName = parser.getRootElementAttributeString(strNameAttrituteName);
542
543 if (!strRootElementName.empty() && strRootElementName != pRootElement->getName()) {
544
545 elementSerializingContext.setError("Error: Wrong XML structure file " + strXmlFilePath);
546 elementSerializingContext.appendLineToError(pRootElement->getKind() + " element " + pRootElement->getName() + " mismatches expected " + pRootElement->getKind() + " type " + pRootElement->getName());
547
548 return false;
549 }
550
551 // Start clean
552 pRootElement->clean();
553
554 // Parse
555 if (!parser.parse(pRootElement)) {
556
557 // Cleanup
558 pRootElement->clean();
559
560 return false;
561 }
562
563 // Close parser
564 if (!parser.close()) {
565
566 return false;
567 }
568
569 return true;
570}
571
572// Init
573bool CParameterMgr::init(string& strError)
574{
575 return base::init(strError);
576}
577
578// Selection criteria interface
579CSelectionCriterionType* CParameterMgr::createSelectionCriterionType(bool bIsInclusive)
580{
581 // Propagate
582 return getSelectionCriteria()->createSelectionCriterionType(bIsInclusive);
583}
584
585CSelectionCriterion* CParameterMgr::createSelectionCriterion(const string& strName, const CSelectionCriterionType* pSelectionCriterionType)
586{
587 // Propagate
588 return getSelectionCriteria()->createSelectionCriterion(strName, pSelectionCriterionType);
589}
590
Patrick Benavolib71ccf72011-09-13 14:15:52 +0200591// Selection criterion retrieval
592CSelectionCriterion* CParameterMgr::getSelectionCriterion(const string& strName)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200593{
Patrick Benavolib71ccf72011-09-13 14:15:52 +0200594 // Propagate
595 return getSelectionCriteria()->getSelectionCriterion(strName);
596}
597
598// Selection criteria changed event
599bool CParameterMgr::applyConfigurations(string& strError)
600{
601 CAutoLog autoLog(this, "Configuration application request");
Patrick Benavoli68a91282011-08-31 11:23:23 +0200602
603 // Lock state
Patrick Benavoli1387bda2011-08-31 11:23:24 +0200604 CAutoLock autoLock(&_tuningModeMutex);
Patrick Benavoli68a91282011-08-31 11:23:23 +0200605
606 if (!_bTuningModeIsOn) {
607
608 // Apply configuration(s)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200609 if (!getConfigurableDomains()->apply(_pMainParameterBlackboard, false, strError)) {
610
611 log("Failed to apply configurations!");
Patrick Benavolib71ccf72011-09-13 14:15:52 +0200612
613 return false;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200614 }
615 }
Patrick Benavolib71ccf72011-09-13 14:15:52 +0200616
617 return true;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200618}
619
Patrick Benavoli68a91282011-08-31 11:23:23 +0200620/////////////////// Remote command parsers
Patrick Benavoli592ae562011-09-05 16:53:58 +0200621/// Version
Patrick Benavoli63499d42011-10-24 18:50:03 +0200622CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::versionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli592ae562011-09-05 16:53:58 +0200623{
624 (void)remoteCommand;
625
Patrick Benavoli63499d42011-10-24 18:50:03 +0200626 // Show version
627 strResult = getVersion();
Patrick Benavoli592ae562011-09-05 16:53:58 +0200628
Patrick Benavoli63499d42011-10-24 18:50:03 +0200629 return CCommandHandler::ESucceeded;
Patrick Benavoli592ae562011-09-05 16:53:58 +0200630}
631
Patrick Benavoli68a91282011-08-31 11:23:23 +0200632/// Status
Patrick Benavoli63499d42011-10-24 18:50:03 +0200633CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::statusCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200634{
635 (void)remoteCommand;
636 // System class
637 const CSystemClass* pSystemClass = getSystemClass();
638
Patrick Benavoli68a91282011-08-31 11:23:23 +0200639 // Show status
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200640 /// General section
641 appendTitle(strResult, "General:");
642 // System class
Patrick Benavoli68a91282011-08-31 11:23:23 +0200643 strResult += "System Class: ";
644 strResult += pSystemClass->getName();
645 strResult += "\n";
646
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200647 // Tuning mode
Patrick Benavoli68a91282011-08-31 11:23:23 +0200648 strResult += "Tuning Mode: ";
649 strResult += tuningModeOn() ? "on" : "off";
650 strResult += "\n";
651
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200652 // Value space
Patrick Benavoli68a91282011-08-31 11:23:23 +0200653 strResult += "Value Space: ";
654 strResult += valueSpaceIsRaw() ? "raw" : "real";
655 strResult += "\n";
656
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200657 // Output raw format
658 strResult += "Output Raw Format: ";
659 strResult += outputRawFormatIsHex() ? "hex" : "dec";
660 strResult += "\n";
661
662 // Auto Sync
Patrick Benavoli68a91282011-08-31 11:23:23 +0200663 strResult += "Auto Sync: ";
664 strResult += autoSyncOn() ? "on" : "off";
665 strResult += "\n";
666
667 /// Subsystem list
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200668 appendTitle(strResult, "Subsystems:");
Patrick Benavoli68a91282011-08-31 11:23:23 +0200669 string strSubsystemList;
670 pSystemClass->listChildrenPaths(strSubsystemList);
671 strResult += strSubsystemList;
672
673 /// Last applied configurations
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200674 appendTitle(strResult, "Last applied configurations:");
Patrick Benavoli68a91282011-08-31 11:23:23 +0200675 string strLastAppliedConfigurations;
676 getConfigurableDomains()->listLastAppliedConfigurations(strLastAppliedConfigurations);
677 strResult += strLastAppliedConfigurations;
678
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200679 /// Criteria states
680 appendTitle(strResult, "Selection criteria:");
681 string strSelectionCriteria;
682 getSelectionCriteria()->listSelectionCriteria(strSelectionCriteria, false);
683 strResult += strSelectionCriteria;
684
Patrick Benavoli63499d42011-10-24 18:50:03 +0200685 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200686}
687
688/// Tuning Mode
Patrick Benavoli63499d42011-10-24 18:50:03 +0200689CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setTuningModeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200690{
691 if (remoteCommand.getArgument(0) == "on") {
692
693 if (setTuningMode(true, strResult)) {
694
Patrick Benavoli63499d42011-10-24 18:50:03 +0200695 return CCommandHandler::EDone;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200696 }
697 } else if (remoteCommand.getArgument(0) == "off") {
698
699 if (setTuningMode(false, strResult)) {
700
Patrick Benavoli63499d42011-10-24 18:50:03 +0200701 return CCommandHandler::EDone;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200702 }
703 } else {
704 // Show usage
Patrick Benavoli63499d42011-10-24 18:50:03 +0200705 return CCommandHandler::EShowUsage;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200706 }
Patrick Benavoli63499d42011-10-24 18:50:03 +0200707 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200708}
709
Patrick Benavoli63499d42011-10-24 18:50:03 +0200710CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getTuningModeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200711{
712 (void)remoteCommand;
713
714 strResult = tuningModeOn() ? "on" : "off";
715
Patrick Benavoli63499d42011-10-24 18:50:03 +0200716 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200717}
718
719/// Value Space
Patrick Benavoli63499d42011-10-24 18:50:03 +0200720CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setValueSpaceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200721{
722 (void)strResult;
723
724 if (remoteCommand.getArgument(0) == "raw") {
725
726 setValueSpace(true);
727
Patrick Benavoli63499d42011-10-24 18:50:03 +0200728 return CCommandHandler::EDone;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200729
730 } else if (remoteCommand.getArgument(0) == "real") {
731
732 setValueSpace(false);
733
Patrick Benavoli63499d42011-10-24 18:50:03 +0200734 return CCommandHandler::EDone;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200735
736 } else {
737 // Show usage
Patrick Benavoli63499d42011-10-24 18:50:03 +0200738 return CCommandHandler::EShowUsage;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200739 }
Patrick Benavoli63499d42011-10-24 18:50:03 +0200740 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200741}
742
Patrick Benavoli63499d42011-10-24 18:50:03 +0200743CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getValueSpaceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200744{
745 (void)remoteCommand;
746
747 strResult = valueSpaceIsRaw() ? "raw" : "real";
748
Patrick Benavoli63499d42011-10-24 18:50:03 +0200749 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200750}
751
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200752/// Output Raw Format
Patrick Benavoli63499d42011-10-24 18:50:03 +0200753CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setOutputRawFormatCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200754{
755 (void)strResult;
756
757 if (remoteCommand.getArgument(0) == "hex") {
758
759 setOutputRawFormat(true);
760
Patrick Benavoli63499d42011-10-24 18:50:03 +0200761 return CCommandHandler::EDone;
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200762
763 } else if (remoteCommand.getArgument(0) == "dec") {
764
765 setOutputRawFormat(false);
766
Patrick Benavoli63499d42011-10-24 18:50:03 +0200767 return CCommandHandler::EDone;
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200768
769 } else {
770 // Show usage
Patrick Benavoli63499d42011-10-24 18:50:03 +0200771 return CCommandHandler::EShowUsage;
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200772 }
Patrick Benavoli63499d42011-10-24 18:50:03 +0200773 return CCommandHandler::EFailed;
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200774}
775
Patrick Benavoli63499d42011-10-24 18:50:03 +0200776CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getOutputRawFormatCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200777{
778 (void)remoteCommand;
779
780 strResult = outputRawFormatIsHex() ? "hex" : "dec";
781
Patrick Benavoli63499d42011-10-24 18:50:03 +0200782 return CCommandHandler::ESucceeded;
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200783}
784
Patrick Benavoli68a91282011-08-31 11:23:23 +0200785/// Sync
Patrick Benavoli63499d42011-10-24 18:50:03 +0200786CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setAutoSyncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200787{
788 if (remoteCommand.getArgument(0) == "on") {
789
790 if (setAutoSync(true, strResult)) {
791
Patrick Benavoli63499d42011-10-24 18:50:03 +0200792 return CCommandHandler::EDone;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200793 }
794 } else if (remoteCommand.getArgument(0) == "off") {
795
796 if (setAutoSync(false, strResult)) {
797
Patrick Benavoli63499d42011-10-24 18:50:03 +0200798 return CCommandHandler::EDone;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200799 }
800 } else {
801 // Show usage
Patrick Benavoli63499d42011-10-24 18:50:03 +0200802 return CCommandHandler::EShowUsage;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200803 }
Patrick Benavoli63499d42011-10-24 18:50:03 +0200804 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200805}
806
Patrick Benavoli63499d42011-10-24 18:50:03 +0200807CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getAutoSyncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200808{
809 (void)remoteCommand;
810
811 strResult = autoSyncOn() ? "on" : "off";
812
Patrick Benavoli63499d42011-10-24 18:50:03 +0200813 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200814}
815
Patrick Benavoli63499d42011-10-24 18:50:03 +0200816CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::syncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200817{
818 (void)remoteCommand;
819
Patrick Benavoli63499d42011-10-24 18:50:03 +0200820 return sync(strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200821}
822
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200823/// Criteria
Patrick Benavoli63499d42011-10-24 18:50:03 +0200824CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listCriteriaCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200825{
826 (void)remoteCommand;
827
828 getSelectionCriteria()->listSelectionCriteria(strResult, true);
829
Patrick Benavoli63499d42011-10-24 18:50:03 +0200830 return CCommandHandler::ESucceeded;
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200831}
Patrick Benavoli68a91282011-08-31 11:23:23 +0200832
833/// Domains
Patrick Benavoli63499d42011-10-24 18:50:03 +0200834CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200835{
836 (void)remoteCommand;
837
Patrick Benavoli63499d42011-10-24 18:50:03 +0200838 getConfigurableDomains()->listDomains(strResult);
Patrick Benavoli68a91282011-08-31 11:23:23 +0200839
Patrick Benavoli63499d42011-10-24 18:50:03 +0200840 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200841}
842
Patrick Benavoli63499d42011-10-24 18:50:03 +0200843CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::createDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200844{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200845 return createDomain(remoteCommand.getArgument(0), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200846}
847
Patrick Benavoli63499d42011-10-24 18:50:03 +0200848CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200849{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200850 return deleteDomain(remoteCommand.getArgument(0), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200851}
852
Patrick Benavoli63499d42011-10-24 18:50:03 +0200853CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200854{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200855 return getConfigurableDomains()->renameDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200856}
857
Patrick Benavoli63499d42011-10-24 18:50:03 +0200858CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200859{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200860 // Check tuning mode
861 if (!checkTuningModeOn(strResult)) {
862
863 return CCommandHandler::EFailed;
864 }
865
866 // Set property
867 bool bSequenceAware;
868
869 if (remoteCommand.getArgument(1) == "true") {
870
871 bSequenceAware = true;
872
873 } else if (remoteCommand.getArgument(1) == "false") {
874
875 bSequenceAware = false;
876
877 } else {
878 // Show usage
879 return CCommandHandler::EShowUsage;
880 }
881
882 return getConfigurableDomains()->setSequenceAwareness(remoteCommand.getArgument(0), bSequenceAware, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200883}
884
Patrick Benavoli63499d42011-10-24 18:50:03 +0200885CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200886{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200887 // Get property
888 bool bSequenceAware;
889
890 if (!getConfigurableDomains()->getSequenceAwareness(remoteCommand.getArgument(0), bSequenceAware, strResult)) {
891
892 return CCommandHandler::EFailed;
893 }
894
895 strResult = bSequenceAware ? "true" : "false";
896
897 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200898}
899
Patrick Benavoli63499d42011-10-24 18:50:03 +0200900CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listDomainElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200901{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200902 return getConfigurableDomains()->listDomainElements(remoteCommand.getArgument(0), strResult) ? CCommandHandler::ESucceeded : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200903}
904
Patrick Benavoli63499d42011-10-24 18:50:03 +0200905CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::addElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200906{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200907 return addConfigurableElementToDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
908}
909
910CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::removeElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
911{
912 return removeConfigurableElementFromDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
913}
914
915CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::splitDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
916{
917 return split(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200918}
919
920/// Configurations
Patrick Benavoli63499d42011-10-24 18:50:03 +0200921CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listConfigurationsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200922{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200923 return getConfigurableDomains()->listConfigurations(remoteCommand.getArgument(0), strResult) ? CCommandHandler::ESucceeded : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200924}
925
Patrick Benavoli63499d42011-10-24 18:50:03 +0200926CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::createConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200927{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200928 return createConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200929}
930
Patrick Benavoli63499d42011-10-24 18:50:03 +0200931CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200932{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200933 return deleteConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200934}
935
Patrick Benavoli63499d42011-10-24 18:50:03 +0200936CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::renameConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200937{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200938 return getConfigurableDomains()->renameConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1), remoteCommand.getArgument(2), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200939}
940
Patrick Benavoli63499d42011-10-24 18:50:03 +0200941CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::saveConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200942{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200943 return saveConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200944}
945
Patrick Benavoli63499d42011-10-24 18:50:03 +0200946CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::restoreConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200947{
Patrick Benavoli63499d42011-10-24 18:50:03 +0200948 return restoreConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
949}
950
951CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setElementSequenceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
952{
953 // Check tuning mode
954 if (!checkTuningModeOn(strResult)) {
955
956 return CCommandHandler::EFailed;
957 }
958
959 // Build configurable element path list
960 vector<string> astrNewElementSequence;
961
962 uint32_t uiArgument;
963
964 for (uiArgument = 2; uiArgument < remoteCommand.getArgumentCount(); uiArgument++) {
965
966 astrNewElementSequence.push_back(remoteCommand.getArgument(uiArgument));
967 }
968
969 // Delegate to configurable domains
970 return getConfigurableDomains()->setElementSequence(remoteCommand.getArgument(0), remoteCommand.getArgument(1), astrNewElementSequence, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
971}
972
973CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementSequenceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
974{
975 // Delegate to configurable domains
976 return getConfigurableDomains()->getElementSequence(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::ESucceeded : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200977}
978
979/// Elements/Parameters
Patrick Benavoli63499d42011-10-24 18:50:03 +0200980CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +0200981{
982 CElementLocator elementLocator(getSystemClass(), false);
983
984 CElement* pLocatedElement = NULL;
985
986 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
987
Patrick Benavoli63499d42011-10-24 18:50:03 +0200988 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200989 }
990
991 strResult = string("\n");
992
993 if (!pLocatedElement) {
994
995 // List from root folder
996
997 // Return system class qualified name
998 pLocatedElement = getSystemClass();
999 }
1000
1001 // Return sub-elements
1002 strResult += pLocatedElement->listQualifiedPaths(false);
1003
Patrick Benavoli63499d42011-10-24 18:50:03 +02001004 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001005}
1006
1007/// Elements/Parameters
Patrick Benavoli63499d42011-10-24 18:50:03 +02001008CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listParametersCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001009{
1010 CElementLocator elementLocator(getSystemClass(), false);
1011
1012 CElement* pLocatedElement = NULL;
1013
1014 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
1015
Patrick Benavoli63499d42011-10-24 18:50:03 +02001016 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001017 }
1018
1019 strResult = string("\n");
1020
1021 if (!pLocatedElement) {
1022
1023 // List from root folder
1024
1025 // Return system class qualified name
1026 pLocatedElement = getSystemClass();
1027 }
1028
1029 // Return sub-elements
1030 strResult += pLocatedElement->listQualifiedPaths(true);
1031
Patrick Benavoli63499d42011-10-24 18:50:03 +02001032 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001033}
1034
Patrick Benavoli63499d42011-10-24 18:50:03 +02001035CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::dumpElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001036{
1037 CElementLocator elementLocator(getSystemClass());
1038
1039 CElement* pLocatedElement = NULL;
1040
1041 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
1042
Patrick Benavoli63499d42011-10-24 18:50:03 +02001043 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001044 }
1045
1046 string strError;
1047
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001048 CParameterAccessContext parameterAccessContext(strError, _pMainParameterBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex);
Patrick Benavoli68a91282011-08-31 11:23:23 +02001049
1050 // Dump elements
1051 pLocatedElement->dumpContent(strResult, parameterAccessContext);
1052
Patrick Benavoli63499d42011-10-24 18:50:03 +02001053 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001054}
1055
Patrick Benavoli63499d42011-10-24 18:50:03 +02001056CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementSizeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001057{
1058 CElementLocator elementLocator(getSystemClass());
1059
1060 CElement* pLocatedElement = NULL;
1061
1062 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
1063
Patrick Benavoli63499d42011-10-24 18:50:03 +02001064 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001065 }
1066
1067 // Converted to actual sizable element
1068 const CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1069
1070 // Get size as string
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001071 strResult = pConfigurableElement->getFootprintAsString();
Patrick Benavoli68a91282011-08-31 11:23:23 +02001072
Patrick Benavoli63499d42011-10-24 18:50:03 +02001073 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001074}
1075
Patrick Benavoli63499d42011-10-24 18:50:03 +02001076CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::showPropertiesCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli2ecf9002011-08-31 11:23:24 +02001077{
1078 CElementLocator elementLocator(getSystemClass());
1079
1080 CElement* pLocatedElement = NULL;
1081
1082 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
1083
Patrick Benavoli63499d42011-10-24 18:50:03 +02001084 return CCommandHandler::EFailed;
Patrick Benavoli2ecf9002011-08-31 11:23:24 +02001085 }
1086
1087 // Convert element
1088 const CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1089
1090 // Return element properties
1091 pConfigurableElement->showProperties(strResult);
1092
Patrick Benavoli63499d42011-10-24 18:50:03 +02001093 return CCommandHandler::ESucceeded;
Patrick Benavoli2ecf9002011-08-31 11:23:24 +02001094}
1095
Patrick Benavoli63499d42011-10-24 18:50:03 +02001096CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001097{
1098 string strValue;
1099
1100 if (!getValue(remoteCommand.getArgument(0), strValue, strResult)) {
1101
Patrick Benavoli63499d42011-10-24 18:50:03 +02001102 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001103 }
1104 // Succeeded
1105 strResult = strValue;
1106
Patrick Benavoli63499d42011-10-24 18:50:03 +02001107 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001108}
1109
Patrick Benavoli63499d42011-10-24 18:50:03 +02001110CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001111{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001112 return setValue(remoteCommand.getArgument(0), remoteCommand.packArguments(1, remoteCommand.getArgumentCount() - 1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001113}
1114
Patrick Benavoli63499d42011-10-24 18:50:03 +02001115CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listBelongingDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001116{
1117 CElementLocator elementLocator(getSystemClass());
1118
1119 CElement* pLocatedElement = NULL;
1120
1121 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
1122
Patrick Benavoli63499d42011-10-24 18:50:03 +02001123 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001124 }
1125
1126 // Convert element
1127 const CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1128
1129 // Return element belonging domains
1130 pConfigurableElement->listBelongingDomains(strResult);
1131
Patrick Benavoli63499d42011-10-24 18:50:03 +02001132 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001133}
1134
Patrick Benavoli63499d42011-10-24 18:50:03 +02001135CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listAssociatedDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001136{
1137 CElementLocator elementLocator(getSystemClass());
1138
1139 CElement* pLocatedElement = NULL;
1140
1141 if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) {
1142
Patrick Benavoli63499d42011-10-24 18:50:03 +02001143 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001144 }
1145
1146 // Convert element
1147 const CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1148
1149 // Return element belonging domains
1150 pConfigurableElement->listAssociatedDomains(strResult);
1151
Patrick Benavoli63499d42011-10-24 18:50:03 +02001152 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001153}
1154
Patrick Benavoli63499d42011-10-24 18:50:03 +02001155CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listAssociatedElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001156{
1157 (void)remoteCommand;
1158
1159 getConfigurableDomains()->listAssociatedElements(strResult);
1160
Patrick Benavoli63499d42011-10-24 18:50:03 +02001161 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001162}
1163
Patrick Benavoli63499d42011-10-24 18:50:03 +02001164CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listConflictingElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001165{
1166 (void)remoteCommand;
1167
1168 getConfigurableDomains()->listConflictingElements(strResult);
1169
Patrick Benavoli63499d42011-10-24 18:50:03 +02001170 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001171}
1172
Patrick Benavoli63499d42011-10-24 18:50:03 +02001173CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listRogueElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001174{
1175 (void)remoteCommand;
1176
1177 getSystemClass()->listRogueElements(strResult);
1178
Patrick Benavoli63499d42011-10-24 18:50:03 +02001179 return CCommandHandler::ESucceeded;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001180}
1181
1182/// Settings Import/Export
Patrick Benavoli63499d42011-10-24 18:50:03 +02001183CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::exportConfigurableDomainsToXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001184{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001185 return exportDomainsXml(remoteCommand.getArgument(0), false, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001186}
1187
Patrick Benavoli63499d42011-10-24 18:50:03 +02001188CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::importConfigurableDomainsFromXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001189{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001190 return importDomainsXml(remoteCommand.getArgument(0), false, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001191}
1192
Patrick Benavoli63499d42011-10-24 18:50:03 +02001193CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::exportConfigurableDomainsWithSettingsToXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001194{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001195 return exportDomainsXml(remoteCommand.getArgument(0), true, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001196}
1197
Patrick Benavoli63499d42011-10-24 18:50:03 +02001198CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::importConfigurableDomainsWithSettingsFromXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001199{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001200 return importDomainsXml(remoteCommand.getArgument(0), true, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001201}
1202
Patrick Benavoli63499d42011-10-24 18:50:03 +02001203CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::exportSettingsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001204{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001205 return exportDomainsBinary(remoteCommand.getArgument(0), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001206}
1207
Patrick Benavoli63499d42011-10-24 18:50:03 +02001208CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::importSettingsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
Patrick Benavoli68a91282011-08-31 11:23:23 +02001209{
Patrick Benavoli63499d42011-10-24 18:50:03 +02001210 return importDomainsBinary(remoteCommand.getArgument(0), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001211}
1212
1213// User set/get parameters
1214bool CParameterMgr::setValue(const string& strPath, const string& strValue, string& strError)
1215{
1216 // Check tuning mode
1217 if (!checkTuningModeOn(strError)) {
1218
1219 return false;
1220 }
1221
1222 CPathNavigator pathNavigator(strPath);
1223
1224 if (!pathNavigator.isPathValid()) {
1225
1226 strError = "Path not well formed";
1227
1228 return false;
1229 }
1230
1231 string* pStrChildName = pathNavigator.next();
1232
1233 if (!pStrChildName) {
1234
1235 strError = "Non settable element";
1236
1237 return false;
1238 }
1239
1240 if (*pStrChildName != getSystemClass()->getName()) {
1241
1242 strError = "Path not found";
1243
1244 return false;
1245 }
1246
1247 // Define context
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001248 CParameterAccessContext parameterAccessContext(strError, _pMainParameterBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex);
Patrick Benavoli68a91282011-08-31 11:23:23 +02001249
1250 // Set auto sync
1251 parameterAccessContext.setAutoSync(_bAutoSyncOn);
1252
1253 // Do the set
1254 return getSystemClass()->setValue(pathNavigator, strValue, parameterAccessContext);
1255}
1256
1257bool CParameterMgr::getValue(const string& strPath, string& strValue, string& strError) const
1258{
1259 CPathNavigator pathNavigator(strPath);
1260
1261 if (!pathNavigator.isPathValid()) {
1262
1263 strError = "Path not well formed";
1264
1265 return false;
1266 }
1267
1268 string* pStrChildName = pathNavigator.next();
1269
1270 if (!pStrChildName) {
1271
1272 strError = "Non settable element";
1273
1274 return false;
1275 }
1276
1277 if (*pStrChildName != getConstSystemClass()->getName()) {
1278
1279 strError = "Path not found";
1280
1281 return false;
1282 }
1283
1284 // Define context
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001285 CParameterAccessContext parameterAccessContext(strError, _pMainParameterBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex);
Patrick Benavoli68a91282011-08-31 11:23:23 +02001286
1287 // Do the get
1288 return getConstSystemClass()->getValue(pathNavigator, strValue, parameterAccessContext);
1289}
1290
1291// Tuning mode
1292bool CParameterMgr::setTuningMode(bool bOn, string& strError)
1293{
1294 // Tuning allowed?
1295 if (bOn && !_pSystemClassConfiguration->isTuningAllowed()) {
1296
1297 strError = "Tuning prohibited";
1298
1299 return false;
1300 }
1301 // Lock state
Patrick Benavoli1387bda2011-08-31 11:23:24 +02001302 CAutoLock autoLock(&_tuningModeMutex);
Patrick Benavoli68a91282011-08-31 11:23:23 +02001303
1304 // Warn domains about exiting tuning mode
1305 if (!bOn && _bTuningModeIsOn) {
1306
1307 // Ensure application of currently selected configurations
Patrick Benavoli1387bda2011-08-31 11:23:24 +02001308 // Force-apply configurations
Patrick Benavoli68a91282011-08-31 11:23:23 +02001309 if (!getConfigurableDomains()->apply(_pMainParameterBlackboard, true, strError)) {
1310
1311 return false;
1312 }
1313 // Turn auto sync back on
1314 _bAutoSyncOn = true;
1315 }
1316
1317 // Store
1318 _bTuningModeIsOn = bOn;
1319
Patrick Benavoli68a91282011-08-31 11:23:23 +02001320 return true;
1321}
1322
1323bool CParameterMgr::tuningModeOn() const
1324{
1325 return _bTuningModeIsOn;
1326}
1327
1328// Current value space for user set/get value interpretation
1329void CParameterMgr::setValueSpace(bool bIsRaw)
1330{
1331 _bValueSpaceIsRaw = bIsRaw;
1332}
1333
1334bool CParameterMgr::valueSpaceIsRaw()
1335{
1336 return _bValueSpaceIsRaw;
1337}
1338
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001339// Current Output Raw Format for user get value interpretation
1340void CParameterMgr::setOutputRawFormat(bool bIsHex)
1341{
1342 _bOutputRawFormatIsHex = bIsHex;
1343}
1344
1345bool CParameterMgr::outputRawFormatIsHex()
1346{
1347 return _bOutputRawFormatIsHex;
1348}
1349
Patrick Benavoli68a91282011-08-31 11:23:23 +02001350/// Sync
1351// Automatic hardware synchronization control (during tuning session)
1352bool CParameterMgr::setAutoSync(bool bAutoSyncOn, string& strError)
1353{
1354 // Check tuning mode
1355 if (!checkTuningModeOn(strError)) {
1356
1357 return false;
1358 }
1359 // Warn domains about turning auto sync back on
1360 if (bAutoSyncOn && !_bAutoSyncOn) {
1361
Patrick Benavoli592ae562011-09-05 16:53:58 +02001362 // Do the synchronization at system class level (could be optimized by keeping track of all modified parameters)
1363 if (!sync(strError)) {
Patrick Benavoli68a91282011-08-31 11:23:23 +02001364
1365 return false;
1366 }
1367 }
1368
1369 // Set Auto sync
1370 _bAutoSyncOn = bAutoSyncOn;
1371
1372 return true;
1373}
1374
1375bool CParameterMgr::autoSyncOn() const
1376{
1377 return _bAutoSyncOn;
1378}
1379
1380// Manual hardware synchronization control (during tuning session)
1381bool CParameterMgr::sync(string& strError)
1382{
1383 // Check tuning mode
1384 if (!checkTuningModeOn(strError)) {
1385
1386 return false;
1387 }
1388 // Warn domains about turning auto sync back on
1389 if (_bAutoSyncOn) {
1390
1391 strError = "Feature unavailable when Auto Sync is on";
1392
1393 return false;
1394 }
1395
1396 // Get syncer set
1397 CSyncerSet syncerSet;
1398 // ... from system class
1399 getConstSystemClass()->fillSyncerSet(syncerSet);
1400 // Sync
1401 return syncerSet.sync(*_pMainParameterBlackboard, false, strError);
1402}
1403
1404// Content dump
1405void CParameterMgr::logStructureContent(string& strContent) const
1406{
1407 string strError;
1408
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001409 CParameterAccessContext parameterAccessContext(strError, _pMainParameterBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex);
Patrick Benavoli68a91282011-08-31 11:23:23 +02001410
1411 dumpContent(strContent, parameterAccessContext);
1412}
1413
1414// Configuration/Domains handling
1415bool CParameterMgr::createDomain(const string& strName, string& strError)
1416{
1417 // Check tuning mode
1418 if (!checkTuningModeOn(strError)) {
1419
1420 return false;
1421 }
1422
1423 // Delegate to configurable domains
1424 return getConfigurableDomains()->createDomain(strName, strError);
1425}
1426
1427bool CParameterMgr::deleteDomain(const string& strName, string& strError)
1428{
1429 // Check tuning mode
1430 if (!checkTuningModeOn(strError)) {
1431
1432 return false;
1433 }
1434
1435 // Delegate to configurable domains
1436 return getConfigurableDomains()->deleteDomain(strName, strError);
1437}
1438
1439bool CParameterMgr::createConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
1440{
1441 // Check tuning mode
1442 if (!checkTuningModeOn(strError)) {
1443
1444 return false;
1445 }
1446
1447 // Delegate to configurable domains
1448 return getConfigurableDomains()->createConfiguration(strDomain, strConfiguration, _pMainParameterBlackboard, strError);
1449}
1450
1451bool CParameterMgr::deleteConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
1452{
1453 // Check tuning mode
1454 if (!checkTuningModeOn(strError)) {
1455
1456 return false;
1457 }
1458
1459 // Delegate to configurable domains
1460 return getConfigurableDomains()->deleteConfiguration(strDomain, strConfiguration, strError);
1461}
1462
1463bool CParameterMgr::restoreConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
1464{
1465 // Check tuning mode
1466 if (!checkTuningModeOn(strError)) {
1467
1468 return false;
1469 }
1470
1471 // Delegate to configurable domains
1472 return getConfigurableDomains()->restoreConfiguration(strDomain, strConfiguration, _pMainParameterBlackboard, _bAutoSyncOn, strError);
1473}
1474
1475bool CParameterMgr::saveConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
1476{
1477 // Check tuning mode
1478 if (!checkTuningModeOn(strError)) {
1479
1480 return false;
1481 }
1482
1483 // Delegate to configurable domains
1484 return getConfigurableDomains()->saveConfiguration(strDomain, strConfiguration, _pMainParameterBlackboard, strError);
1485}
1486
1487// Configurable element - domain association
1488bool CParameterMgr::addConfigurableElementToDomain(const string& strDomain, const string& strConfigurableElementPath, string& strError)
1489{
1490 // Check tuning mode
1491 if (!checkTuningModeOn(strError)) {
1492
1493 return false;
1494 }
1495
1496 CElementLocator elementLocator(getSystemClass());
1497
1498 CElement* pLocatedElement = NULL;
1499
1500 if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) {
1501
1502 return false;
1503 }
1504
1505 // Convert element
1506 CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1507
1508 // Delegate
1509 return getConfigurableDomains()->addConfigurableElementToDomain(strDomain, pConfigurableElement, _pMainParameterBlackboard, strError);
1510}
1511
1512bool CParameterMgr::removeConfigurableElementFromDomain(const string& strDomain, const string& strConfigurableElementPath, string& strError)
1513{
1514 // Check tuning mode
1515 if (!checkTuningModeOn(strError)) {
1516
1517 return false;
1518 }
1519
1520 CElementLocator elementLocator(getSystemClass());
1521
1522 CElement* pLocatedElement = NULL;
1523
1524 if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) {
1525
Patrick Benavoli63499d42011-10-24 18:50:03 +02001526 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001527 }
1528
1529 // Convert element
1530 CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1531
1532 // Delegate
1533 return getConfigurableDomains()->removeConfigurableElementFromDomain(strDomain, pConfigurableElement, strError);
1534}
1535
1536bool CParameterMgr::split(const string& strDomain, const string& strConfigurableElementPath, string& strError)
1537{
1538 // Check tuning mode
1539 if (!checkTuningModeOn(strError)) {
1540
1541 return false;
1542 }
1543
1544 CElementLocator elementLocator(getSystemClass());
1545
1546 CElement* pLocatedElement = NULL;
1547
1548 if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) {
1549
Patrick Benavoli63499d42011-10-24 18:50:03 +02001550 return CCommandHandler::EFailed;
Patrick Benavoli68a91282011-08-31 11:23:23 +02001551 }
1552
1553 // Convert element
1554 CConfigurableElement* pConfigurableElement = static_cast<const CConfigurableElement*>(pLocatedElement);
1555
1556 // Delegate
1557 return getConfigurableDomains()->split(strDomain, pConfigurableElement, strError);
1558}
1559
1560// XML Import/Export
1561bool CParameterMgr::importDomainsXml(const string& strFileName, bool bWithSettings, string& strError)
1562{
1563 // Check tuning mode
1564 if (!checkTuningModeOn(strError)) {
1565
1566 return false;
1567 }
1568
1569 // check path is absolute
1570 if (strFileName[0] != '/') {
1571
1572 strError = "Please provide absolute path";
1573
1574 return false;
1575 }
1576 // Root element
1577 CConfigurableDomains* pConfigurableDomains = getConfigurableDomains();
1578
1579 // Context
1580 CXmlDomainSerializingContext xmlDomainSerializingContext(strError, bWithSettings);
1581
1582 // Secltion criteria definition for rule creation
1583 xmlDomainSerializingContext.setSelectionCriteriaDefinition(getConstSelectionCriteria()->getSelectionCriteriaDefinition());
1584
1585 // Parse
1586 if (!xmlParse(xmlDomainSerializingContext, pConfigurableDomains, strFileName, "", EParameterConfigurationLibrary, "SystemClassName")) {
1587
1588 return false;
1589 }
1590
1591 // Validate domains after XML import
1592 pConfigurableDomains->validate(_pMainParameterBlackboard);
1593
1594 return true;
1595}
1596
1597bool CParameterMgr::exportDomainsXml(const string& strFileName, bool bWithSettings, string& strError) const
1598{
1599 // check path is absolute
1600 if (strFileName[0] != '/') {
1601
1602 strError = "Please provide absolute path";
1603
1604 return false;
1605 }
1606
1607 // Root element
1608 const CConfigurableDomains* pConfigurableDomains = getConstConfigurableDomains();
1609
1610 // Get Schema file associated to root element
1611 string strXmlSchemaFilePath = _strSchemaFolderLocation + "/" + pConfigurableDomains->getKind() + ".xsd";
1612
1613 // Context
1614 CXmlDomainSerializingContext xmlDomainSerializingContext(strError, bWithSettings);
1615
1616 // Value space
1617 xmlDomainSerializingContext.setValueSpaceRaw(_bValueSpaceIsRaw);
1618
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001619 // Output raw format
1620 xmlDomainSerializingContext.setOutputRawFormat(_bOutputRawFormatIsHex);
1621
Patrick Benavoli68a91282011-08-31 11:23:23 +02001622 // Instantiate composer
1623 CXmlComposer xmlComposer(strFileName, strXmlSchemaFilePath, pConfigurableDomains->getKind(), xmlDomainSerializingContext);
1624
1625 // Open composer
1626 if (!xmlComposer.open()) {
1627
1628 return false;
1629 }
1630
1631 // Compose
Patrick Benavoli63499d42011-10-24 18:50:03 +02001632 xmlComposer.compose(pConfigurableDomains, "parameter-framework", getVersion());
Patrick Benavoli68a91282011-08-31 11:23:23 +02001633
1634 // Close composer
1635 if (!xmlComposer.close()) {
1636
1637 return false;
1638 }
1639
1640 return true;
1641}
1642
1643// Binary Import/Export
1644bool CParameterMgr::importDomainsBinary(const string& strFileName, string& strError)
1645{
1646 // Check tuning mode
1647 if (!checkTuningModeOn(strError)) {
1648
1649 return false;
1650 }
1651 // check path is absolute
1652 if (strFileName[0] != '/') {
1653
1654 strError = "Please provide absolute path";
1655
1656 return false;
1657 }
1658 // Root element
1659 CConfigurableDomains* pConfigurableDomains = getConfigurableDomains();
1660
1661 // Serialize in
1662 return pConfigurableDomains->serializeSettings(strFileName, false, _uiStructureChecksum, strError);
1663}
1664
1665bool CParameterMgr::exportDomainsBinary(const string& strFileName, string& strError)
1666{
1667 // check path is absolute
1668 if (strFileName[0] != '/') {
1669
1670 strError = "Please provide absolute path";
1671
1672 return false;
1673 }
Patrick Benavoli68a91282011-08-31 11:23:23 +02001674
Patrick Benavoli68a91282011-08-31 11:23:23 +02001675 // Root element
1676 CConfigurableDomains* pConfigurableDomains = getConfigurableDomains();
1677
1678 // Serialize out
1679 return pConfigurableDomains->serializeSettings(strFileName, true, _uiStructureChecksum, strError);
1680}
1681
1682// For tuning, check we're in tuning mode
1683bool CParameterMgr::checkTuningModeOn(string& strError) const
1684{
1685 // Tuning Mode on?
1686 if (!_bTuningModeIsOn) {
1687
1688 strError = "Tuning Mode must be on";
1689
1690 return false;
1691 }
1692 return true;
1693}
1694
1695// Dynamic creation library feeding
1696void CParameterMgr::feedElementLibraries()
1697{
1698 // Global Configuration handling
1699 CElementLibrary* pFrameworkConfigurationLibrary = new CElementLibrary;
1700
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001701 pFrameworkConfigurationLibrary->addElementBuilder(new TElementBuilderTemplate<CParameterFrameworkConfiguration>("ParameterFrameworkConfiguration"));
1702 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationGroup>("SubsystemPluginFolders"));
1703 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationLocation>("PluginFolderLocation"));
1704 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationGroup>("ParameterConfiguration"));
1705 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CSystemClassConfiguration>("SystemClassConfiguration"));
1706 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationLocation>("StructureDescriptionFileLocation"));
1707 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationGroup>("SettingsConfiguration"));
1708 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationLocation>("ConfigurableDomainsFileLocation"));
1709 pFrameworkConfigurationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CFrameworkConfigurationLocation>("BinarySettingsFileLocation"));
Patrick Benavoli68a91282011-08-31 11:23:23 +02001710
1711 _pElementLibrarySet->addElementLibrary(pFrameworkConfigurationLibrary);
1712
1713 // Parameter creation
1714 CElementLibrary* pParameterCreationLibrary = new CElementLibrary;
1715
1716 pParameterCreationLibrary->addElementBuilder(new CSubsystemElementBuilder(getSystemClass()->getSubsystemLibrary()));
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001717 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CComponentType>("ComponentType"));
1718 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CComponentInstance>("Component"));
1719 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CBitParameterType>("BitParameter"));
1720 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CBitParameterBlockType>("BitParameterBlock"));
Patrick Benavoli1352ae52011-10-21 16:48:04 +02001721 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CStringParameterType>("StringParameter"));
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001722 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CParameterBlockType>("ParameterBlock"));
1723 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CBooleanParameterType>("BooleanParameter"));
1724 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CIntegerParameterType>("IntegerParameter"));
1725 pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CFixedPointParameterType>("FixedPointParameter"));
1726 pParameterCreationLibrary->addElementBuilder(new TKindElementBuilderTemplate<CXmlFileIncluderElement>("SubsystemInclude"));
Patrick Benavoli68a91282011-08-31 11:23:23 +02001727
1728 _pElementLibrarySet->addElementLibrary(pParameterCreationLibrary);
1729
1730 // Parameter Configuration Domains creation
1731 CElementLibrary* pParameterConfigurationLibrary = new CElementLibrary;
1732
Patrick Benavoli6ba361d2011-08-31 11:23:24 +02001733 pParameterConfigurationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CConfigurableDomain>("ConfigurableDomain"));
1734 pParameterConfigurationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CDomainConfiguration>("Configuration"));
1735 pParameterConfigurationLibrary->addElementBuilder(new TElementBuilderTemplate<CCompoundRule>("CompoundRule"));
1736 pParameterConfigurationLibrary->addElementBuilder(new TElementBuilderTemplate<CSelectionCriterionRule>("SelectionCriterionRule"));
Patrick Benavoli68a91282011-08-31 11:23:23 +02001737
1738 _pElementLibrarySet->addElementLibrary(pParameterConfigurationLibrary);
1739}
1740
1741// Remote Processor Server connection handling
1742bool CParameterMgr::handleRemoteProcessingInterface(string& strError)
1743{
1744 CAutoLog autoLog(this, "Handling remote processing interface");
1745
1746 // Start server if tuning allowed
1747 if (_pSystemClassConfiguration->isTuningAllowed()) {
1748
1749 log("Loading remote processor library");
1750
1751 // Load library
1752 void* lib_handle = dlopen("libremote-processor.so", RTLD_NOW);
1753
1754 if (!lib_handle) {
1755
1756 // Return error
1757 const char* pcError = dlerror();
1758
1759 if (pcError) {
1760
1761 strError = pcError;
1762 } else {
1763
1764 strError = "Unable to load libremote-processor.so library";
1765 }
1766
1767 return false;
1768 }
1769
1770 CreateRemoteProcessorServer pfnCreateRemoteProcessorServer = (CreateRemoteProcessorServer)dlsym(lib_handle, "createRemoteProcessorServer");
1771
1772 if (!pfnCreateRemoteProcessorServer) {
1773
1774 strError = "libremote-process.so does not contain createRemoteProcessorServer symbol.";
1775
1776 return false;
1777 }
1778
1779 // Create server
Patrick Benavoli63499d42011-10-24 18:50:03 +02001780 _pRemoteProcessorServer = pfnCreateRemoteProcessorServer(_pSystemClassConfiguration->getServerPort(), _pCommandHandler);
Patrick Benavoli68a91282011-08-31 11:23:23 +02001781
1782 log("Starting remote processor server on port %d", _pSystemClassConfiguration->getServerPort());
1783 // Start
1784 if (!_pRemoteProcessorServer->start()) {
1785
1786 strError = "Unable to start remote processor server";
1787
1788 return false;
1789 }
1790 }
1791
1792 return true;
1793}
1794
1795// Back synchronization
1796CBackSynchronizer* CParameterMgr::createBackSynchronizer(string& strError) const
1797{
1798#ifdef SIMULATION
1799 // In simulation, back synchronization of the blackboard won't probably work
1800 // We need to ensure though the blackboard is initialized with valid data
1801 return new CSimulatedBackSynchronizer(getConstSystemClass(), strError, _pMainParameterBlackboard);
1802#else
1803 // Real back synchronizer from subsystems
1804 return new CHardwareBackSynchronizer(getConstSystemClass(), strError, _pMainParameterBlackboard);
1805#endif
1806}
1807
1808// Children typwise access
1809CParameterFrameworkConfiguration* CParameterMgr::getFrameworkConfiguration()
1810{
1811 return static_cast<CParameterFrameworkConfiguration*>(getChild(EFrameworkConfiguration));
1812}
1813
1814const CParameterFrameworkConfiguration* CParameterMgr::getConstFrameworkConfiguration()
1815{
1816 return getFrameworkConfiguration();
1817}
1818
1819CSelectionCriteria* CParameterMgr::getSelectionCriteria()
1820{
1821 return static_cast<CSelectionCriteria*>(getChild(ESelectionCriteria));
1822}
1823
1824const CSelectionCriteria* CParameterMgr::getConstSelectionCriteria()
1825{
1826 return static_cast<const CSelectionCriteria*>(getChild(ESelectionCriteria));
1827}
1828
1829CSystemClass* CParameterMgr::getSystemClass()
1830{
1831 return static_cast<CSystemClass*>(getChild(ESystemClass));
1832}
1833
1834const CSystemClass* CParameterMgr::getConstSystemClass() const
1835{
1836 return static_cast<const CSystemClass*>(getChild(ESystemClass));
1837}
1838
1839// Configurable Domains
1840CConfigurableDomains* CParameterMgr::getConfigurableDomains()
1841{
1842 return static_cast<CConfigurableDomains*>(getChild(EConfigurableDomains));
1843}
1844
1845const CConfigurableDomains* CParameterMgr::getConstConfigurableDomains()
1846{
1847 return static_cast<const CConfigurableDomains*>(getChild(EConfigurableDomains));
1848}
1849
1850const CConfigurableDomains* CParameterMgr::getConstConfigurableDomains() const
1851{
1852 return static_cast<const CConfigurableDomains*>(getChild(EConfigurableDomains));
1853}