summaryrefslogtreecommitdiffstats
path: root/parameter
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2015-01-06 14:52:49 +0100
committerDavid Wagner <david.wagner@intel.com>2015-01-22 12:02:31 +0100
commitd39b189e045353199ad852aaf2816c93864c7e88 (patch)
treef07f57550668189e6ca3687662c9de2272556b3f /parameter
parentfd21197b84f46ba53ace3a1b9d0c05596815dd51 (diff)
downloadexternal_parameter-framework-d39b189e045353199ad852aaf2816c93864c7e88.zip
external_parameter-framework-d39b189e045353199ad852aaf2816c93864c7e88.tar.gz
external_parameter-framework-d39b189e045353199ad852aaf2816c93864c7e88.tar.bz2
ParameterMgr: Add more tuning methods to the C++ public API
These methods are: - renameDomain - setSequenceAwareness - getSequenceAwareness - renameConfiguration - setElementSequence - setApplicationRule - getApplicationRule - clearApplicationRule The "remote tuning" methods are also modified to use them instead of directly accessing inner objects and the tuning mode checking is moved to the public C++ method when applicable. Change-Id: I9cdd0abbacb76232cd746878dca9ab619e8b6b58 Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'parameter')
-rw-r--r--parameter/ParameterMgr.cpp103
-rw-r--r--parameter/ParameterMgr.h17
2 files changed, 100 insertions, 20 deletions
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp
index 84a3fd4..1f38c50 100644
--- a/parameter/ParameterMgr.cpp
+++ b/parameter/ParameterMgr.cpp
@@ -1118,17 +1118,12 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteAllDomainsCom
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
- return getConfigurableDomains()->renameDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+ return renameDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ?
+ CCommandHandler::EDone : CCommandHandler::EFailed;
}
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
- // Check tuning mode
- if (!checkTuningModeOn(strResult)) {
-
- return CCommandHandler::EFailed;
- }
-
// Set property
bool bSequenceAware;
@@ -1145,7 +1140,8 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setSequenceAwarenes
return CCommandHandler::EShowUsage;
}
- return getConfigurableDomains()->setSequenceAwareness(remoteCommand.getArgument(0), bSequenceAware, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+ return setSequenceAwareness(remoteCommand.getArgument(0), bSequenceAware, strResult) ?
+ CCommandHandler::EDone : CCommandHandler::EFailed;
}
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
@@ -1153,7 +1149,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getSequenceAwarenes
// Get property
bool bSequenceAware;
- if (!getConfigurableDomains()->getSequenceAwareness(remoteCommand.getArgument(0), bSequenceAware, strResult)) {
+ if (!getSequenceAwareness(remoteCommand.getArgument(0), bSequenceAware, strResult)) {
return CCommandHandler::EFailed;
}
@@ -1215,7 +1211,9 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteConfiguration
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::renameConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
- return getConfigurableDomains()->renameConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1), remoteCommand.getArgument(2), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+ return renameConfiguration(remoteCommand.getArgument(0), remoteCommand.getArgument(1),
+ remoteCommand.getArgument(2), strResult) ?
+ CCommandHandler::EDone : CCommandHandler::EFailed;
}
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::saveConfigurationCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
@@ -1237,12 +1235,6 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::restoreConfiguratio
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setElementSequenceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
- // Check tuning mode
- if (!checkTuningModeOn(strResult)) {
-
- return CCommandHandler::EFailed;
- }
-
// Build configurable element path list
std::vector<string> astrNewElementSequence;
@@ -1254,7 +1246,9 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setElementSequenceC
}
// Delegate to configurable domains
- return getConfigurableDomains()->setElementSequence(remoteCommand.getArgument(0), remoteCommand.getArgument(1), astrNewElementSequence, strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+ return setElementSequence(remoteCommand.getArgument(0), remoteCommand.getArgument(1),
+ astrNewElementSequence, strResult) ?
+ CCommandHandler::EDone : CCommandHandler::EFailed;
}
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementSequenceCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
@@ -1266,19 +1260,25 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementSequenceC
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setRuleCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
// Delegate to configurable domains
- return getConfigurableDomains()->setApplicationRule(remoteCommand.getArgument(0), remoteCommand.getArgument(1), remoteCommand.packArguments(2, remoteCommand.getArgumentCount() - 2), getConstSelectionCriteria()->getSelectionCriteriaDefinition(), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+ return setApplicationRule(remoteCommand.getArgument(0), remoteCommand.getArgument(1),
+ remoteCommand.packArguments(2, remoteCommand.getArgumentCount() - 2), strResult) ?
+ CCommandHandler::EDone : CCommandHandler::EFailed;
}
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::clearRuleCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
// Delegate to configurable domains
- return getConfigurableDomains()->clearApplicationRule(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+ return clearApplicationRule(remoteCommand.getArgument(0), remoteCommand.getArgument(1),
+ strResult) ?
+ CCommandHandler::EDone : CCommandHandler::EFailed;
}
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getRuleCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
// Delegate to configurable domains
- return getConfigurableDomains()->getApplicationRule(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::ESucceeded : CCommandHandler::EFailed;
+ return getApplicationRule(remoteCommand.getArgument(0), remoteCommand.getArgument(1),
+ strResult) ?
+ CCommandHandler::ESucceeded : CCommandHandler::EFailed;
}
/// Elements/Parameters
@@ -1934,6 +1934,12 @@ bool CParameterMgr::deleteDomain(const string& strName, string& strError)
return getConfigurableDomains()->deleteDomain(strName, strError);
}
+bool CParameterMgr::renameDomain(const string& strName, const string& strNewName, string& strError)
+{
+ // Delegate to configurable domains
+ return getConfigurableDomains()->renameDomain(strName, strNewName, strError);
+}
+
bool CParameterMgr::deleteAllDomains(string& strError)
{
// Check tuning mode
@@ -1948,6 +1954,23 @@ bool CParameterMgr::deleteAllDomains(string& strError)
return true;
}
+bool CParameterMgr::setSequenceAwareness(const string& strName, bool bSequenceAware, string& strResult)
+{
+ // Check tuning mode
+ if (!checkTuningModeOn(strResult)) {
+
+ return false;
+ }
+
+ return getConfigurableDomains()->setSequenceAwareness(strName, bSequenceAware, strResult);
+}
+
+bool CParameterMgr::getSequenceAwareness(const string& strName, bool& bSequenceAware,
+ string& strResult)
+{
+ return getConfigurableDomains()->getSequenceAwareness(strName, bSequenceAware, strResult);
+}
+
bool CParameterMgr::createConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
{
// Check tuning mode
@@ -1959,6 +1982,12 @@ bool CParameterMgr::createConfiguration(const string& strDomain, const string& s
// Delegate to configurable domains
return getConfigurableDomains()->createConfiguration(strDomain, strConfiguration, _pMainParameterBlackboard, strError);
}
+bool CParameterMgr::renameConfiguration(const string& strDomain, const string& strConfiguration,
+ const string& strNewConfiguration, string& strError)
+{
+ return getConfigurableDomains()->renameConfiguration(strDomain, strConfiguration,
+ strNewConfiguration, strError);
+}
bool CParameterMgr::deleteConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
{
@@ -2071,6 +2100,40 @@ bool CParameterMgr::split(const string& strDomain, const string& strConfigurable
return getConfigurableDomains()->split(strDomain, pConfigurableElement, strError);
}
+bool CParameterMgr::setElementSequence(const string& strDomain, const string& strConfiguration,
+ const std::vector<string>& astrNewElementSequence,
+ string& strError)
+{
+ // Check tuning mode
+ if (!checkTuningModeOn(strError)) {
+
+ return false;
+ }
+
+ return getConfigurableDomains()->setElementSequence(strDomain, strConfiguration,
+ astrNewElementSequence, strError);
+}
+
+bool CParameterMgr::getApplicationRule(const string& strDomain, const string& strConfiguration,
+ string& strResult)
+{
+ return getConfigurableDomains()->getApplicationRule(strDomain, strConfiguration, strResult);
+}
+
+bool CParameterMgr::setApplicationRule(const string& strDomain, const string& strConfiguration,
+ const string& strApplicationRule, string& strError)
+{
+ return getConfigurableDomains()->setApplicationRule(strDomain, strConfiguration,
+ strApplicationRule, getConstSelectionCriteria()->getSelectionCriteriaDefinition(),
+ strError);
+}
+
+bool CParameterMgr::clearApplicationRule(const string& strDomain, const string& strConfiguration,
+ string& strError)
+{
+ return getConfigurableDomains()->clearApplicationRule(strDomain, strConfiguration, strError);
+}
+
bool CParameterMgr::importDomainsXml(const string& strXmlSource, bool bWithSettings,
bool bFromFile, string& strError)
{
diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h
index 7962294..fcba462 100644
--- a/parameter/ParameterMgr.h
+++ b/parameter/ParameterMgr.h
@@ -221,10 +221,17 @@ public:
////////// Configuration/Domains handling //////////////
// Creation/Deletion
bool createDomain(const std::string& strName, std::string& strError);
+ bool renameDomain(const std::string& strName, const std::string& strNewName,
+ std::string& strError);
bool deleteDomain(const std::string& strName, std::string& strError);
bool deleteAllDomains(std::string& strError);
+ bool setSequenceAwareness(const std::string& strName, bool bSequenceAware,
+ std::string& strResult);
+ bool getSequenceAwareness(const std::string& strName, bool& bSequenceAware,
+ std::string& strResult);
bool createConfiguration(const std::string& strDomain, const std::string& strConfiguration, std::string& strError);
bool deleteConfiguration(const std::string& strDomain, const std::string& strConfiguration, std::string& strError);
+ bool renameConfiguration(const std::string& strDomain, const std::string& strConfiguration, const std::string& strNewConfiguration, std::string& strError);
// Save/Restore
bool restoreConfiguration(const std::string& strDomain, const std::string& strConfiguration, std::list<std::string>& strError);
@@ -234,6 +241,16 @@ public:
bool addConfigurableElementToDomain(const std::string& strDomain, const std::string& strConfigurableElementPath, std::string& strError);
bool removeConfigurableElementFromDomain(const std::string& strDomain, const std::string& strConfigurableElementPath, std::string& strError);
bool split(const std::string& strDomain, const std::string& strConfigurableElementPath, std::string& strError);
+ bool setElementSequence(const std::string& strDomain, const std::string& strConfiguration,
+ const std::vector<std::string>& astrNewElementSequence,
+ std::string& strError);
+
+ bool getApplicationRule(const std::string& strDomain, const std::string& strConfiguration,
+ std::string& strResult);
+ bool setApplicationRule(const std::string& strDomain, const std::string& strConfiguration,
+ const std::string& strApplicationRule, std::string& strError);
+ bool clearApplicationRule(const std::string& strDomain, const std::string& strConfiguration,
+ std::string& strError);
/**
* Method that imports Configurable Domains from an Xml source.