summaryrefslogtreecommitdiffstats
path: root/parameter/ParameterMgr.h
diff options
context:
space:
mode:
authorPatrick Benavoli <patrickx.benavoli@intel.com>2011-10-24 18:50:03 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-10 17:14:57 +0100
commit63499d4763e42d76bfd39b79871f611381d2d164 (patch)
tree3f16d13707ec60a8ff2bb320ffce0a0e0cc6d91e /parameter/ParameterMgr.h
parentcfb64dd41410d363fe2e24faf6cd33c9e846b401 (diff)
downloadexternal_parameter-framework-63499d4763e42d76bfd39b79871f611381d2d164.zip
external_parameter-framework-63499d4763e42d76bfd39b79871f611381d2d164.tar.gz
external_parameter-framework-63499d4763e42d76bfd39b79871f611381d2d164.tar.bz2
parameter-framework: Sequence
BZ: 13152 - Introduced sequence notion in configurations: Sequences are configuration specific and are controlled from the Settings related XML files (order of settings appearance) as well as from the tuning interface (new commands available to set and get the sequence (setElementSequence / getElementSequence). Notes: - sequences will only matter for domains which new "SequenceAware" attribute is set to true (false by default). This attribute is also controlable through the tuning interface (setSequenceAware / getSequenceAware commands). - sequence unaware domain configurations will be applied before sequence aware ones. To allow for such functionality, the XML for settings format had to be reworked, leading to an unfortunate compatibility break. However, one benefit is that now a clear Settings section appears at the bottom of the domain description, which is easier to maintain than the previous structure where the settings appeared as sub-nodes of associated elements. Change-Id: Ic93552fd510ed8847f9c8e7d9d6164f7ea3c8c45 Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com> Reviewed-on: http://android.intel.com:8080/22558 Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com> Reviewed-on: http://android.intel.com:8080/26780 Reviewed-by: Barthes, FabienX <fabienx.barthes@intel.com>
Diffstat (limited to 'parameter/ParameterMgr.h')
-rw-r--r--parameter/ParameterMgr.h128
1 files changed, 60 insertions, 68 deletions
diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h
index 4596843..ef2bd90 100644
--- a/parameter/ParameterMgr.h
+++ b/parameter/ParameterMgr.h
@@ -31,7 +31,7 @@
#pragma once
#include <pthread.h>
-#include "RemoteCommandHandler.h"
+#include "RemoteCommandHandlerTemplate.h"
#include "PathNavigator.h"
#include "SelectionCriterionType.h"
#include "SelectionCriterion.h"
@@ -51,7 +51,7 @@ class CConfigurableDomains;
class IRemoteProcessorServerInterface;
class CBackSynchronizer;
-class CParameterMgr : private CElement, private IRemoteCommandHandler
+class CParameterMgr : private CElement
{
enum ChildElement {
EFrameworkConfiguration,
@@ -64,16 +64,10 @@ class CParameterMgr : private CElement, private IRemoteCommandHandler
EParameterCreationLibrary,
EParameterConfigurationLibrary
};
- // Remote command execution status
- enum CommandStatus {
- EDone,
- ESucceeded,
- EFailed,
- EShowUsgae
- };
+ typedef TRemoteCommandHandlerTemplate<CParameterMgr> CCommandHandler;
// Remote command parsers
- typedef CommandStatus (CParameterMgr::*RemoteCommandParser)(const IRemoteCommand& remoteCommand, string& strResult);
+ typedef CCommandHandler::CommandStatus (CParameterMgr::*RemoteCommandParser)(const IRemoteCommand& remoteCommand, string& strResult);
// Parser descriptions
struct SRemoteCommandParserItem
@@ -83,18 +77,11 @@ class CParameterMgr : private CElement, private IRemoteCommandHandler
uint32_t _uiMinArgumentCount;
const char* _pcHelp;
const char* _pcDescription;
-
- // Usage
- string usage() const
- {
- return string(_pcCommandName) + " " + _pcHelp;
- }
};
-
// Version
- static const uint32_t guiEditionMajor = 0x0;
- static const uint32_t guiEditionMinor = 0x2;
- static const uint32_t guiRevision = 0x1;
+ static const uint32_t guiEditionMajor = 0x1;
+ static const uint32_t guiEditionMinor = 0x0;
+ static const uint32_t guiRevision = 0x0;
public:
// Logger interface
class ILogger
@@ -180,68 +167,70 @@ private:
virtual void nestLog() const;
virtual void unnestLog() const;
- // From IRemoteCommandHandler: return true on success, fill result in any cases
- virtual bool remoteCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ // Version
+ string getVersion() const;
////////////////:: Remote command parsers
- /// Help
- CommandStatus helpCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Version
- CommandStatus versionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus versionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Status
- CommandStatus statusCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus statusCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Tuning Mode
- CommandStatus setTuningModeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus getTuningModeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setTuningModeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getTuningModeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Value Space
- CommandStatus setValueSpaceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus getValueSpaceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setValueSpaceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getValueSpaceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Output Raw Format
- CommandStatus setOutputRawFormatCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus getOutputRawFormatCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setOutputRawFormatCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getOutputRawFormatCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Sync
- CommandStatus setAutoSyncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus getAutoSyncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus syncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setAutoSyncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getAutoSyncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus syncCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Criteria
- CommandStatus listCriteriaCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listCriteriaCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Domains
- CommandStatus listDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus createDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus deleteDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus listDomainElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus addElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus removeElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus splitDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus createDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus deleteDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listDomainElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus addElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus removeElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus splitDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Configurations
- CommandStatus listConfigurationsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus createConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus deleteConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus renameConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus saveConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus restoreConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listConfigurationsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus createConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus deleteConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus renameConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus saveConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus restoreConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setElementSequenceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getElementSequenceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Elements/Parameters
- CommandStatus listElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus listParametersCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus dumpElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus getElementSizeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus showPropertiesCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus getParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus setParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus listBelongingDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus listAssociatedDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listParametersCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus dumpElementCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getElementSizeCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus showPropertiesCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus getParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus setParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listBelongingDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listAssociatedDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Browse
- CommandStatus listAssociatedElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus listConflictingElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus listRogueElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listAssociatedElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listConflictingElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus listRogueElementsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
/// Settings Import/Export
- CommandStatus exportConfigurableDomainsToXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus importConfigurableDomainsFromXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus exportConfigurableDomainsWithSettingsToXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus importConfigurableDomainsWithSettingsFromXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus exportSettingsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CommandStatus importSettingsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus exportConfigurableDomainsToXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus importConfigurableDomainsFromXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus exportConfigurableDomainsWithSettingsToXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus importConfigurableDomainsWithSettingsFromXMLCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus exportSettingsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus importSettingsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
// Max command usage length, use for formatting
void setMaxCommandUsageLength();
@@ -318,6 +307,9 @@ private:
// Whole system structure checksum
uint8_t _uiStructureChecksum;
+ // Command Handler
+ CCommandHandler* _pCommandHandler;
+
// Remote Processor Server
IRemoteProcessorServerInterface* _pRemoteProcessorServer;