Skip to content

Commit

Permalink
capicxx-core-runtime 3.2.3-r7 (#45)
Browse files Browse the repository at this point in the history
* capicxx-core-runtime 3.2.3-r7

- Fixed warnings with gcc11 for Wextra-extra-semi flag
- Fix capi-core-runtime Runtime::loadLibrary
- vSomeIP Security: Update vsomeip_sec
- Fixed commonapi-core-runtime windows build
- Fix race condition.
- Remove mutex and add exception handling to RuntimeDeinit.
- Fix double initialization of loggerImpl.
- Linux: avoid static initialization of std::mutex
- Replace deprecated std::ptr_fun
- Properly initialize Runtime::defaultCallTimeout_
- Removed GENIVI copyright line
- Fix bug in assignment operator of Variant in case of self-assignment
- Ensure to stop struct deserialization on error
- Implement "no_timeout" in method responses
- Use COMMONAPI_EXPORT_CLASS_EXPLICIT to export classes
- Removed libdlt dependency from android
- Add support to logs in Android
- Update android build files
- Support retrieval of environment (hostname) from client identifier.
- Use lock objects and remove self assignment.

* Fix Copyright field and github link in README file

---------

Co-authored-by: Diana Pinto <[email protected]>
  • Loading branch information
dibpinto and Diana Pinto authored Oct 23, 2023
1 parent 89720d3 commit e3818cb
Show file tree
Hide file tree
Showing 24 changed files with 486 additions and 238 deletions.
56 changes: 36 additions & 20 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
capi_srcs = [
"src/CommonAPI/**/*.cpp"
]

cc_defaults {
name: "capi_defaults",
name: "libcommonapi_defaults",

rtti: true,

cppflags: [
"-std=c++11",
"-std=c++11",
"-Wall",
"-Wextra",
"-Wformat",
"-Wformat-security",
"-Wconversion",
"-Wno-attributes",
"-Wno-attributes",
"-fexceptions",
"-fstrict-aliasing",
"-fstack-protector",
"-fasynchronous-unwind-tables",
"-fno-omit-frame-pointer",
"-Werror",
"-fvisibility=hidden",
"-DCOMMONAPI_INTERNAL_COMPILATION"
]
"-fvisibility=hidden",
"-Wno-ignored-attributes",
"-Wno-unused-private-field",
"-D_CRT_SECURE_NO_WARNINGS",
"-DCOMMONAPI_INTERNAL_COMPILATION",
"-DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_VERBOSE",
"-DUSE_DLT",
],

proprietary: true,
}

cc_library_shared {
name: "libCommonAPI",
vendor: true,
srcs: capi_srcs,
defaults: [
"capi_defaults"
],
name: "libcommonapi",
defaults: ["libcommonapi_defaults"],
local_include_dirs: [
"include"
"include",
],

shared_libs: [
"liblog",
"libutils",
"libboost_log",
"libboost_system",
"libboost_thread",
],

export_include_dirs: [
"include",
],
srcs: [
"src/CommonAPI/**/*.cpp"
],
export_include_dirs: ["include"],
rtti: true
}


44 changes: 44 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Cannot convert to Android.bp as resource copying has not
# yet implemented for soong as of 12/16/2016

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libcommonapi_dlt
LOCAL_MODULE_TAGS := optional
LOCAL_CLANG := true
LOCAL_PROPRIETARY_MODULE := true
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include \

LOCAL_SRC_FILES += \
src/CommonAPI/Address.cpp \
src/CommonAPI/ContainerUtils.cpp \
src/CommonAPI/IniFileReader.cpp \
src/CommonAPI/Logger.cpp \
src/CommonAPI/LoggerImpl.cpp \
src/CommonAPI/MainLoopContext.cpp \
src/CommonAPI/Proxy.cpp \
src/CommonAPI/ProxyManager.cpp \
src/CommonAPI/Runtime.cpp \
src/CommonAPI/Utils.cpp \

LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include

LOCAL_SHARED_LIBRARIES := \
libboost_log \
libboost_system \
libboost_thread \

LOCAL_CFLAGS := \
-frtti -fexceptions \
-Wno-ignored-attributes \
-D_CRT_SECURE_NO_WARNINGS \
-DCOMMONAPI_INTERNAL_COMPILATION \
-DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_VERBOSE \

include $(BUILD_SHARED_LIBRARY)



35 changes: 33 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
Changes
=======

v3.2.3-r7
- Fixed warnings with gcc11 for Wextra-extra-semi flag
- Fix capi-core-runtime Runtime::loadLibrary
- vSomeIP Security: Update vsomeip_sec
- Fixed commonapi-core-runtime windows build

v3.2.3-r6
- Fix race condition.
- Remove mutex and add exception handling to RuntimeDeinit.
- Fix double initialization of loggerImpl.

v3.2.3-r5
- Linux: avoid static initialization of std::mutex
- Replace deprecated std::ptr_fun

v3.2.3
- Properly initialize Runtime::defaultCallTimeout_
- Removed GENIVI copyright line
- Fix bug in assignment operator of Variant in case of self-assignment
- Ensure to stop struct deserialization on error
- Implement "no_timeout" in method responses
- Use COMMONAPI_EXPORT_CLASS_EXPLICIT to export classes
- Removed libdlt dependency from android
- Add support to logs in Android
- Update android build files

v3.2.2
- Support retrieval of environment (hostname) from client identifier.

v3.2.1
- Use lock objects and remove self assignment.

v3.2.0
- Support ABI compatible changes (additional attributes, broadcast and methods added to the end of
- Support ABI compatible changes (additional attributes, broadcast and methods added to the end of
the interface specification)

v3.1.12.6
Expand Down Expand Up @@ -47,4 +79,3 @@ v3.1.9
- Added subscription parameter to 'Event::onListenerRemoved' function. This is needed for managing the added and removed listeners respectively for mapping the listeners on the subscription.
- Replaced variadic macros with variadic templates for CommonAPI logger.
- Removed obsolete usleep() macro.

24 changes: 11 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PROJECT(libcommonapi)
# version of CommonAPI
SET( LIBCOMMONAPI_MAJOR_VERSION 3 )
SET( LIBCOMMONAPI_MINOR_VERSION 2 )
SET( LIBCOMMONAPI_PATCH_VERSION 0 )
SET( LIBCOMMONAPI_PATCH_VERSION 3 )

message(STATUS "Project name: ${PROJECT_NAME}")

Expand All @@ -24,6 +24,10 @@ message(STATUS "This is CMake for Common API C++ Version ${COMPONENT_VERSION}.")
set(DL_LIBRARY "")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(DL_LIBRARY "dl")

# force all use of std::mutx and std::recursive_mutex to use runtime init
# instead of static initialization so mutexes can be hooked to enable PI as needed
add_definitions(-D_GTHREAD_USE_MUTEX_INIT_FUNC -D_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

##############################################################################
Expand Down Expand Up @@ -102,7 +106,8 @@ IF(MSVC)
add_definitions(-DCOMMONAPI_INTERNAL_COMPILATION -DCOMMONAPI_DLL_COMPILATION)
add_compile_options(/EHsc /wd4996)
ELSE ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Werror=extra-semi -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION -fvisibility=hidden")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wformat-security -fstack-protector-strong")
ENDIF(MSVC)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_${MAX_LOG_LEVEL}")
Expand All @@ -129,6 +134,9 @@ list(SORT CAPI_SRCS)
add_library(CommonAPI SHARED ${CAPI_SRCS})
target_link_libraries(CommonAPI PRIVATE ${DL_LIBRARY} ${DLT_LIBRARIES})
set_target_properties(CommonAPI PROPERTIES VERSION ${LIBCOMMONAPI_MAJOR_VERSION}.${LIBCOMMONAPI_MINOR_VERSION}.${LIBCOMMONAPI_PATCH_VERSION} SOVERSION ${LIBCOMMONAPI_MAJOR_VERSION}.${LIBCOMMONAPI_MINOR_VERSION}.${LIBCOMMONAPI_PATCH_VERSION} LINKER_LANGUAGE C)
target_include_directories(CommonAPI INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>)
set_target_properties (CommonAPI PROPERTIES INTERFACE_LINK_LIBRARY "")

##############################################################################
Expand Down Expand Up @@ -167,23 +175,14 @@ export(PACKAGE CommonAPI)
# Create the CommonAPIConfig.cmake and CommonAPIConfigVersion files ...
file(RELATIVE_PATH REL_INCLUDE_DIR "${ABSOLUTE_INSTALL_CMAKE_DIR}" "${ABSOLUTE_INSTALL_INCLUDE_DIR}")

# ... for the build tree
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAPIConfig.cmake.in
"${PROJECT_BINARY_DIR}/CommonAPIConfig.cmake" @ONLY)

# ... for the install tree
set(CONF_INCLUDE_DIRS "\${COMMONAPI_CMAKE_DIR}/${REL_INCLUDE_DIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAPIConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CommonAPIConfig.cmake" @ONLY)

# ... for both
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAPIConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/CommonAPIConfigVersion.cmake" @ONLY)

# Install the CommonAPIConfig.cmake and CommonAPIConfigVersion.cmake
install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CommonAPIConfig.cmake"
"${PROJECT_BINARY_DIR}/CommonAPIConfig.cmake"
"${PROJECT_BINARY_DIR}/CommonAPIConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}")

Expand Down Expand Up @@ -255,4 +254,3 @@ if(NOT WIN32 AND PKG_CONFIG_FOUND)
endif()

##############################################################################

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
### CommonAPI C++ Core Runtime

##### Copyright
Copyright (C) 2016-2020, Bayerische Motoren Werke Aktiengesellschaft (BMW AG).
Copyright (C) 2016-2020, GENIVI Alliance, Inc.
Copyright (C) 2016-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG).
Copyright (C) 2016-2023, COVESA

This file is part of GENIVI Project IPC Common API C++.
Contributions are licensed to the GENIVI Alliance under one or more Contribution License Agreements or MPL 2.0.
This file is part of COVESA Project IPC Common API C++.
Contributions are licensed to the COVESA under one or more Contribution License Agreements or MPL 2.0.

##### License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/.
Expand All @@ -14,7 +14,7 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v.
The specification document and the user guide can be found in the CommonAPI documentation directory of the CommonAPI-Tools project as AsciiDoc document. A pdf version can be found at https://github.com/GENIVI/capicxx-core-tools/releases.

##### Further information
https://genivi.github.io/capicxx-core-tools/
https://covesa.github.io/capicxx-core-tools/

##### Build Instructions for Linux

Expand Down
10 changes: 7 additions & 3 deletions cmake/CommonAPIConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Config file for the CommonAPI package
# It defines the following variables
# COMMONAPI_INCLUDE_DIRS - include directories for CommonAPI
# Exports the follwing targets:
# CommonAPI - CMake target for CommonAPI SomeIP
# Additionally, the following variables are defined:
# COMMONAPI_VERSION - The CommonAPI version number

# Compute paths
get_filename_component(COMMONAPI_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(COMMONAPI_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")

# Our library dependencies (contains definitions for IMPORTED targets)
include("${COMMONAPI_CMAKE_DIR}/CommonAPITargets.cmake")

# Legacy variable, kept for compatibility
get_target_property(COMMONAPI_INCLUDE_DIRS CommonAPI INTERFACE_INCLUDE_DIRECTORIES)

set(COMMONAPI_VERSION @PACKAGE_VERSION@)
set(COMMONAPI_VERSION_STRING "@PACKAGE_VERSION@")
36 changes: 18 additions & 18 deletions include/CommonAPI/Address.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@

namespace CommonAPI {

class Address {
class COMMONAPI_EXPORT_CLASS_EXPLICIT Address {
public:
COMMONAPI_EXPORT Address();
COMMONAPI_EXPORT Address(const std::string &_address);
COMMONAPI_EXPORT Address(const std::string &_domain,
COMMONAPI_METHOD_EXPORT Address();
COMMONAPI_METHOD_EXPORT Address(const std::string &_address);
COMMONAPI_METHOD_EXPORT Address(const std::string &_domain,
const std::string &_interface,
const std::string &_instance);
COMMONAPI_EXPORT Address(const Address &_source);
COMMONAPI_EXPORT virtual ~Address() = default;
COMMONAPI_METHOD_EXPORT Address(const Address &_source);
COMMONAPI_METHOD_EXPORT virtual ~Address() = default;

COMMONAPI_EXPORT Address &operator=(const Address &_other);
COMMONAPI_METHOD_EXPORT Address &operator=(const Address &_other);

COMMONAPI_EXPORT bool operator==(const Address &_other) const;
COMMONAPI_EXPORT bool operator!=(const Address &_other) const;
COMMONAPI_EXPORT bool operator<(const Address &_other) const;
COMMONAPI_METHOD_EXPORT bool operator==(const Address &_other) const;
COMMONAPI_METHOD_EXPORT bool operator!=(const Address &_other) const;
COMMONAPI_METHOD_EXPORT bool operator<(const Address &_other) const;

COMMONAPI_EXPORT std::string getAddress() const;
COMMONAPI_EXPORT void setAddress(const std::string &_address);
COMMONAPI_METHOD_EXPORT std::string getAddress() const;
COMMONAPI_METHOD_EXPORT void setAddress(const std::string &_address);

COMMONAPI_EXPORT const std::string &getDomain() const;
COMMONAPI_EXPORT void setDomain(const std::string &_domain);
COMMONAPI_METHOD_EXPORT const std::string &getDomain() const;
COMMONAPI_METHOD_EXPORT void setDomain(const std::string &_domain);

COMMONAPI_EXPORT const std::string &getInterface() const;
COMMONAPI_EXPORT void setInterface(const std::string &_interface);
COMMONAPI_METHOD_EXPORT const std::string &getInterface() const;
COMMONAPI_METHOD_EXPORT void setInterface(const std::string &_interface);

COMMONAPI_EXPORT const std::string &getInstance() const;
COMMONAPI_EXPORT void setInstance(const std::string &_instance);
COMMONAPI_METHOD_EXPORT const std::string &getInstance() const;
COMMONAPI_METHOD_EXPORT void setInstance(const std::string &_instance);

private:
std::string domain_;
Expand Down
Loading

0 comments on commit e3818cb

Please sign in to comment.