Skip to content

Commit

Permalink
Merge branch 'iceoryx/master' into iox-eclipse-iceoryx#605-cleanup-re…
Browse files Browse the repository at this point in the history
…locatable-ptr

Signed-off-by: Marika Lehmann <[email protected]>
  • Loading branch information
FerdinandSpitzschnueffler committed Mar 17, 2021
2 parents 69fc53c + 5266b66 commit 1bfa74e
Show file tree
Hide file tree
Showing 155 changed files with 3,384 additions and 1,575 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Checks: '-*,readability-*,performance-*,hicpp-*,cppcoreguidelines-*,concurrency-*,clang-analyzer-*,cert-*,bugprone-*'
Checks: '-*,readability-*,-readability-named-parameter,-readability-avoid-const-params-in-decls,performance-*,hicpp-*,-hicpp-named-parameter,-hicpp-avoid-c-arrays,cppcoreguidelines-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-pro-bounds-constant-array-index,concurrency-*,clang-analyzer-*,cert-*,bugprone-*'
CheckOptions:
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
Expand Down
11 changes: 6 additions & 5 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# codecov yaml
comment: yes # do not comment PR with the result
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: yes # only post the comment if coverage changes
require_changes: yes
require_base: no
require_head: yes

coverage:
range: 70..100
range: 70..100

status:
project:
Expand All @@ -19,8 +19,9 @@ coverage:
default:
enabled: yes
target: 70%
threshold: 2%
changes: yes
threshold: 2%
base: auto
changes: no

parsers:
gcov:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: Colcon build
name: Iceoryx Integrationtests

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install Iceoryx Dependencies
run: |
sudo apt install -y apt-transport-https
sudo apt update && sudo apt install -y cmake libacl1-dev libncurses5-dev pkg-config
sudo apt update && sudo apt install -y cmake libacl1-dev libncurses5-dev pkg-config ros-foxy-ros-testing
mkdir -p src/iceoryx
cd $GITHUB_WORKSPACE/src/iceoryx
Expand All @@ -48,7 +48,16 @@ jobs:
sudo sed -i '41 c\"'c'", "'cc'", "'cpp'", "'cxx'", "'h'", "'hh'", "'hpp'", "'hxx'", "'inl'", "'sh'"' /opt/ros/foxy/lib/python3.8/site-packages/ament_copyright/main.py
ament_copyright --exclude LICENSE CONTRIBUTING.md tools/apache2_header.txt
- name: Build & Test
- name: Build
run: |
source /opt/ros/foxy/setup.bash
cd $GITHUB_WORKSPACE
colcon build
- name: Test Execution
run: |
source /opt/ros/foxy/setup.bash
source $GITHUB_WORKSPACE/install/setup.bash
cd $GITHUB_WORKSPACE
colcon test --packages-select iceoryx_integrationtest
colcon test-result --all --verbose
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ clangd/
site/
doc/website/API-reference/
*.project
__pycache__
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

[![Build & Test](https://github.com/eclipse-iceoryx/iceoryx/workflows/Build%20&%20Test/badge.svg?branch=master)](https://github.com/eclipse-iceoryx/iceoryx/actions)
[![Colcon build](https://github.com/eclipse-iceoryx/iceoryx/workflows/Colcon%20build/badge.svg?branch=master)](https://github.com/eclipse-iceoryx/iceoryx/actions)
[![Integrationtests](https://github.com/eclipse-iceoryx/iceoryx/workflows/Iceoryx%20Integrationtests/badge.svg?branch=master)](https://github.com/eclipse-iceoryx/iceoryx/actions)
[![Gitter](https://badges.gitter.im/eclipse-iceoryx/iceoryx.svg)](https://gitter.im/eclipse/iceoryx)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Codecov](https://codecov.io/gh/eclipse-iceoryx/iceoryx/branch/master/graph/badge.svg?branch=master)](https://codecov.io/gh/eclipse-iceoryx/iceoryx?branch=master)
Expand Down
8 changes: 7 additions & 1 deletion cmake/cpptoml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ else()
set(CREATE_PATH_COMMAND mkdir -p)
endif()

if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
set(cpptoml_DIR ${CMAKE_BINARY_DIR}/dependencies/install/lib/cmake/cpptoml)
set(cpptoml_DIR ${cpptoml_DIR} CACHE PATH "" FORCE)
endif()

# set download config, source and build paths
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/cpptoml/download)
set(SOURCE_DIR ${CMAKE_BINARY_DIR}/dependencies/cpptoml/src)
Expand All @@ -57,7 +63,7 @@ endif()

file(MAKE_DIRECTORY ${BUILD_DIR})

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DENABLE_LIBCXX=off" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${SOURCE_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DENABLE_LIBCXX=off" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${TOOLCHAIN_FILE}" "${SOURCE_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
if(result)
Expand Down
8 changes: 6 additions & 2 deletions cmake/cyclonedds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ else()
set(CREATE_PATH_COMMAND mkdir -p)
endif(WIN32)

if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()

# ===== Helpers
function(fetch_and_install name)
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/${name}/download)
Expand All @@ -42,7 +46,7 @@ function(fetch_and_install name)

# Fetch source
configure_file(${name}.cmake.in ${DOWNLOAD_CONFIG_DIR}/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "${DOWNLOAD_CONFIG_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "${TOOLCHAIN_FILE}" "${DOWNLOAD_CONFIG_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${DOWNLOAD_CONFIG_DIR} )
if(result)
Expand Down Expand Up @@ -71,7 +75,7 @@ function(fetch_and_install name)
endforeach()
string( REPLACE ";" " " ADDITIONAL_CMAKE_FLAGS "${ADDITIONAL_CMAKE_FLAGS}")

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${ADDITIONAL_CMAKE_FLAGS}" "${SOURCE_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${ADDITIONAL_CMAKE_FLAGS}" "${TOOLCHAIN_FILE}" "${SOURCE_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
if(result)
Expand Down
12 changes: 9 additions & 3 deletions cmake/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.5)
project(googletest-build CXX)

if(BUILD_TEST)

include(ProcessorCount)
ProcessorCount(N)

Expand All @@ -33,6 +33,12 @@ if(BUILD_TEST)
set(ENABLE_STATIC_DEBUG "-Dgtest_force_shared_crt=ON")
endif(WIN32)

if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
set(GTest_DIR ${CMAKE_BINARY_DIR}/dependencies/install/lib/cmake/GTest)
set(GTest_DIR ${GTest_DIR} CACHE PATH "" FORCE)
endif()

# set download confi, source and build paths
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/googletest/download)
set(SOURCE_DIR ${CMAKE_BINARY_DIR}/dependencies/googletest/src)
Expand All @@ -41,7 +47,7 @@ if(BUILD_TEST)

# Download and unpack googletest at configure time
configure_file(googletest.cmake.in ${DOWNLOAD_CONFIG_DIR}/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "${DOWNLOAD_CONFIG_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "${TOOLCHAIN_FILE}" "${DOWNLOAD_CONFIG_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${DOWNLOAD_CONFIG_DIR} )
if(result)
Expand All @@ -57,7 +63,7 @@ if(BUILD_TEST)

file(MAKE_DIRECTORY ${BUILD_DIR})

execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${SOURCE_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${TOOLCHAIN_FILE}" "${SOURCE_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
if(result)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Intermediate examples

{! ./../iceoryx_examples/callbacks/README.md !}
{! ./../iceoryx_examples/callbacks_in_c/README.md !}
{! ./../iceoryx_examples/waitset/README.md !}
{! ./../iceoryx_examples/waitset_in_c/README.md !}
{! ./../iceoryx_examples/singleprocess/README.md !}
23 changes: 16 additions & 7 deletions doc/website/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@ iceoryx_utils and iceoryx_posh are deployed as independent cmake packages. Posh
- 64-bit hardware (e.g. x86_64 or aarch64; 32-bit hardware might work, but is not supported)
- [cmake](https://cmake.org), 3.5 or later
- One of the following compilers:
- [gcc](https://gcc.gnu.org), 7.4 or later
- [gcc](https://gcc.gnu.org), 7.4 or later (5.4 currently supported too)
- [clang](https://clang.llvm.org), 9.0 or later
- [msvc](https://visualstudio.microsoft.com/de/), part of Visual Studio 2019 or later
- [libacl](http://download.savannah.gnu.org/releases/acl/), 2.2 or later. Only for Linux & QNX.
- optional, [ncurses](https://invisible-island.net/ncurses/), 6.2 or later. Required by introspectiont tool.
- optional, [ncurses](https://invisible-island.net/ncurses/), 6.2 or later. Required by introspection tool.

#### Optional, Cyclone DDS Gateway
If you would like to use our Cyclone DDS Gateway you have to install
[Cyclone DDS](https://github.com/eclipse-cyclonedds/cyclonedds) first. Furthermore
you have to install:
If you would like to use our Cyclone DDS Gateway you have to install [Cyclone DDS](https://github.com/eclipse-cyclonedds/cyclonedds) first.<br>
Furthermore you have to install:

- [Apache Maven](http://maven.apache.org/download.cgi), 3.5 or later
- [OpenJDK](http://jdk.java.net/11/), 11.0 or later. Alternatively Java JDK, version 8 or later
- [OpenJDK](http://jdk.java.net/11/), 11.0 or later. Alternatively, Java JDK version 8 or later

**Hint:** If you are behind a corporate firewall you may have to adjust the proxy
settings of maven in `/etc/maven/settings.xml`. See: [Maven Proxy Configuration](https://maven.apache.org/settings.html#proxies)

### Mac OS

Before installing iceoryx you need a XCode installation, git and optional an installed ncurses library for
Before installing iceoryx you need to install XCode and git. Optionally, ncurses library is required for
the introspection client. To install ncurses locally into your build folder follow these steps
```
cd iceoryx
Expand All @@ -54,6 +53,16 @@ sudo apt install gcc g++ cmake libacl1-dev libncurses5-dev pkg-config

Additionally, there is an optional dependency to the MIT licensed [cpptoml](https://github.com/skystrife/cpptoml) library, which is used to parse a RouDi config file for the mempool config.

### QNX

QNX SDP 7.0 and 7.1 are supported (shipping with gcc 5.4 and gcc 8.3 respectively).

Easiest way to build iceoryx on QNX is using the build script and providing a toolchain file.<br>
Example:
```
./tools/iceoryx_build_test.sh -t /home/user/toolchains/qnx/qcc_x86_64_toolchain.cmake
```


## Build with CMake

Expand Down
3 changes: 2 additions & 1 deletion iceoryx_binding_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ add_library(${PROJECT_NAME}
source/cpp2c_enum_translation.cpp
source/cpp2c_publisher.cpp
source/cpp2c_subscriber.cpp
source/cpp2c_service_description_translation.cpp
)
add_library(${PROJECT_NAMESPACE}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

Expand All @@ -74,7 +75,7 @@ target_include_directories(${PROJECT_NAME}
$<INSTALL_INTERFACE:include/${PREFIX}>
)

if(NOT WIN32)
if(NOT (WIN32 OR QNX))
target_link_libraries(${PROJECT_NAME}
PUBLIC
stdc++
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_BINDING_C_CPP2C_SERVICE_DESCRIPTION_TRANSLATION_HPP
#define IOX_BINDING_C_CPP2C_SERVICE_DESCRIPTION_TRANSLATION_HPP

#include "iceoryx_binding_c/service_description.h"
#include "iceoryx_posh/capro/service_description.hpp"

iox_service_description_t
TranslateServiceDescription(const iox::capro::ServiceDescription& serviceDescription) noexcept;

#endif

5 changes: 5 additions & 0 deletions iceoryx_binding_c/include/iceoryx_binding_c/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "iceoryx_binding_c/enums.h"
#include "iceoryx_binding_c/internal/c2cpp_binding.h"
#include "iceoryx_binding_c/service_description.h"
#include "iceoryx_binding_c/types.h"

/// @brief publisher handle
Expand Down Expand Up @@ -116,4 +117,8 @@ bool iox_pub_is_offered(iox_pub_t const self);
/// @return true if there are subscribers otherwise false
bool iox_pub_has_subscribers(iox_pub_t const self);

/// @brief returns the service description of the publisher
/// @param[in] self handle to the publisher
/// @return the service description
iox_service_description_t iox_pub_get_service_description(iox_pub_t const self);
#endif
33 changes: 33 additions & 0 deletions iceoryx_binding_c/include/iceoryx_binding_c/service_description.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_BINDING_C_SERVICE_DESCRIPTION_H
#define IOX_BINDING_C_SERVICE_DESCRIPTION_H

#include <stdint.h>

typedef struct
{
uint16_t serviceId;
uint16_t instanceId;
uint16_t eventId;

char serviceString[100U];
char instanceString[100U];
char eventString[100U];
} iox_service_description_t;

#endif
5 changes: 5 additions & 0 deletions iceoryx_binding_c/include/iceoryx_binding_c/subscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "iceoryx_binding_c/enums.h"
#include "iceoryx_binding_c/internal/c2cpp_binding.h"
#include "iceoryx_binding_c/service_description.h"
#include "iceoryx_binding_c/types.h"

/// @brief Subscriber handle
Expand Down Expand Up @@ -117,4 +118,8 @@ bool iox_sub_has_chunks(iox_sub_t const self);
/// @return true if there are lost chunks due to overflowing queue, otherwise false
bool iox_sub_has_lost_chunks(iox_sub_t const self);

/// @brief returns the service description of the subscriber
/// @param[in] self handle to the subscriber
/// @return the service description
iox_service_description_t iox_sub_get_service_description(iox_sub_t const self);
#endif
2 changes: 1 addition & 1 deletion iceoryx_binding_c/include/iceoryx_binding_c/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct iox_ws_storage_t_
{
// the value of the array size is the result of the following formula:
// sizeof(WaitSet) / 8
uint64_t do_not_touch_me[2567];
uint64_t do_not_touch_me[2696];
};
typedef struct iox_ws_storage_t_ iox_ws_storage_t;

Expand Down
7 changes: 7 additions & 0 deletions iceoryx_binding_c/source/c_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "iceoryx_binding_c/internal/cpp2c_enum_translation.hpp"
#include "iceoryx_binding_c/internal/cpp2c_publisher.hpp"
#include "iceoryx_binding_c/internal/cpp2c_service_description_translation.hpp"
#include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp"
#include "iceoryx_posh/runtime/posh_runtime.hpp"

Expand Down Expand Up @@ -149,3 +150,9 @@ bool iox_pub_has_subscribers(iox_pub_t const self)
{
return PublisherPortUser(self->m_portData).hasSubscribers();
}

iox_service_description_t iox_pub_get_service_description(iox_pub_t const self)
{
return TranslateServiceDescription(PublisherPortUser(self->m_portData).getCaProServiceDescription());
}

6 changes: 6 additions & 0 deletions iceoryx_binding_c/source/c_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "iceoryx_binding_c/enums.h"
#include "iceoryx_binding_c/internal/cpp2c_enum_translation.hpp"
#include "iceoryx_binding_c/internal/cpp2c_service_description_translation.hpp"
#include "iceoryx_binding_c/internal/cpp2c_subscriber.hpp"
#include "iceoryx_binding_c/internal/cpp2c_waitset.hpp"
#include "iceoryx_posh/internal/popo/building_blocks/condition_variable_data.hpp"
Expand Down Expand Up @@ -149,3 +150,8 @@ bool iox_sub_has_lost_chunks(iox_sub_t const self)
{
return SubscriberPortUser(self->m_portData).hasLostChunksSinceLastCall();
}

iox_service_description_t iox_sub_get_service_description(iox_sub_t const self)
{
return TranslateServiceDescription(SubscriberPortUser(self->m_portData).getCaProServiceDescription());
}
Loading

0 comments on commit 1bfa74e

Please sign in to comment.