Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iox-#590 Move unused and quality level 2 classes to separate packages #1559

Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aee570c
iox-#590 Move classes with target quality level 2 to iceoryx_dust and…
mossmaurice Aug 2, 2022
d5cc5e8
iox-#590 Update Readme and docs
mossmaurice Aug 2, 2022
6c7fdf4
iox-#590 Update iceoryx_hoofs Readme
mossmaurice Aug 2, 2022
6f9bb94
iox-#590 Make naming consistent with namespace
mossmaurice Aug 2, 2022
ae556e9
iox-#590 Adapt Bazel files accordingly to CMake changes
mossmaurice Aug 2, 2022
0a9d58a
iox-#590 Build iceoryx_dust module tests
mossmaurice Aug 2, 2022
57a67f1
iox-#590 Adapt include guard in FileReader
mossmaurice Aug 2, 2022
b169d89
iox-#590 Clang-format is my friend
mossmaurice Aug 2, 2022
ba9d698
iox-#590 Add iceoryx_dust to iceoryx_meta
mossmaurice Aug 2, 2022
2e7d247
iox-#590 Update used headers
mossmaurice Aug 2, 2022
dfa1115
iox-#590 Add readme for dust
mossmaurice Aug 3, 2022
c4bb1a8
iox-#590 Add missing main() for dust module tests
mossmaurice Aug 3, 2022
53e8d76
iox-#590 Add .bazel for dust tests
mossmaurice Aug 3, 2022
0ecf059
iox-#590 Fix DDS build by updating the include path
mossmaurice Aug 3, 2022
f3ca8f7
iox-#590 Move IoxIpcChannelType from hoofs to posh for Windows
mossmaurice Aug 3, 2022
5107cd4
iox-#590 Lint all Bazel files
mossmaurice Aug 3, 2022
d4d8199
iox-#590 Fix out-of-tree build
mossmaurice Aug 4, 2022
b8c3af8
iox-#590 Add NamedPipe include for Windows
mossmaurice Aug 4, 2022
fc60286
iox-#590 Add dust dependecy for dust tests in Bazel
mossmaurice Aug 4, 2022
1b344d7
iox-#590 Add dependencies for ROS 2 in package.xml
mossmaurice Aug 4, 2022
537c65a
iox-#590 Add package.xml for iceoryx_dust
mossmaurice Aug 4, 2022
fae12a6
iox-#590 Remove IoxIpcChannelType from all platforms
mossmaurice Aug 4, 2022
8497de3
iox-#590 Add release note entry for 'iceoryx_dust'
mossmaurice Aug 4, 2022
e63815c
iox-#590 Add find_package call for 'iceoryx_dust'
mossmaurice Aug 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Expand Up @@ -96,15 +96,16 @@ Please see the dedicated [README.md](tools/docker/README.md) for information on

Please see the [Quality Declaration](./QUALITY_DECLARATION.md) for details of the quality measures according to ROS 2 guidelines.

|CMake project/target | Current Level | Target Level QNX | Target Level <br> Linux, Windows, macOS | Comment |
|-----------------------|:-------------:|:-----------------:|:---------------------------------------:|:-----------------------------------:|
| iceoryx_hoofs | 2 | 1+ | 1 | Except code in the namespace `aux` |
| iceoryx_posh | 2 | 1+, 2 | 1 | Except code in the namespace `aux` |
| iceoryx_binding_c | 2 | 1+ | 1 | |
| iceoryx_examples | 5 | 4 | 4 | All example code in this folder |
| iceoryx_dds | 4 | 4 | 4 | |
| iceoryx_introspection | 5 | 4 | 4 | |
| iceoryx_meta | 5 | 5 | 5 | |
|CMake project/target | Current Level | Target Level QNX | Target Level <br> Linux, Windows, macOS |
|-----------------------|:-------------:|:-----------------:|:---------------------------------------:|
| iceoryx_hoofs | 2 | 1+ | 1 |
| iceoryx_posh | 2 | 1+, 2 | 1 |
| iceoryx_dust | 2 | 2 | 2 |
| iceoryx_binding_c | 2 | 2 | 2 |
| iceoryx_examples | 5 | 4 | 4 |
| iceoryx_dds | 4 | 4 | 4 |
| iceoryx_introspection | 5 | 4 | 4 |
| iceoryx_meta | 5 | 5 | 5 |

Is something missing or you've got ideas for other nifty examples? Jump right away to the next section!

Expand Down
Expand Up @@ -47,10 +47,6 @@ package iceoryx_hoofs {

}
component posix <<namespace>>

' Building blocks which only meet quality level 5
' Can be analysed with tools/analyse_blacklisted_namespaces_in_binary.sh
' component aux <<namespace>>
}
}

Expand Down
5 changes: 5 additions & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Expand Up @@ -66,6 +66,11 @@
- Remove AtomicRelocatablePointer [\#1512](https://github.com/eclipse-iceoryx/iceoryx/issues/1512)
- `SignalHandler` returns an `expected` in `registerSignalHandler` [\#1196](https://github.com/eclipse-iceoryx/iceoryx/issues/1196)
- Remove the unused `PosixRights` struct [\#1556](https://github.com/eclipse-iceoryx/iceoryx/issues/1556)
- Moved quality level 2 classes to new package `iceoryx_dust` [\#590](https://github.com/eclipse-iceoryx/iceoryx/issues/590)
- Removed unused classes from `iceoryx_hoofs` [\#590](https://github.com/eclipse-iceoryx/iceoryx/issues/590)
- `cxx::PoorMansHeap`
- Other `internal` classes


**Workflow:**

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_dds/source/gateway/main.cpp
Expand Up @@ -18,10 +18,10 @@
#include "iceoryx_dds/gateway/dds_to_iox.hpp"
#include "iceoryx_dds/gateway/iox_to_dds.hpp"
#include "iceoryx_dds/internal/log/logging.hpp"
#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp"
#include "iceoryx_hoofs/cxx/helplets.hpp"
#include "iceoryx_hoofs/cxx/optional.hpp"
#include "iceoryx_hoofs/platform/signal.hpp"
#include "iceoryx_hoofs/posix_wrapper/signal_watcher.hpp"
#include "iceoryx_posh/gateway/gateway_config.hpp"
#include "iceoryx_posh/gateway/toml_gateway_config_parser.hpp"
#include "iceoryx_posh/runtime/posh_runtime.hpp"
Expand Down
29 changes: 29 additions & 0 deletions iceoryx_dust/BUILD.bazel
@@ -0,0 +1,29 @@
# Copyright (c) 2022 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

load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "iceoryx_dust",
srcs = glob([
"source/**/*.cpp",
"source/**/*.hpp",
]),
hdrs = glob(["include/**"]),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = ["//iceoryx_hoofs"],
)
66 changes: 66 additions & 0 deletions iceoryx_dust/CMakeLists.txt
@@ -0,0 +1,66 @@
# Copyright (c) 2022 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

cmake_minimum_required(VERSION 3.16)

set(IOX_VERSION_STRING "2.90.0")
mossmaurice marked this conversation as resolved.
Show resolved Hide resolved

project(iceoryx_dust VERSION ${IOX_VERSION_STRING})

find_package(iceoryx_hoofs REQUIRED)

include(IceoryxPackageHelper)
include(IceoryxPlatform)

if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin)
option(BUILD_SHARED_LIBS "Create shared libraries by default" ON)
endif()

#
########## build iceoryx dust lib ##########
#

iox_add_library(
TARGET iceoryx_dust
NAMESPACE iceoryx_dust
PROJECT_PREFIX ${PREFIX}
PRIVATE_LIBS ${ICEORYX_SANITIZER_FLAGS}
PRIVATE_LIBS_LINUX ${CODE_COVERAGE_LIBS}
PUBLIC_LIBS iceoryx_hoofs::iceoryx_hoofs
BUILD_INTERFACE ${PROJECT_SOURCE_DIR}/include
INSTALL_INTERFACE include/${PREFIX}
FILES
source/cxx/file_reader.cpp
source/posix_wrapper/named_pipe.cpp
source/posix_wrapper/signal_watcher.cpp
source/posix_wrapper/message_queue.cpp
)

#
########## dust testing ##########
#

# Finding gtest and adding the subdirectories is split to support the use case of
# building the testing lib without the tests by providing gtest externally
if(NOT GTest_FOUND AND BUILD_TEST)
find_package(GTest CONFIG REQUIRED)
endif()

if(GTest_FOUND)
if(BUILD_TEST)
add_subdirectory(test)
endif()
endif()
18 changes: 18 additions & 0 deletions iceoryx_dust/README.md
@@ -0,0 +1,18 @@

# Eclipse iceoryx dust overview

Similar to iceoryx hoofs `iceoryx_dust` (**D**eemed **u**seful **s**oftware **t**hingies) is a library for basic building blocks.
Compared to hoofs classes in `iceoryx_dust`, the difference is that the classes in dust only conform to quality level 2.

There are a wide variety of building blocks
grouped together in categories or namespace, depending on where or how they are used.

| class/file | description |
|:---------------------:|:------------------------------------------------------------------------------------------------------------------------|
|`forward_list` | Heap and exception free, relocatable implementation of `std::forward_list` |
|`ObjectPool` | Container which stores raw objects without calling the ctor of the objects. |
|`FileReader` | Wrapper for opening files and reading them. |
|`MessageQueue` | Interface for Message Queues, see [ManPage mq_overview](https://www.man7.org/linux/man-pages/man7/mq_overview.7.html). |
|`SignalWatcher` | Batteries included signal handling with polling and optional blocking wait for `SIGINT` and `SIGTERM`. |
|`NamedPipe` | Shared memory based ipc channel. Mainly a `UnixDomainSocket` replacement on Windows. |
|`relocatable_ptr` | |
25 changes: 25 additions & 0 deletions iceoryx_dust/cmake/Config.cmake.in
@@ -0,0 +1,25 @@
# Copyright (c) 2020 by Robert Bosch GmbH 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

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

find_dependency(iceoryx_hoofs)

include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
list(APPEND CMAKE_MODULE_PATH "@DESTINATION_CONFIGDIR@")
check_required_components("@PROJECT_NAME@")
25 changes: 25 additions & 0 deletions iceoryx_dust/cmake/iceoryx_dustConfig.cmake
@@ -0,0 +1,25 @@
# Copyright (c) 2020 by Robert Bosch GmbH. 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

#
########## dummyConfig.cmake to be able to use find_package with the source tree ##########
#

if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED)
message(STATUS "The package '${CMAKE_FIND_PACKAGE_NAME}' is used in source code version.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED true CACHE INTERNAL "")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
24 changes: 24 additions & 0 deletions iceoryx_dust/cmake/iceoryx_dust_testingConfig.cmake
@@ -0,0 +1,24 @@
# Copyright (c) 2020 by Robert Bosch GmbH. 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

#
########## dummyConfig.cmake to be able to use find_package with the source tree ##########
#

if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED)
message(STATUS "The package '${CMAKE_FIND_PACKAGE_NAME}' is used in source code version.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND_PRINTED true CACHE INTERNAL "")
endif()
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_HOOFS_FILE_READER_FILE_READER_HPP
#define IOX_HOOFS_FILE_READER_FILE_READER_HPP
#ifndef IOX_DUST_FILE_READER_FILE_READER_HPP
#define IOX_DUST_FILE_READER_FILE_READER_HPP

#include <fstream>

Expand Down Expand Up @@ -75,4 +75,4 @@ class FileReader
} // namespace cxx
} // namespace iox

#endif // IOX_HOOFS_FILE_READER_FILE_READER_HPP
#endif // IOX_DUST_FILE_READER_FILE_READER_HPP
Expand Up @@ -15,8 +15,8 @@
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_HOOFS_CXX_FORWARD_LIST_HPP
#define IOX_HOOFS_CXX_FORWARD_LIST_HPP
#ifndef IOX_DUST_CXX_FORWARD_LIST_HPP
#define IOX_DUST_CXX_FORWARD_LIST_HPP

#include "iceoryx_hoofs/cxx/helplets.hpp"

Expand Down Expand Up @@ -368,6 +368,6 @@ class forward_list
} // namespace cxx
} // namespace iox

#include "iceoryx_hoofs/internal/cxx/forward_list.inl"
#include "iceoryx_dust/internal/cxx/forward_list.inl"

#endif // IOX_HOOFS_CXX_FORWARD_LIST_HPP
#endif // IOX_DUST_CXX_FORWARD_LIST_HPP
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_HOOFS_OBJECTPOOL_OBJECTPOOL_HPP
#define IOX_HOOFS_OBJECTPOOL_OBJECTPOOL_HPP
#ifndef IOX_DUST_OBJECTPOOL_OBJECTPOOL_HPP
#define IOX_DUST_OBJECTPOOL_OBJECTPOOL_HPP

#include <cstddef> //for size_t
#include <cstdint>
Expand Down Expand Up @@ -451,4 +451,4 @@ class ObjectPool
} // namespace cxx
} // namespace iox

#endif // IOX_HOOFS_OBJECTPOOL_OBJECTPOOL_HPP
#endif // IOX_DUST_OBJECTPOOL_OBJECTPOOL_HPP
Expand Up @@ -15,11 +15,11 @@
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_HOOFS_CXX_FORWARD_LIST_INL
#define IOX_HOOFS_CXX_FORWARD_LIST_INL
#ifndef IOX_DUST_CXX_FORWARD_LIST_INL
#define IOX_DUST_CXX_FORWARD_LIST_INL


#include "iceoryx_hoofs/cxx/forward_list.hpp"
#include "iceoryx_dust/cxx/forward_list.hpp"


namespace iox
Expand Down Expand Up @@ -619,4 +619,4 @@ inline void forward_list<T, Capacity>::errorMessage(const char* source, const ch
} // namespace cxx
} // namespace iox

#endif // IOX_HOOFS_CXX_FORWARD_LIST_INL
#endif // IOX_DUST_CXX_FORWARD_LIST_INL
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_HOOFS_POSIX_WRAPPER_MESSAGE_QUEUE_HPP
#define IOX_HOOFS_POSIX_WRAPPER_MESSAGE_QUEUE_HPP
#ifndef IOX_DUST_POSIX_WRAPPER_MESSAGE_QUEUE_HPP
#define IOX_DUST_POSIX_WRAPPER_MESSAGE_QUEUE_HPP

#include "iceoryx_hoofs/cxx/optional.hpp"
#include "iceoryx_hoofs/design_pattern/creation.hpp"
Expand Down Expand Up @@ -128,4 +128,4 @@ class MessageQueue : public DesignPattern::Creation<MessageQueue, IpcChannelErro
} // namespace posix
} // namespace iox

#endif // IOX_HOOFS_POSIX_WRAPPER_MESSAGE_QUEUE_HPP
#endif // IOX_DUST_POSIX_WRAPPER_MESSAGE_QUEUE_HPP
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_HOOFS_POSIX_WRAPPER_NAMED_PIPE_HPP
#define IOX_HOOFS_POSIX_WRAPPER_NAMED_PIPE_HPP
#ifndef IOX_DUST_POSIX_WRAPPER_NAMED_PIPE_HPP
#define IOX_DUST_POSIX_WRAPPER_NAMED_PIPE_HPP

#include "iceoryx_hoofs/concurrent/lockfree_queue.hpp"
#include "iceoryx_hoofs/cxx/string.hpp"
Expand Down
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_HOOFS_POSIX_WRAPPER_SIGNAL_WATCHER_HPP
#define IOX_HOOFS_POSIX_WRAPPER_SIGNAL_WATCHER_HPP
#ifndef IOX_DUST_POSIX_WRAPPER_SIGNAL_WATCHER_HPP
#define IOX_DUST_POSIX_WRAPPER_SIGNAL_WATCHER_HPP

#include "iceoryx_hoofs/posix_wrapper/signal_handler.hpp"
#include "iceoryx_hoofs/posix_wrapper/unnamed_semaphore.hpp"
Expand Down
Expand Up @@ -14,8 +14,8 @@
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_HOOFS_RELOCATABLE_POINTER_RELOCATABLE_PTR_HPP
#define IOX_HOOFS_RELOCATABLE_POINTER_RELOCATABLE_PTR_HPP
#ifndef IOX_DUST_RELOCATABLE_POINTER_RELOCATABLE_PTR_HPP
#define IOX_DUST_RELOCATABLE_POINTER_RELOCATABLE_PTR_HPP

#include <cstdint>
#include <type_traits>
Expand Down Expand Up @@ -144,6 +144,6 @@ bool operator!=(const relocatable_ptr<T>& lhs, const relocatable_ptr<T>& rhs) no
} // namespace rp
} // namespace iox

#include "iceoryx_hoofs/internal/relocatable_pointer/relocatable_ptr.inl"
#include "iceoryx_dust/relocatable_pointer/relocatable_ptr.inl"

#endif // IOX_HOOFS_RELOCATABLE_POINTER_RELOCATABLE_PTR_HPP
#endif // IOX_DUST_RELOCATABLE_POINTER_RELOCATABLE_PTR_HPP