Skip to content

Commit

Permalink
capicxx-core-runtime 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzbichler committed Oct 27, 2020
1 parent 99ebf34 commit 89720d3
Show file tree
Hide file tree
Showing 50 changed files with 685 additions and 514 deletions.
38 changes: 38 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
capi_srcs = [
"src/CommonAPI/**/*.cpp"
]

cc_defaults {
name: "capi_defaults",
cppflags: [
"-std=c++11",
"-Wall",
"-Wextra",
"-Wformat",
"-Wformat-security",
"-Wconversion",
"-Wno-attributes",
"-fexceptions",
"-fstrict-aliasing",
"-fstack-protector",
"-fasynchronous-unwind-tables",
"-fno-omit-frame-pointer",
"-Werror",
"-fvisibility=hidden",
"-DCOMMONAPI_INTERNAL_COMPILATION"
]
}

cc_library_shared {
name: "libCommonAPI",
vendor: true,
srcs: capi_srcs,
defaults: [
"capi_defaults"
],
local_include_dirs: [
"include"
],
export_include_dirs: ["include"],
rtti: true
}
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changes
=======

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

v3.1.12.6
- Fix race condition leading to event delivery after unsubscription

Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# 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 @@ -9,8 +9,8 @@ PROJECT(libcommonapi)

# version of CommonAPI
SET( LIBCOMMONAPI_MAJOR_VERSION 3 )
SET( LIBCOMMONAPI_MINOR_VERSION 1 )
SET( LIBCOMMONAPI_PATCH_VERSION 12 )
SET( LIBCOMMONAPI_MINOR_VERSION 2 )
SET( LIBCOMMONAPI_PATCH_VERSION 0 )

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

Expand Down Expand Up @@ -102,14 +102,14 @@ 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")
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")
ENDIF(MSVC)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_${MAX_LOG_LEVEL}")

FIND_PACKAGE(PkgConfig)
pkg_check_modules(DLT "automotive-dlt >= 2.11")
IF(DLT_FOUND)
IF(DLT_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_DLT")
ENDIF(DLT_FOUND)

Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### CommonAPI C++ Core Runtime

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

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.
Expand Down Expand Up @@ -33,3 +33,16 @@ You can change the installation directory by the CMake variable _CMAKE_INSTALL_P

For further build instructions (build for windows, build documentation, tests etc.) please refer to the CommonAPI tutorial.

##### Build Instructions for Android

In general for building the Android source tree the instructions found on the pages from the Android Open Source Project (AOSP) apply (https://source.android.com/setup/build/requirements).

To integrate the CommonAPI Core Runtime library into the build process, the source code together with the Android.bp file has to be inserted into the Android source tree (by simply copying or by fetching with a custom platform manifest).
When building the Android source tree, the Android.bp file is automatically found and considered by the build system.

In order that the CommonAPI Core Runtime library is also included in the Android image, the library has to be added to the PRODUCT_PACKAGES variable in one of a device/target specific makefile:

```
PRODUCT_PACKAGES += \
libCommonAPI
```
2 changes: 1 addition & 1 deletion docx/01_mainpage.dox
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* \copyright
*
* Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This file is part of GENIVI project IPC CommonAPI C++.
*
Expand Down
10 changes: 8 additions & 2 deletions include/CommonAPI/Address.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_ADDRESS_HPP_
#define COMMONAPI_ADDRESS_HPP_

Expand All @@ -21,7 +25,9 @@ class Address {
const std::string &_interface,
const std::string &_instance);
COMMONAPI_EXPORT Address(const Address &_source);
COMMONAPI_EXPORT virtual ~Address();
COMMONAPI_EXPORT virtual ~Address() = default;

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

COMMONAPI_EXPORT bool operator==(const Address &_other) const;
COMMONAPI_EXPORT bool operator!=(const Address &_other) const;
Expand Down
4 changes: 2 additions & 2 deletions include/CommonAPI/Attribute.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_ATTRIBUTE_HPP_
Expand Down
2 changes: 1 addition & 1 deletion include/CommonAPI/AttributeExtension.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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 Down
6 changes: 5 additions & 1 deletion include/CommonAPI/ByteBuffer.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_BYTE_BUFFER_HPP_
#define COMMONAPI_BYTE_BUFFER_HPP_

Expand Down
25 changes: 11 additions & 14 deletions include/CommonAPI/CallInfo.hpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
// Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_CALLINFO_HPP_
#define COMMONAPI_CALLINFO_HPP_

#include <CommonAPI/Config.hpp>
#include <CommonAPI/Types.hpp>
#include <string>

namespace CommonAPI {

struct COMMONAPI_EXPORT CallInfo {
CallInfo()
: timeout_(DEFAULT_SEND_TIMEOUT_MS), sender_(0) {
}
CallInfo(Timeout_t _timeout)
: timeout_(_timeout), sender_(0) {
}
CallInfo(Timeout_t _timeout, Sender_t _sender)
: timeout_(_timeout), sender_(_sender) {
}
CallInfo(const CallInfo &_other)
: timeout_(_other.timeout_), sender_(_other.sender_) {
}
CallInfo();
CallInfo(Timeout_t _timeout);
CallInfo(const CallInfo &_other);
CallInfo(Timeout_t _timeout, Sender_t _sender);

Timeout_t timeout_;
Sender_t sender_;
};

} // namespace CommonAPI

#endif // COMMONAPI_ADDRESS_HPP_
#endif // COMMONAPI_CALLINFO_HPP_
6 changes: 5 additions & 1 deletion include/CommonAPI/CommonAPI.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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 @@ -8,6 +8,7 @@

#ifndef COMMONAPI_INTERNAL_COMPILATION
#define COMMONAPI_INTERNAL_COMPILATION
#define HAS_DEFINED_COMMONAPI_INTERNAL_COMPILATION_HERE
#endif

#include "Address.hpp"
Expand All @@ -18,6 +19,9 @@
#include "Runtime.hpp"
#include "Types.hpp"

#ifdef HAS_DEFINED_COMMONAPI_INTERNAL_COMPILATION_HERE
#undef COMMONAPI_INTERNAL_COMPILATION
#undef HAS_DEFINED_COMMONAPI_INTERNAL_COMPILATION_HERE
#endif

#endif // COMMONAPI_HPP_
6 changes: 5 additions & 1 deletion include/CommonAPI/Config.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_CONFIG_HPP_
#define COMMONAPI_CONFIG_HPP_

Expand Down
17 changes: 8 additions & 9 deletions include/CommonAPI/ContainerUtils.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_CONTAINERUTILS_HPP_
Expand All @@ -16,18 +16,17 @@
#include <CommonAPI/Export.hpp>

namespace CommonAPI {

class ClientId;

struct COMMONAPI_EXPORT SharedPointerClientIdContentHash : public std::unary_function<std::shared_ptr<ClientId>, size_t> {
size_t operator()(const std::shared_ptr<ClientId>& t) const;
struct COMMONAPI_EXPORT SharedPointerClientIdContentHash {
size_t operator()(const std::shared_ptr<ClientId> &_t) const;
};

struct COMMONAPI_EXPORT SharedPointerClientIdContentEqual : public std::binary_function<std::shared_ptr<ClientId>, std::shared_ptr<ClientId>, bool> {
bool operator()(const std::shared_ptr<ClientId>& a, const std::shared_ptr<ClientId>& b) const;
struct COMMONAPI_EXPORT SharedPointerClientIdContentEqual {
bool operator()(const std::shared_ptr<ClientId> &_lhs, const std::shared_ptr<ClientId> &_rhs) const;
};


} // namespace std

} // namespace CommonAPI

#endif // COMMONAPI_CONTAINERUTILS_HPP_
9 changes: 7 additions & 2 deletions include/CommonAPI/Deployable.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2014-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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/.

#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif

#ifndef COMMONAPI_DEPLOYABLE_HPP_
Expand All @@ -28,6 +28,11 @@ struct Deployable : DeployableBase
depl_(const_cast<TypeDepl_ *>(_depl)) {
};

Deployable(const Deployable<Type_, TypeDepl_> &_other)
: value_(_other.value_),
depl_(_other.depl_) {
}

Deployable<Type_, TypeDepl_>& operator=(const Deployable<Type_, TypeDepl_> &_source) {
value_ = _source.value_;
depl_ = _source.depl_;
Expand Down
2 changes: 1 addition & 1 deletion include/CommonAPI/Deployment.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2014-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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 Down
2 changes: 1 addition & 1 deletion include/CommonAPI/Enumeration.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// 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 Down
Loading

0 comments on commit 89720d3

Please sign in to comment.