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

Commit 2c635ab

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. TODO: UPDATE DOC Signed-off-by: Jules Clero <[email protected]>
1 parent 43cf407 commit 2c635ab

16 files changed

+223
-722
lines changed

parameter/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ add_library(parameter SHARED
5757
ErrorContext.cpp
5858
FixedPointParameterType.cpp
5959
FormattedSubsystemObject.cpp
60-
FrameworkConfigurationLocation.cpp
6160
HardwareBackSynchronizer.cpp
6261
InstanceConfigurableElement.cpp
6362
InstanceDefinition.cpp
@@ -71,14 +70,12 @@ add_library(parameter SHARED
7170
ParameterBlackboard.cpp
7271
ParameterBlockType.cpp
7372
Parameter.cpp
74-
ParameterFrameworkConfiguration.cpp
7573
ParameterHandle.cpp
7674
ParameterMgr.cpp
7775
ParameterMgrFullConnector.cpp
7876
ParameterMgrPlatformConnector.cpp
7977
ParameterType.cpp
8078
PathNavigator.cpp
81-
PluginLocation.cpp
8279
RuleParser.cpp
8380
SelectionCriteria.cpp
8481
SelectionCriteriaDefinition.cpp
@@ -104,6 +101,7 @@ add_library(parameter SHARED
104101
include_directories(
105102
include
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")

parameter/FrameworkConfigurationGroup.h renamed to parameter/Configuration.h

+15-14
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@
2929
*/
3030
#pragma once
3131

32-
#include "KindElement.h"
33-
3432
#include <string>
33+
#include <list>
3534

36-
class CFrameworkConfigurationGroup : public CKindElement
35+
struct Configuration
3736
{
38-
public:
39-
CFrameworkConfigurationGroup(const std::string& strName, const std::string& strKind) : CKindElement(strName, strKind)
40-
{
41-
}
42-
43-
private:
44-
virtual bool childrenAreDynamic() const
45-
{
46-
return true;
47-
}
48-
37+
Configuration(const std::string &file) : configurationFile(file), plugins{} {}
4938

39+
// System class name
40+
std::string systemClassName;
41+
// Tuning allowed
42+
bool tuningAllowed = false;
43+
// Server port
44+
uint16_t serverPort = 0;
45+
std::string configurationFile;
46+
std::string schemasLocation;
47+
std::string structureFile;
48+
std::string settingsFile;
49+
std::string binarySettingsFile;
50+
std::list<std::string> plugins;
5051
};

parameter/FrameworkConfigurationLocation.cpp

-67
This file was deleted.

parameter/FrameworkConfigurationLocation.h

-52
This file was deleted.

parameter/KindElement.h

-50
This file was deleted.

parameter/KindElementBuilderTemplate.h

-44
This file was deleted.

parameter/ParameterFrameworkConfiguration.cpp

-81
This file was deleted.

0 commit comments

Comments
 (0)