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

Commit 6de63ee

Browse files
committed
Merge pull request #9 from 01org/adapt-to-v3-api
Update to Parameter Framework 3.0 API PF 3.0 provides a new logging API and a new entry-point API. It also makes it necessary to compile using C++11. This patch update the filesystem plugin to let it compile against the new PF.
2 parents b56a3e8 + ad18f17 commit 6de63ee

6 files changed

Lines changed: 28 additions & 27 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2014, Intel Corporation
1+
# Copyright (c) 2014-2015, Intel Corporation
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without modification,
@@ -31,31 +31,26 @@ cmake_minimum_required(VERSION 2.8)
3131

3232
project(parameter-framework-plugins-filesystem)
3333

34-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")
34+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -Wextra")
3535

3636
#
3737
# Find PFW libraries and include directories
3838
#
39-
find_path(PFW_CORE_ROOT_DIR NAMES include/parameter/plugin/Subsystem.h)
39+
find_path(PFW_INCLUDE_ROOT NAMES parameter/plugin/Plugin.h)
4040

41-
find_library(PFW_CORE_LIBRARY NAMES parameter
42-
HINTS ${PFW_CORE_ROOT_DIR}/lib)
43-
44-
find_path(PFW_CORE_INCLUDE_DIR NAMES Subsystem.h
45-
HINTS ${PFW_CORE_ROOT_DIR}/include/parameter/plugin)
46-
find_path(PFW_XMLSERIALIZER_INCLUDE_DIR NAMES XmlSink.h
47-
HINTS ${PFW_CORE_ROOT_DIR}/include/xmlserializer)
48-
49-
set(PFW_INCLUDE_DIRS ${PFW_CORE_INCLUDE_DIR} ${PFW_XMLSERIALIZER_INCLUDE_DIR})
50-
set(PFW_LIBRARIES ${PFW_CORE_LIBRARY})
41+
find_library(PFW_CORE_LIBRARY NAMES parameter)
5142

43+
set(PFW_INCLUDE_DIRS
44+
${PFW_INCLUDE_ROOT}/parameter/plugin
45+
${PFW_INCLUDE_ROOT}/xmlserializer
46+
${PFW_INCLUDE_ROOT}/utility)
5247

5348
add_library(fs-subsystem SHARED
5449
FSSubsystemBuilder.cpp
5550
FSSubsystem.cpp
5651
FSSubsystemObject.cpp)
5752

58-
target_link_libraries(fs-subsystem ${PFW_LIBRARIES})
53+
target_link_libraries(fs-subsystem ${PFW_CORE_LIBRARY})
5954

6055
include_directories(${PFW_INCLUDE_DIRS})
6156

FSSubsystem.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014, Intel Corporation
2+
* Copyright (c) 2011-2015, Intel Corporation
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
@@ -36,7 +36,8 @@
3636
#define base CSubsystem
3737

3838
// Implementation
39-
CFSSubsystem::CFSSubsystem(const std::string& strName) : base(strName)
39+
CFSSubsystem::CFSSubsystem(const std::string& strName, core::log::Logger& logger) :
40+
base(strName, logger)
4041
{
4142
// Provide mapping keys to upper layer
4243
addContextMappingKey("Directory");

FSSubsystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014, Intel Corporation
2+
* Copyright (c) 2011-2015, Intel Corporation
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
@@ -36,7 +36,7 @@
3636
class CFSSubsystem : public CSubsystem
3737
{
3838
public:
39-
CFSSubsystem(const std::string& strName);
39+
CFSSubsystem(const std::string& strName, core::log::Logger& logger);
4040

4141
};
4242

FSSubsystemBuilder.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014, Intel Corporation
2+
* Copyright (c) 2011-2015, Intel Corporation
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
@@ -28,15 +28,17 @@
2828
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31-
#include "SubsystemLibrary.h"
32-
#include "NamedElementBuilderTemplate.h"
31+
#include <Plugin.h>
32+
#include <LoggingElementBuilderTemplate.h>
3333
#include "FSSubsystem.h"
3434

3535

3636
extern "C"
3737
{
38-
void getFSSubsystemBuilder(CSubsystemLibrary* pSubsystemLibrary)
38+
void PARAMETER_FRAMEWORK_PLUGIN_ENTRYPOINT_V1(CSubsystemLibrary* subsystemLibrary,
39+
core::log::Logger& logger)
3940
{
40-
pSubsystemLibrary->addElementBuilder("FS", new TNamedElementBuilderTemplate<CFSSubsystem>());
41+
subsystemLibrary->addElementBuilder("FS",
42+
new TLoggingElementBuilderTemplate<CFSSubsystem>(logger));
4143
}
4244
}

FSSubsystemObject.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014, Intel Corporation
2+
* Copyright (c) 2011-2015, Intel Corporation
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
@@ -53,8 +53,10 @@ const uint32_t STR_FORMAT_LENGTH = 1024;
5353

5454
CFSSubsystemObject::CFSSubsystemObject(const string& mappingValue,
5555
CInstanceConfigurableElement* instanceConfigurableElement,
56-
const CMappingContext& context)
56+
const CMappingContext& context,
57+
core::log::Logger& logger)
5758
: base(instanceConfigurableElement,
59+
logger,
5860
mappingValue,
5961
EFSAmend1,
6062
(EFSAmendEnd - EFSAmend1 + 1),

FSSubsystemObject.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014, Intel Corporation
2+
* Copyright (c) 2011-2015, Intel Corporation
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without modification,
@@ -41,7 +41,8 @@ class CFSSubsystemObject : public CFormattedSubsystemObject
4141
public:
4242
CFSSubsystemObject(const std::string& mappingValue,
4343
CInstanceConfigurableElement* instanceConfigurableElement,
44-
const CMappingContext& context);
44+
const CMappingContext& context,
45+
core::log::Logger& logger);
4546

4647
protected:
4748
// from CSubsystemObject

0 commit comments

Comments
 (0)