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

Commit cd7b241

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 96339b1 commit cd7b241

16 files changed

+224
-728
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
@@ -101,6 +98,7 @@ add_library(parameter SHARED
10198
include_directories(
10299
include
103100
"${PROJECT_SOURCE_DIR}/xmlserializer"
101+
"${PROJECT_SOURCE_DIR}/xmlserializer/include"
104102
"${PROJECT_SOURCE_DIR}/utility"
105103
"${PROJECT_SOURCE_DIR}/remote-processor"
106104
"${PROJECT_SOURCE_DIR}/parameter/log/include"

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

Lines changed: 15 additions & 14 deletions
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

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.

parameter/ParameterFrameworkConfiguration.cpp

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

0 commit comments

Comments
 (0)