Skip to content

Commit

Permalink
Merge pull request eclipse-iceoryx#1899 from ApexAI/iox-1391-move-pri…
Browse files Browse the repository at this point in the history
…mitives-files

iox-1391 move primitives files
  • Loading branch information
FerdinandSpitzschnueffler authored Feb 16, 2023
2 parents 697adc9 + c30c2c3 commit 2f87030
Show file tree
Hide file tree
Showing 82 changed files with 321 additions and 191 deletions.
6 changes: 3 additions & 3 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
iox::cxx::isPowerOfTwo(..);

// after
#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iox/algorithm.hpp"
iox::greater_or_equal(..);
iox::range(..);
iox::BestFittingType(..);
Expand Down Expand Up @@ -474,7 +474,7 @@
constexpr uint32_t MIN_VAL = algorithm::min(3, 1890, 57);

// after
#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iox/algorithm.hpp"
constexpr uint32_t MAX_VAL = algorithm::maxVal(3, 1890, 57);
constexpr uint32_t MIN_VAL = algorithm::minVal(3, 1890, 57);
```
Expand Down Expand Up @@ -642,7 +642,7 @@

In the C binding the `Iceoryx_LogLevel_Verbose` changed to `Iceoryx_LogLevel_Trace`.

29. `LogLevel` enum moved from `iceoryx_hoofs/log/logcommon.hpp` to `iceoryx_hoofs/iceoryx_hoofs_types.hpp`
29. `LogLevel` enum moved from `iceoryx_hoofs/log/logcommon.hpp` to `iox/iceoryx_hoofs_types.hpp`

30. Using multiple logger instances and logging directly via a logger instance in not supported anymore out of the box

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ inline T OptionManager::defineOption(T& referenceToMember,
{shortName, IS_NO_SWITCH, name, into<lossy<Argument_t>>(cxx::convert::toString(defaultArgumentValue))},
description,
optionType,
{cxx::TypeInfo<T>::NAME}});
{TypeInfo<T>::NAME}});

m_assignments.emplace_back([this, &referenceToMember, optionType, shortName, name](Arguments& arguments) {
referenceToMember = extractOptionArgumentValue<T>(arguments, shortName, name, optionType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inline std::string FromImpl<string<N>, std::string>::fromImpl(const string<N>& v
template <uint64_t N>
inline string<N> FromImpl<std::string, string<N>>::fromImpl(const std::string&) noexcept
{
static_assert(cxx::always_false_v<std::string> && cxx::always_false_v<string<N>>, "\n \
static_assert(always_false_v<std::string> && always_false_v<string<N>>, "\n \
The conversion from 'std::string' to 'iox::sring<N>' is potentially lossy!\n \
This happens when the size of source string exceeds the capacity of the destination string!\n \
Please use 'iox::into<iox::lossy<iox::string<N>>>' which returns a 'iox::string<N>' and truncates the\n \
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_dust/source/cli/command_line_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// SPDX-License-Identifier: Apache-2.0

#include "iceoryx_dust/internal/cli/command_line_parser.hpp"
#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iceoryx_hoofs/error_handling/error_handling.hpp"
#include "iox/algorithm.hpp"

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_dust/test/moduletests/test_cxx_forward_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// SPDX-License-Identifier: Apache-2.0

#include "iceoryx_dust/cxx/forward_list.hpp"
#include "iceoryx_hoofs/cxx/attributes.hpp"
#include "iceoryx_hoofs/error_handling/error_handling.hpp"
#include "iceoryx_hoofs/testing/fatal_failure.hpp"
#include "iox/attributes.hpp"
#include "test.hpp"

namespace
Expand Down
1 change: 1 addition & 0 deletions iceoryx_hoofs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ cc_library(
"filesystem/source/*.cpp",
"memory/source/*.cpp",
"posix/time/source/*.cpp",
"primitives/source/*.cpp",
"source/**/*.cpp",
"time/source/*.cpp",
"vocabulary/source/**/*.cpp",
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ iox_add_library(
memory/source/memory.cpp
posix/time/source/adaptive_wait.cpp
posix/time/source/deadline_timer.cpp
primitives/source/type_traits.cpp
source/concurrent/loffli.cpp
source/cxx/requires.cpp
source/cxx/type_traits.cpp
source/cxx/unique_id.cpp
source/error_handling/error_handler.cpp
source/error_handling/error_handling.cpp
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/buffer/include/iox/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef IOX_HOOFS_BUFFER_STACK_HPP
#define IOX_HOOFS_BUFFER_STACK_HPP

#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iox/algorithm.hpp"
#include "iox/optional.hpp"
#include "iox/uninitialized_array.hpp"

Expand Down
6 changes: 3 additions & 3 deletions iceoryx_hoofs/container/include/iox/uninitialized_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef IOX_HOOFS_CONTAINER_UNINITIALIZED_ARRAY_HPP
#define IOX_HOOFS_CONTAINER_UNINITIALIZED_ARRAY_HPP

#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

#include <cstdint>

Expand All @@ -35,7 +35,7 @@ struct ZeroedBuffer
{
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-M0.1.3 : required by low level UninitializedArray building block and encapsulated in abstraction, declaration of field in struct for usage elsewhere
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
cxx::byte_t data[sizeof(ElementType)];
byte_t data[sizeof(ElementType)];
};
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction, object size limit is not relevant for containers stored in shared memory.
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
Expand All @@ -52,7 +52,7 @@ struct NonZeroedBuffer
{
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-M0.1.3 : required by low level UninitializedArray building block and encapsulated in abstraction, declaration of field in struct for usage elsewhere
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
cxx::byte_t data[sizeof(ElementType)];
byte_t data[sizeof(ElementType)];
};
// AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction, object size limit is not relevant for containers stored in shared memory
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_hoofs/container/include/iox/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#ifndef IOX_HOOFS_CONTAINER_VECTOR_HPP
#define IOX_HOOFS_CONTAINER_VECTOR_HPP

#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iceoryx_hoofs/cxx/attributes.hpp"
#include "iceoryx_hoofs/cxx/requires.hpp"
#include "iceoryx_hoofs/log/logging.hpp"
#include "iox/algorithm.hpp"
#include "iox/attributes.hpp"
#include "iox/uninitialized_array.hpp"

#include <algorithm>
Expand Down
12 changes: 6 additions & 6 deletions iceoryx_hoofs/design/include/iox/detail/functional_interface.inl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ template <typename Derived>
template <typename StringType>
inline void Expect<Derived>::expect(const StringType& msg) const noexcept
{
static_assert(cxx::is_char_array<StringType>::value || is_cxx_string<StringType>::value,
static_assert(is_char_array<StringType>::value || is_cxx_string<StringType>::value,
"Only char arrays and iox::strings are allowed as message type.");

const auto& derivedThis = *static_cast<const Derived*>(this);
Expand All @@ -47,7 +47,7 @@ template <typename Derived, typename ValueType>
template <typename StringType>
inline ValueType& ExpectWithValue<Derived, ValueType>::expect(const StringType& msg) & noexcept
{
static_assert(cxx::is_char_array<StringType>::value || is_cxx_string<StringType>::value,
static_assert(is_char_array<StringType>::value || is_cxx_string<StringType>::value,
"Only char arrays and iox::strings are allowed as message type.");

auto& derivedThis = *static_cast<Derived*>(this);
Expand Down Expand Up @@ -131,7 +131,7 @@ template <typename Derived, typename ValueType>
template <typename Functor>
inline Derived& AndThenWithValue<Derived, ValueType>::and_then(const Functor& callable) & noexcept
{
static_assert(cxx::is_invocable<Functor, ValueType&>::value,
static_assert(is_invocable<Functor, ValueType&>::value,
"Only callables with a signature of void(ValueType&) are allowed!");

auto& derivedThis = *static_cast<Derived*>(this);
Expand All @@ -156,7 +156,7 @@ template <typename Derived, typename ValueType>
template <typename Functor>
inline const Derived& AndThenWithValue<Derived, ValueType>::and_then(const Functor& callable) const& noexcept
{
static_assert(cxx::is_invocable<Functor, const ValueType&>::value,
static_assert(is_invocable<Functor, const ValueType&>::value,
"Only callables with a signature of void(const ValueType&) are allowed!");

const auto& derivedThis = *static_cast<const Derived*>(this);
Expand Down Expand Up @@ -224,7 +224,7 @@ template <typename Derived, typename ErrorType>
template <typename Functor>
inline Derived& OrElseWithValue<Derived, ErrorType>::or_else(const Functor& callable) & noexcept
{
static_assert(cxx::is_invocable<Functor, ErrorType&>::value,
static_assert(is_invocable<Functor, ErrorType&>::value,
"Only callables with a signature of void(ErrorType&) are allowed!");

auto& derivedThis = *static_cast<Derived*>(this);
Expand All @@ -249,7 +249,7 @@ template <typename Derived, typename ErrorType>
template <typename Functor>
inline const Derived& OrElseWithValue<Derived, ErrorType>::or_else(const Functor& callable) const& noexcept
{
static_assert(cxx::is_invocable<Functor, ErrorType&>::value,
static_assert(is_invocable<Functor, ErrorType&>::value,
"Only callables with a signature of void(const ErrorType&) are allowed!");

const auto& derivedThis = *static_cast<const Derived*>(this);
Expand Down
8 changes: 4 additions & 4 deletions iceoryx_hoofs/design/include/iox/functional_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#define IOX_HOOFS_DESIGN_FUNCTIONAL_INTERFACE_HPP

#include "iceoryx_hoofs/cxx/function_ref.hpp"
#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iceoryx_platform/unistd.hpp"
#include "iox/type_traits.hpp"

#include <utility>

Expand All @@ -32,7 +32,7 @@ struct HasValueMethod : std::false_type
};

template <typename Derived>
struct HasValueMethod<Derived, cxx::void_t<decltype(std::declval<Derived>().value())>> : std::true_type
struct HasValueMethod<Derived, void_t<decltype(std::declval<Derived>().value())>> : std::true_type
{
};

Expand All @@ -42,7 +42,7 @@ struct HasGetErrorMethod : std::false_type
};

template <typename Derived>
struct HasGetErrorMethod<Derived, cxx::void_t<decltype(std::declval<Derived>().get_error())>> : std::true_type
struct HasGetErrorMethod<Derived, void_t<decltype(std::declval<Derived>().get_error())>> : std::true_type
{
};

Expand Down Expand Up @@ -426,7 +426,7 @@ struct FunctionalInterfaceImpl<Derived, void, ErrorType>
/// a reference to the underlying error.
///
/// @note When inheriting from this type one does not have to write additional unit tests.
/// Instead add a factory for your class to "test_cxx_functional_interface_types.hpp",
/// Instead add a factory for your class to "test_design_functional_interface_types.hpp",
/// add the type to the FunctionalInterfaceImplementations and all typed tests will be
/// generated.
template <typename Derived, typename ValueType, typename ErrorType>
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/design/include/iox/newtype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef IOX_HOOFS_DESIGN_NEWTYPE_HPP
#define IOX_HOOFS_DESIGN_NEWTYPE_HPP

#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iox/algorithm.hpp"
#include "iox/detail/newtype/assignment.hpp"
#include "iox/detail/newtype/comparable.hpp"
#include "iox/detail/newtype/constructor.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define IOX_HOOFS_CONCURRENT_RESIZEABLE_LOCKFREE_QUEUE_HPP

#include "iceoryx_hoofs/concurrent/lockfree_queue.hpp"
#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iox/type_traits.hpp"
#include "iox/vector.hpp"

#include <atomic>
Expand Down Expand Up @@ -111,8 +111,7 @@ class ResizeableLockFreeQueue : protected LockFreeQueue<ElementType, MaxCapacity
/// @param[in] removeHandler is a function taking an element which specifies
/// what to do with removed elements should the need for removal arise.
/// @return true if the capacity was successfully set, false otherwise
template <typename Function,
typename = typename std::enable_if<cxx::is_invocable<Function, ElementType>::value>::type>
template <typename Function, typename = typename std::enable_if<is_invocable<Function, ElementType>::value>::type>
bool setCapacity(const uint64_t newCapacity, Function&& removeHandler) noexcept;

/// @brief Set the capacity to a new capacity between 0 and MaxCapacity, if the capacity is reduced
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/include/iceoryx_hoofs/cxx/function_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// AXIVION Next Line AutosarC++19_03-A16.2.2 : Needed for Expects and Ensures macros
#include "iceoryx_hoofs/cxx/requires.hpp"
#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iox/type_traits.hpp"

#include <type_traits>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#ifndef IOX_HOOFS_CONCURRENT_SOFI_HPP
#define IOX_HOOFS_CONCURRENT_SOFI_HPP

#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iceoryx_platform/platform_correction.hpp"
#include "iox/type_traits.hpp"
#include "iox/uninitialized_array.hpp"

#include <atomic>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#ifndef IOX_HOOFS_STORABLE_FUNCTION_HPP
#define IOX_HOOFS_STORABLE_FUNCTION_HPP

#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp"
#include "iox/iceoryx_hoofs_types.hpp"
#include "iox/type_traits.hpp"

#include <iostream>
#include <utility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef IOX_HOOFS_MEMORY_RELATIVE_POINTER_DATA_HPP
#define IOX_HOOFS_MEMORY_RELATIVE_POINTER_DATA_HPP

#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iox/type_traits.hpp"

#include <cstdint>
#include <limits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef IOX_HOOFS_LOG_BUILDING_BLOCKS_CONSOLE_LOGGER_HPP
#define IOX_HOOFS_LOG_BUILDING_BLOCKS_CONSOLE_LOGGER_HPP

#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp"
#include "iceoryx_hoofs/log/building_blocks/logformat.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

#include <atomic>
#include <cstdint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef IOX_HOOFS_LOG_BUILDING_BLOCKS_LOGFORMAT_HPP
#define IOX_HOOFS_LOG_BUILDING_BLOCKS_LOGFORMAT_HPP

#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

#include <cstdint>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef IOX_HOOFS_LOG_BUILDING_BLOCKS_LOGGER_HPP
#define IOX_HOOFS_LOG_BUILDING_BLOCKS_LOGGER_HPP

#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

#include <atomic>
#include <cstdint>
Expand Down
5 changes: 2 additions & 3 deletions iceoryx_hoofs/include/iceoryx_hoofs/log/logstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef IOX_HOOFS_LOG_LOGSTREAM_HPP
#define IOX_HOOFS_LOG_LOGSTREAM_HPP

#include "iceoryx_hoofs/cxx/type_traits.hpp"
#include "iceoryx_hoofs/log/logger.hpp"
#include "iox/type_traits.hpp"

#include <string>

Expand Down Expand Up @@ -206,8 +206,7 @@ class LogStream
/// return stream;
/// };
/// @endcode
template <typename Callable,
typename = std::enable_if_t<cxx::is_invocable_r<LogStream&, Callable, LogStream&>::value>>
template <typename Callable, typename = std::enable_if_t<is_invocable_r<LogStream&, Callable, LogStream&>::value>>
LogStream& operator<<(const Callable& c) noexcept;

/// @brief Logging support for LogLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#ifndef IOX_HOOFS_POSIX_WRAPPER_POSIX_CALL_HPP
#define IOX_HOOFS_POSIX_WRAPPER_POSIX_CALL_HPP

#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iceoryx_hoofs/cxx/attributes.hpp"
#include "iox/algorithm.hpp"
#include "iox/attributes.hpp"
#include "iox/expected.hpp"
#include "iox/string.hpp"

Expand Down
23 changes: 23 additions & 0 deletions iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/algorithm.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2023 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_HOOFS_CXX_ALGORITHM_HPP
#define IOX_HOOFS_CXX_ALGORITHM_HPP

#include "iox/algorithm.hpp"
#pragma message( \
"Deprecated in 3.0, removed in 4.0, please include 'iox/algorithm.hpp' instead of 'iceoryx_hoofs/cxx/algorithm.hpp'")

#endif // IOX_HOOFS_CXX_ALGORITHM_HPP
Loading

0 comments on commit 2f87030

Please sign in to comment.