Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit eaa0f13

Browse files
committed
Rework configuration class to avoid complicate behavior
Current configuration design is mapping classes on xml node. It leads to some empty classes which contains a node information. It also leads to inconsistent information retrieval method. Some can be retrieved through simple getters and some others are retrieved through child mechanism inherited from Element. This patch introduces a real configuration object which is a simple struct. Information retrieval is handled through xml bindings. Signed-off-by: Jules Clero <[email protected]>
1 parent 25224a7 commit eaa0f13

16 files changed

+244
-738
lines changed

parameter/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ add_library(parameter SHARED
5959
ErrorContext.cpp
6060
FixedPointParameterType.cpp
6161
FormattedSubsystemObject.cpp
62-
FrameworkConfigurationLocation.cpp
6362
HardwareBackSynchronizer.cpp
6463
InstanceConfigurableElement.cpp
6564
InstanceDefinition.cpp
@@ -73,14 +72,12 @@ add_library(parameter SHARED
7372
ParameterBlackboard.cpp
7473
ParameterBlockType.cpp
7574
Parameter.cpp
76-
ParameterFrameworkConfiguration.cpp
7775
ParameterHandle.cpp
7876
ParameterMgr.cpp
7977
ParameterMgrFullConnector.cpp
8078
ParameterMgrPlatformConnector.cpp
8179
ParameterType.cpp
8280
PathNavigator.cpp
83-
PluginLocation.cpp
8481
RuleParser.cpp
8582
SelectionCriterionRule.cpp
8683
SimulatedBackSynchronizer.cpp
@@ -104,6 +101,7 @@ include_directories(
104101
command/include
105102
"${PROJECT_SOURCE_DIR}/parameter"
106103
"${PROJECT_SOURCE_DIR}/xmlserializer"
104+
"${PROJECT_SOURCE_DIR}/xmlserializer/include"
107105
"${PROJECT_SOURCE_DIR}/utility"
108106
"${PROJECT_SOURCE_DIR}/remote-processor"
109107
"${PROJECT_SOURCE_DIR}/parameter/log/include"
Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,37 @@
2828
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030
#pragma once
31-
#include "KindElement.h"
32-
#include <list>
31+
3332
#include <string>
33+
#include <list>
3434

35-
class CPluginLocation : public CKindElement
35+
namespace core
3636
{
3737

38-
public:
39-
CPluginLocation(const std::string& strName, const std::string& strKind);
40-
41-
// From IXmlSink
42-
virtual bool fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& serializingContext);
43-
44-
// Folder
45-
const std::string& getFolder() const;
46-
47-
// Plugin list
48-
const std::list<std::string>& getPluginList() const;
49-
50-
private:
51-
std::string _strFolder;
52-
std::list<std::string> _pluginList;
38+
/** Parameter-Framework Configuration holder */
39+
struct Configuration
40+
{
41+
/** @param[in] file the file which contains the configuration */
42+
Configuration(const std::string &file) : configurationFile(file) {}
5343

44+
/** System class name */
45+
std::string systemClassName;
46+
/** Indicate if the tuning is allowed */
47+
bool tuningAllowed = false;
48+
/** Remote command server listening port */
49+
uint16_t serverPort = 0;
50+
/** File which contains the configuration */
51+
std::string configurationFile;
52+
/** Application XML schemas directory */
53+
std::string schemasLocation;
54+
/** Application structure file */
55+
std::string structureFile;
56+
/** Application settings file */
57+
std::string settingsFile;
58+
/** Application binary settings file */
59+
std::string binarySettingsFile;
60+
/** Application plugin path list */
61+
std::list<std::string> plugins;
5462
};
63+
64+
} /** core namespace */

parameter/FrameworkConfigurationGroup.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

parameter/FrameworkConfigurationLocation.cpp

Lines changed: 0 additions & 67 deletions
This file was deleted.

parameter/FrameworkConfigurationLocation.h

Lines changed: 0 additions & 52 deletions
This file was deleted.

parameter/KindElement.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

parameter/KindElementBuilderTemplate.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)