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

Commit

Permalink
Rework configuration class to avoid complicate behavior
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
clero committed Jun 19, 2015
1 parent 25224a7 commit eaa0f13
Show file tree
Hide file tree
Showing 16 changed files with 244 additions and 738 deletions.
4 changes: 1 addition & 3 deletions parameter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ add_library(parameter SHARED
ErrorContext.cpp
FixedPointParameterType.cpp
FormattedSubsystemObject.cpp
FrameworkConfigurationLocation.cpp
HardwareBackSynchronizer.cpp
InstanceConfigurableElement.cpp
InstanceDefinition.cpp
Expand All @@ -73,14 +72,12 @@ add_library(parameter SHARED
ParameterBlackboard.cpp
ParameterBlockType.cpp
Parameter.cpp
ParameterFrameworkConfiguration.cpp
ParameterHandle.cpp
ParameterMgr.cpp
ParameterMgrFullConnector.cpp
ParameterMgrPlatformConnector.cpp
ParameterType.cpp
PathNavigator.cpp
PluginLocation.cpp
RuleParser.cpp
SelectionCriterionRule.cpp
SimulatedBackSynchronizer.cpp
Expand All @@ -104,6 +101,7 @@ include_directories(
command/include
"${PROJECT_SOURCE_DIR}/parameter"
"${PROJECT_SOURCE_DIR}/xmlserializer"
"${PROJECT_SOURCE_DIR}/xmlserializer/include"
"${PROJECT_SOURCE_DIR}/utility"
"${PROJECT_SOURCE_DIR}/remote-processor"
"${PROJECT_SOURCE_DIR}/parameter/log/include"
Expand Down
46 changes: 28 additions & 18 deletions parameter/PluginLocation.h → parameter/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,37 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "KindElement.h"
#include <list>

#include <string>
#include <list>

class CPluginLocation : public CKindElement
namespace core
{

public:
CPluginLocation(const std::string& strName, const std::string& strKind);

// From IXmlSink
virtual bool fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& serializingContext);

// Folder
const std::string& getFolder() const;

// Plugin list
const std::list<std::string>& getPluginList() const;

private:
std::string _strFolder;
std::list<std::string> _pluginList;
/** Parameter-Framework Configuration holder */
struct Configuration
{
/** @param[in] file the file which contains the configuration */
Configuration(const std::string &file) : configurationFile(file) {}

/** System class name */
std::string systemClassName;
/** Indicate if the tuning is allowed */
bool tuningAllowed = false;
/** Remote command server listening port */
uint16_t serverPort = 0;
/** File which contains the configuration */
std::string configurationFile;
/** Application XML schemas directory */
std::string schemasLocation;
/** Application structure file */
std::string structureFile;
/** Application settings file */
std::string settingsFile;
/** Application binary settings file */
std::string binarySettingsFile;
/** Application plugin path list */
std::list<std::string> plugins;
};

} /** core namespace */
50 changes: 0 additions & 50 deletions parameter/FrameworkConfigurationGroup.h

This file was deleted.

67 changes: 0 additions & 67 deletions parameter/FrameworkConfigurationLocation.cpp

This file was deleted.

52 changes: 0 additions & 52 deletions parameter/FrameworkConfigurationLocation.h

This file was deleted.

50 changes: 0 additions & 50 deletions parameter/KindElement.h

This file was deleted.

44 changes: 0 additions & 44 deletions parameter/KindElementBuilderTemplate.h

This file was deleted.

Loading

0 comments on commit eaa0f13

Please sign in to comment.