summaryrefslogtreecommitdiffstats
path: root/parameter/include
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2013-05-24 17:23:09 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:56 +0100
commita4c39f1a12cad5239c92387eef26d1d3b38f3a43 (patch)
treefa1ce74e93d65d45262767f84868bba6c30d1d3d /parameter/include
parent25a70bead6db43163217e59ae5155ad74ecfd0c4 (diff)
downloadexternal_parameter-framework-a4c39f1a12cad5239c92387eef26d1d3b38f3a43.zip
external_parameter-framework-a4c39f1a12cad5239c92387eef26d1d3b38f3a43.tar.gz
external_parameter-framework-a4c39f1a12cad5239c92387eef26d1d3b38f3a43.tar.bz2
[Parameter] Move public header to include dir
BZ: 107991 The parameter-framework core public headers were mixed up with all other private headers. Making it dificult for other components to include PFW public headers. Move public headers - ParameterHandle - ParameterMgrPlatformConnector - SelectionCriterionInterface - SelectionCriterionTypeInterface to the "include" dir. Change-Id: I3a4840345a26ec9bd848179bdd4966d44d97bede Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/109757 Reviewed-by: cactus <cactus@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/include')
-rw-r--r--parameter/include/ParameterHandle.h86
-rw-r--r--parameter/include/ParameterMgrPlatformConnector.h87
-rw-r--r--parameter/include/SelectionCriterionInterface.h35
-rw-r--r--parameter/include/SelectionCriterionTypeInterface.h35
4 files changed, 243 insertions, 0 deletions
diff --git a/parameter/include/ParameterHandle.h b/parameter/include/ParameterHandle.h
new file mode 100644
index 0000000..0e6660f
--- /dev/null
+++ b/parameter/include/ParameterHandle.h
@@ -0,0 +1,86 @@
+/* ParameterHandle.h
+ **
+ ** Copyright © 2011 Intel
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ **
+ ** AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ ** CREATED: 2011-06-01
+ ** UPDATED: 2011-07-27
+ **
+ */
+#pragma once
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+class CBaseParameter;
+class CParameterMgr;
+
+class CParameterHandle
+{
+public:
+ CParameterHandle(const CBaseParameter* pParameter, CParameterMgr* pParameterMgr);
+
+ // Parameter features
+ bool isRogue() const;
+ bool isArray() const;
+ // Array Length
+ uint32_t getArrayLength() const; // Returns 0 for scalar
+ // Parameter path
+ std::string getPath() const;
+ // Parameter kind
+ std::string getKind() const;
+
+ // Boolean access
+ bool setAsBoolean(bool bValue, std::string& strError);
+ bool getAsBoolean(bool bValue, std::string& strError) const;
+ bool setAsBooleanArray(const std::vector<bool>& abValues, std::string& strError);
+ bool getAsBooleanArray(std::vector<bool>& abValues, std::string& strError) const;
+
+ // Integer Access
+ bool setAsInteger(uint32_t uiValue, std::string& strError);
+ bool getAsInteger(uint32_t& uiValue, std::string& strError) const;
+ bool setAsIntegerArray(const std::vector<uint32_t>& auiValues, std::string& strError);
+ bool getAsIntegerArray(std::vector<uint32_t>& auiValues, std::string& strError) const;
+
+ // Signed Integer Access
+ bool setAsSignedInteger(int32_t iValue, std::string& strError);
+ bool getAsSignedInteger(int32_t& iValue, std::string& strError) const;
+ bool setAsSignedIntegerArray(const std::vector<int32_t>& aiValues, std::string& strError);
+ bool getAsSignedIntegerArray(std::vector<int32_t>& aiValues, std::string& strError) const;
+
+ // Double Access
+ bool setAsDouble(double dValue, std::string& strError);
+ bool getAsDouble(double& dValue, std::string& strError) const;
+ bool setAsDoubleArray(const std::vector<double>& adValues, std::string& strError);
+ bool getAsDoubleArray(std::vector<double>& adValues, std::string& strError) const;
+
+ // String Access
+ bool setAsString(const std::string& strValue, std::string& strError);
+ bool getAsString(std::string& strValue, std::string& strError) const;
+ bool setAsStringArray(const std::vector<std::string>& astrValues, std::string& strError);
+ bool getAsStringArray(std::vector<std::string>& astrValues, std::string& strError) const;
+
+private:
+ // Access validity
+ bool checkAccessValidity(bool bSet, uint32_t uiArrayLength, std::string& strError) const;
+
+ // Accessed parameter instance
+ const CBaseParameter* _pBaseParameter;
+ // Parameter Mgr
+ CParameterMgr* _pParameterMgr;
+ // Subsystem endianness
+ bool _bBigEndianSubsystem;
+};
diff --git a/parameter/include/ParameterMgrPlatformConnector.h b/parameter/include/ParameterMgrPlatformConnector.h
new file mode 100644
index 0000000..64394e4
--- /dev/null
+++ b/parameter/include/ParameterMgrPlatformConnector.h
@@ -0,0 +1,87 @@
+/* ParameterMgrPlatformConnector.h
+ **
+ ** Copyright © 2011 Intel
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ **
+ ** AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ ** CREATED: 2011-06-01
+ ** UPDATED: 2011-07-27
+ **
+ */
+#pragma once
+
+#include <list>
+#include "SelectionCriterionTypeInterface.h"
+#include "SelectionCriterionInterface.h"
+#include "ParameterHandle.h"
+
+class CParameterMgr;
+class CParameterMgrLogger;
+
+class CParameterMgrPlatformConnector
+{
+ friend class CParameterMgrLogger;
+public:
+ // Logger interface
+ class ILogger
+ {
+ public:
+ virtual void log(bool bIsWarning, const std::string& strLog) = 0;
+ };
+
+ // Construction
+ CParameterMgrPlatformConnector(const std::string& strConfigurationFilePath);
+ ~CParameterMgrPlatformConnector(); // Not virtual since not supposed to be derived!
+
+ // Selection Criteria interface. Beware returned objects are lent, clients shall not delete them!
+ // Should be called before start
+ ISelectionCriterionTypeInterface* createSelectionCriterionType(bool bIsInclusive = false);
+ ISelectionCriterionInterface* createSelectionCriterion(const std::string& strName, const ISelectionCriterionTypeInterface* pSelectionCriterionType);
+ // Selection criterion retrieval
+ ISelectionCriterionInterface* getSelectionCriterion(const std::string& strName);
+
+ // Logging
+ // Should be called before start
+ void setLogger(ILogger* pLogger);
+
+ // Start
+ bool start(std::string& strError);
+
+ // Started state
+ bool isStarted() const;
+
+ // Configuration application
+ void applyConfigurations();
+
+ // Dynamic parameter handling
+ // Returned objects are owned by clients
+ // Must be cassed after successfull start
+ CParameterHandle* createParameterHandle(const std::string& strPath, std::string& strError) const;
+
+private:
+ CParameterMgrPlatformConnector(const CParameterMgrPlatformConnector&);
+ CParameterMgrPlatformConnector& operator=(const CParameterMgrPlatformConnector&);
+ // Private logging
+ void doLog(bool bIsWarning, const std::string& strLog);
+
+ // Implementation
+ CParameterMgr* _pParameterMgr;
+ // State
+ bool _bStarted;
+ // Logging
+ ILogger* _pLogger;
+ // Private logging
+ CParameterMgrLogger* _pParameterMgrLogger;
+};
+
diff --git a/parameter/include/SelectionCriterionInterface.h b/parameter/include/SelectionCriterionInterface.h
new file mode 100644
index 0000000..9162486
--- /dev/null
+++ b/parameter/include/SelectionCriterionInterface.h
@@ -0,0 +1,35 @@
+/* SelectionCriterionInterface.h
+ **
+ ** Copyright © 2011 Intel
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ **
+ ** AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ ** CREATED: 2011-06-01
+ ** UPDATED: 2011-07-27
+ **
+ */
+#pragma once
+
+#include <string>
+
+#include "SelectionCriterionTypeInterface.h"
+
+class ISelectionCriterionInterface
+{
+public:
+ virtual void setCriterionState(int iState) = 0;
+ virtual int getCriterionState() const = 0;
+ virtual std::string getCriterionName() const = 0;
+ virtual const ISelectionCriterionTypeInterface* getCriterionType() const = 0;
+};
diff --git a/parameter/include/SelectionCriterionTypeInterface.h b/parameter/include/SelectionCriterionTypeInterface.h
new file mode 100644
index 0000000..426d355
--- /dev/null
+++ b/parameter/include/SelectionCriterionTypeInterface.h
@@ -0,0 +1,35 @@
+/* SelectionCriterionTypeInterface.h
+ **
+ ** Copyright © 2011 Intel
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ **
+ ** AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ ** CREATED: 2011-06-01
+ ** UPDATED: 2011-07-27
+ **
+ */
+#pragma once
+
+#include <string>
+
+class ISelectionCriterionTypeInterface
+{
+public:
+ virtual bool addValuePair(int iValue, const std::string& strValue) = 0;
+ virtual bool getNumericalValue(const std::string& strValue, int& iValue) const = 0;
+ virtual bool getLiteralValue(int iValue, std::string& strValue) const = 0;
+ virtual bool isTypeInclusive() const = 0;
+ virtual std::string getFormattedState(int iValue) const = 0;
+};
+